Weak correlation even with y-training set inside x-training set in SKlearn
<p>We are using Python + SK-Learn with the MLPClassifier. We are getting relative bad results. As a sanity check we tried to add the y-desired output to the x-input set. In this case you would expect to have 100% score. But that's not the case, the score is pretty low (20%) which is much better than random guessing but still really bad. We have around 150 inputs (most of them are booleans) and 1 output which is an integer between 1 and 1500. When we divide the numbers to around 5 categories (integers between 0 and 4) the score is around 96%.</p>

<pre><code>import numpy as np
from sklearn.neural_network import MLPClassifier
from sklearn.cross_validation import train_test_split
from sklearn.preprocessing import StandardScaler
import cPickle
from sklearn.metrics import mean_squared_error
from sklearn.metrics import mean_absolute_error


scaler = StandardScaler()
xset = np.genfromtxt('xkey.csv', delimiter=",")
yset = np.genfromtxt('ykey.csv', delimiter=",")
# yset = np.rint((5-1)*(yset)/np.max(yset))
print "Number of categories: " + str(np.max(yset)+1)
X_train, X_test, y_train, y_test = train_test_split(xset, yset, test_size=0.10)
scaler.fit(X_train)
X_train = scaler.transform(X_train)
X_test = scaler.transform(X_test)

clf = MLPClassifier(algorithm='adam', alpha=1e-5, hidden_layer_sizes=(100,20))
clf.fit(X_train, y_train)

score = clf.score(X_test,y_test)
print ("score: "+str(score))

ypredicted = clf.predict(X_test)
sqerr = mean_squared_error(ypredicted, y_test)
err = mean_absolute_error(ypredicted, y_test)

print ("err: " + str(err))
print ("sqerr: " + str(sqerr))
</code></pre>