¡@

Home 

python Programming Glossary: y_train

use scikit-learn to classify into multiple categories

http://stackoverflow.com/questions/10526579/use-scikit-learn-to-classify-into-multiple-categories

per piece of text. Below is the sample code i am using y_train 'New York' 'London' train_set new york nyc big apple london.. alpha 1 clf OneVsRestClassifier base_clf .fit X_vectorized y_train Y_pred clf.predict smatrix2 print Y_pred Result 'New York' 'London'.. great and so is london i like london better than new york y_train 0 0 0 0 0 0 1 1 1 1 1 1 0 1 0 1 X_test np.array 'nice day in..

How to calculate precision, recall and F-score with libSVM in python

http://stackoverflow.com/questions/16927964/how-to-calculate-precision-recall-and-f-score-with-libsvm-in-python

iris load_iris X iris.data 2 y iris.target X_train X_test y_train y_test train_test_split X y test_size 0.2 # svm classification.. clf svm.SVC kernel 'rbf' gamma 0.7 C 1.0 .fit X_train y_train y_predicted clf.predict X_test # performance print Classification..

How do I resolve 'NoneType' object has no attribute 'write' error with scikit-learn digits dataset?

http://stackoverflow.com/questions/17139658/how-do-i-resolve-nonetype-object-has-no-attribute-write-error-with-scikit-le

scikit_exercise.py line 30 in module print knn.fit X_train y_train .score X_test y_test File C Python33 lib site packages sklearn.. n_samples len X_digits X_train X_digits .9 n_samples y_train y_digits .9 n_samples X_test X_digits .9 n_samples y_test y_digits.. print 'KNN score f' knn.fit X_train y_train .score X_test y_test print 'LogisticRegression score f' logistic.fit..