Questions tagged [machine-learning]

Implementation questions about machine learning algorithms. General questions about machine learning (concepts, theory, methodology, terminology, etc.) should be posted to their specific communities.

Machine learning revolves around developing self-learning computer algorithms that function by virtue of discovering patterns in data and making intelligent decisions based on such patterns.

Machine learning is a subfield of computer science that evolved from the study of pattern recognition and computational learning theory in artificial intelligence. Machine learning explores the construction and study of algorithms that can learn from and make predictions about data. Such algorithms operate by building a model from example inputs in order to make data-driven predictions or decisions rather than following strictly static program instructions.

NOTE: If you want to use this tag for a question not directly concerning implementation, then consider posting on Cross Validated, Data Science, or Artificial Intelligence instead; otherwise you're probably off-topic. Please choose one site only and do not cross-post to more than one - see Is cross-posting a question on multiple Stack Exchange sites permitted if the question is on-topic for each site? (tl;dr: no).

Classic Problems:

Relevant Algorithms:

Applications:

Software:

Related-tags:

Video Lectures:-

55241 questions
91
votes
10 answers

Higher validation accuracy, than training accurracy using Tensorflow and Keras

I'm trying to use deep learning to predict income from 15 self reported attributes from a dating site. We're getting rather odd results, where our validation data is getting better accuracy and lower loss, than our training data. And this is…
Jasper
  • 1,018
  • 1
  • 10
  • 14
91
votes
7 answers

How to tell Keras stop training based on loss value?

Currently I use the following code: callbacks = [ EarlyStopping(monitor='val_loss', patience=2, verbose=0), ModelCheckpoint(kfold_weights_path, monitor='val_loss', save_best_only=True, verbose=0), ] model.fit(X_train.astype('float32'),…
ZFTurbo
  • 3,652
  • 3
  • 22
  • 27
91
votes
2 answers

cocktail party algorithm SVD implementation ... in one line of code?

In a slide within the introductory lecture on machine learning by Stanford's Andrew Ng at Coursera, he gives the following one line Octave solution to the cocktail party problem given the audio sources are recorded by two spatially separated…
gregS
  • 2,580
  • 5
  • 28
  • 33
90
votes
4 answers

Batch Normalization in Convolutional Neural Network

I am newbie in convolutional neural networks and just have idea about feature maps and how convolution is done on images to extract features. I would be glad to know some details on applying batch normalisation in CNN. I read this paper…
89
votes
3 answers

How to update the bias in neural network backpropagation?

Could someone please explain to me how to update the bias throughout backpropagation? I've read quite a few books, but can't find bias updating! I understand that bias is an extra input of 1 with a weight attached to it (for each neuron). There…
Katya
  • 1,126
  • 1
  • 8
  • 11
88
votes
12 answers

Sentiment analysis for Twitter in Python

I'm looking for an open source implementation, preferably in python, of Textual Sentiment Analysis (http://en.wikipedia.org/wiki/Sentiment_analysis). Is anyone familiar with such open source implementation I can use? I'm writing an application that…
Ran
  • 7,541
  • 12
  • 59
  • 72
88
votes
3 answers

What is the difference between loss function and metric in Keras?

It is not clear for me the difference between loss function and metrics in Keras. The documentation was not helpful for me.
Zaratruta
  • 2,097
  • 2
  • 20
  • 26
87
votes
3 answers

How should the learning rate change as the batch size change?

When I increase/decrease batch size of the mini-batch used in SGD, should I change learning rate? If so, then how? For reference, I was discussing with someone, and it was said that, when batch size is increased, the learning rate should be…
Tanmay
  • 1,091
  • 1
  • 9
  • 15
87
votes
5 answers

How to save & load xgboost model?

From the XGBoost guide: After training, the model can be saved. bst.save_model('0001.model') The model and its feature map can also be dumped to a text file. # dump model bst.dump_model('dump.raw.txt') # dump model with feature…
Pengju Zhao
  • 1,439
  • 3
  • 14
  • 17
86
votes
8 answers

How to save final model using keras?

I use KerasClassifier to train the classifier. The code is below: import numpy from pandas import read_csv from keras.models import Sequential from keras.layers import Dense from keras.wrappers.scikit_learn import KerasClassifier from keras.utils…
yensheng
  • 1,315
  • 2
  • 14
  • 22
85
votes
7 answers

How do I find Wally with Python?

Shamelessly jumping on the bandwagon :-) Inspired by How do I find Waldo with Mathematica and the followup How to find Waldo with R, as a new python user I'd love to see how this could be done. It seems that python would be better suited to this…
tdc
  • 8,219
  • 11
  • 41
  • 63
85
votes
2 answers

What is the difference between pipeline and make_pipeline in scikit-learn?

I got this from the sklearn webpage: Pipeline: Pipeline of transforms with a final estimator Make_pipeline: Construct a Pipeline from the given estimators. This is a shorthand for the Pipeline constructor. But I still do not understand when I…
Aizzaac
  • 3,146
  • 8
  • 29
  • 61
85
votes
4 answers

classifiers in scikit-learn that handle nan/null

I was wondering if there are classifiers that handle nan/null values in scikit-learn. I thought random forest regressor handles this but I got an error when I call predict. X_train = np.array([[1, np.nan, 3],[np.nan, 5, 6]]) y_train = np.array([1,…
anthonybell
  • 5,790
  • 7
  • 42
  • 60
85
votes
13 answers

How can I build a model to distinguish tweets about Apple (Inc.) from tweets about apple (fruit)?

See below for 50 tweets about "apple." I have hand labeled the positive matches about Apple Inc. They are marked as 1 below. Here are a couple of lines: 1|“@chrisgilmer: Apple targets big business with new iOS 7 features http://bit.ly/15F9JeF ”.…
SAL
  • 834
  • 1
  • 8
  • 16
84
votes
12 answers

How can I use a pre-trained neural network with grayscale images?

I have a dataset containing grayscale images and I want to train a state-of-the-art CNN on them. I'd very much like to fine-tune a pre-trained model (like the ones here). The problem is that almost all models I can find the weights for have been…
Jcart
  • 950
  • 1
  • 7
  • 6