Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add classes_ attribute NeuralNetClassifier #546
This is inferred from y default but can be overridden by passing
Also, add more rigorous tests to classifiers and regressor.
This is inferred from y default but can be overridden by passing classes explicitly during initialization.
That's if we really want to comply with the API. For example:
from sklearn.datasets import load_iris from sklearn.linear_model import LogisticRegression X, y = [, ], ['dog', 'cat'] clf = LogisticRegression(random_state=0, solver='lbfgs').fit(X, y) clf.classes_ clf.classes_ # array(['cat', 'dog'], dtype='<U3') clf.predict(X) # array(['dog', 'cat'], dtype='<U3')