Posts

Showing posts with the label machine-learning

Why do neural networks work so well?

Why do neural networks work so well? I understand all the computational steps of training a neural network with gradient descent using forwardprop and backprop, but I'm trying to wrap my head around why they work so much better than logistic regression. For now all I can think of is: A) the neural network can learn it's own parameters B) there are many more weights than simple logistic regression thus allowing for more complex hypotheses Can someone explain why a neural network works so well in general? I am a relative beginner. "work so well" is a subjective judgment. – Don Reba Jul 26 '16 at 16:53 that's true, what I meant is why do they work better than logistic regression? – Danny Liu Jul 26 '16 at 16:54 ...

Updated: reshape each row data into a (x, 1) array

Image
Updated: reshape each row data into a (x, 1) array Recently I was reading neural network and deep learning by Michael Nielsen (link) and wanted to test the neural network on loan default data. However after quite a few tries I still did not manage to transform my csv format data into the required matrix format by the script. The csv file contains 769 variables and 1 boolean default entry. looks like this: . v1 v2 v3 ... v770; 1. 1 2 3 ... 0; 2. 2 1 2 ... 1; ... This is how I do my import: import numpy as np tr_input = [np.reshape(genfromtxt('training.csv', delimiter=','), (769,10000))] tr_res = np.reshape(genfromtxt('training2.csv', delimiter=','),(1, 10000)) tr_test = [np.reshape(genfromtxt('testing.csv', delimiter=','), (769,2000))] tr_test2 = np.reshape(genfromtxt('testing2.csv', delimiter=','), (1, 2000)) test_data = list(zip(tr_test, tr_test2)) training_data = list(zip(tr_input, tr_res)) However it returns Traceb...