Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use type_of_target in all classifiers to reject regression targets #5060

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
amueller opened this issue Jul 30, 2015 · 5 comments
Closed

Use type_of_target in all classifiers to reject regression targets #5060

amueller opened this issue Jul 30, 2015 · 5 comments
Labels
Enhancement Moderate Anything that requires some knowledge of conventions and best practices

Comments

@amueller
Copy link
Member

I think we should use type_of_target / unique_labels in all classifiers to reject regression targets. Also adding a common test, clearly.

wdyt? @arjoly @jnothman @GaelVaroquaux might be interested.

@amueller amueller added Enhancement Moderate Anything that requires some knowledge of conventions and best practices Need Contributor labels Jul 30, 2015
@amueller
Copy link
Member Author

The following classifiers run on regression targets (and do garbage and possibly run very long)

from sklearn.datasets import load_boston
boston = load_boston()
from sklearn.utils.testing import all_estimators
classifiers = all_estimators(type_filter="classifier")

for name, Cl in classifiers:
    try:
        Cl().fit(boston.data, boston.target)
    except Exception as e:
        pass
    else:
        print(name)

AdaBoostClassifier
BaggingClassifier
DecisionTreeClassifier
ExtraTreeClassifier
ExtraTreesClassifier
GradientBoostingClassifier
KNeighborsClassifier
LabelPropagation
LabelSpreading
LinearSVC
LogisticRegression
LogisticRegressionCV
NearestCentroid
RadiusNeighborsClassifier
RandomForestClassifier
SVC

@vermouthmjl
Copy link
Contributor

I can try this.

@amueller
Copy link
Member Author

amueller commented Aug 4, 2015

sure, go for it :)

@vermouthmjl
Copy link
Contributor

#5084

@glouppe
Copy link
Contributor

glouppe commented Oct 20, 2015

Closed by #5084

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Moderate Anything that requires some knowledge of conventions and best practices
Projects
None yet
Development

No branches or pull requests

3 participants