Most Popular

1500 questions
27
votes
2 answers

local minima vs saddle points in deep learning

I heard Andrew Ng (in a video I unfortunately can't find anymore) talk about how the understanding of local minima in deep learning problems has changed in the sense that they are now regarded as less problematic because in high-dimensional spaces…
oW_
  • 6,347
  • 4
  • 28
  • 47
27
votes
3 answers

How to sum values grouped by two columns in pandas

I have a Pandas DataFrame like this: df = pd.DataFrame({ 'Date': ['2017-1-1', '2017-1-1', '2017-1-2', '2017-1-2', '2017-1-3'], 'Groups': ['one', 'one', 'one', 'two', 'two'], 'data': range(1, 6)}) Date Groups data 0 …
Kevin
  • 533
  • 2
  • 5
  • 12
27
votes
4 answers

Gradients for bias terms in backpropagation

I was trying to implement neural network from scratch to understand the maths behind it. My problem is completely related to backpropagation when we take derivative with respect to bias) and I derived all the equations used in backpropagation. Now…
user34042
  • 405
  • 1
  • 4
  • 7
27
votes
3 answers

How to deal with string labels in multi-class classification with keras?

I am newbie on machine learning and keras and now working a multi-class image classification problem using keras. The input is tagged image. After some pre-processing, the training data is represented in Python list as: [["dog",…
Dracarys
  • 393
  • 1
  • 3
  • 5
27
votes
4 answers

Is there a straightforward way to run pandas.DataFrame.isin in parallel?

I have a modeling and scoring program that makes heavy use of the DataFrame.isin function of pandas, searching through lists of facebook "like" records of individual users for each of a few thousand specific pages. This is the most time-consuming…
Therriault
  • 871
  • 1
  • 8
  • 13
27
votes
3 answers

Encoding categorical variables using likelihood estimation

I am trying to understand how I can encode categorical variables using likelihood estimation, but have had little success so far. Any suggestions would be greatly appreciated.
small dwarf
  • 271
  • 1
  • 3
  • 4
26
votes
2 answers

Text categorization: combining different kind of features

The problem I am tackling is categorizing short texts into multiple classes. My current approach is to use tf-idf weighted term frequencies and learn a simple linear classifier (logistic regression). This works reasonably well (around 90% macro F-1…
elmille
  • 361
  • 1
  • 3
  • 4
26
votes
7 answers

Is Python a viable language to do statistical analysis in?

I originally came from R, but Python seems to be the more common language these days. Ideally, I would do all my coding in Python as the syntax is easier and I've had more real life experience using it - and switching back and forth is a pain. Out…
confused
  • 488
  • 4
  • 11
26
votes
5 answers

Extra output layer in a neural network (Decimal to binary)

I'm working through a question from the online book. I can understand that if the additional output layer is of 5 output neurons, I could probably set bias at 0.5 and weight of 0.5 each for the previous layer. But the question now ask for a new…
Victor Yip
  • 363
  • 1
  • 3
  • 5
26
votes
4 answers

What is a channel in a CNN?

I was reading an article about convolutional neural networks, and I found something that I don't understand, which is: The filter must have the same number of channels as the input image so that the element-wise multiplication can take place. Now,…
J.D.
  • 861
  • 5
  • 18
  • 30
26
votes
2 answers

Why do we have to divide by 2 in the ML squared error cost function?

I'm not sure why you need to multiply by $\frac1{2m}$ in the beginning. I understand that you would have to divide the whole sum by $\frac1{m}$, but why do we have to multiply $m$ by two? Is it because we have two $\theta$ here in the example?
Marton Langa
  • 363
  • 1
  • 3
  • 4
26
votes
10 answers

GraphViz not working when imported inside PydotPlus (`GraphViz's executables not found`)

I've been trying to make these packages work for quite some time now but with no success. Basically the error is: GraphViz's Executables not found EDIT: I had not posted a terminal log with the error originally. I'm using Ubuntu now so I won't be…
psygo
  • 525
  • 1
  • 6
  • 14
26
votes
4 answers

How to make a decision tree with both continuous and categorical variables in the dataset?

Let's say I have 3 categorical and 2 continuous attributes in a dataset. How do I build a decision tree using these 5 variables? Edit: For categorical variables, it is easy to say that we will split them just by {yes/no} and calculate the total gini…
Sahil Chaturvedi
  • 435
  • 1
  • 4
  • 7
26
votes
5 answers

Natural Language to SQL query

I have been working on developing a system "Converting Natural Language to SQL Query". I have read the answers from the similar questions, but was not able to get the information that I was looking for. Below is the flowchart for such system which I…
deepguy
  • 1,441
  • 8
  • 18
  • 39
26
votes
4 answers

Different Test Set and Training Set Distribution

I am working on a data science competition for which the distribution of my test set is different from the training set. I want to subsample observations from training set which closely resembles test set. How can I do this?
Pooja
  • 261
  • 1
  • 3
  • 3