OneAgainstRestClassifier.predict will accept design matrices with the wrong number of features. Here I train on 1000 features and test on 1500. It quite happily returns predictions instead of raising an error as SVC would. Same thing happens if I test on 500 features.
import numpy as np from sklearn.multiclass import OneVsRestClassifier from sklearn.svm import SVC rng = np.random.RandomState([1,2,3]) X = rng.randn(1000,1000) y = rng.randint(0,10,(1000,)) svm = OneVsRestClassifier(SVC(kernel = 'linear', C = 1.0)).fit(X,y) X2 = rng.randn(1000,1500) print svm.predict(X2).shape ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Scikit-learn-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
