-
Notifications
You must be signed in to change notification settings - Fork 1
/
model_zoo.py
112 lines (94 loc) · 5.8 KB
/
model_zoo.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
"""
This module provides an easy way of accessing all available machine learning models
and provides some default models to use for classification and regression tasks.
"""
from sklearn.dummy import DummyClassifier # pylint: disable=W0611
from sklearn.dummy import DummyRegressor # pylint: disable=W0611
from sklearn.isotonic import IsotonicRegression # pylint: disable=W0611
from sklearn.neighbors import KNeighborsClassifier # pylint: disable=W0611
from sklearn.neighbors import KNeighborsRegressor # pylint: disable=W0611
from sklearn.linear_model import LinearRegression # pylint: disable=W0611
from sklearn.linear_model import Ridge # pylint: disable=W0611
from sklearn.linear_model import RidgeCV # pylint: disable=W0611
from sklearn.linear_model import Lasso # pylint: disable=W0611
from sklearn.linear_model import LassoCV # pylint: disable=W0611
from sklearn.linear_model import ElasticNet # pylint: disable=W0611
from sklearn.linear_model import ElasticNetCV # pylint: disable=W0611
from sklearn.linear_model import LogisticRegression # pylint: disable=W0611
from sklearn.linear_model import RidgeClassifier # pylint: disable=W0611
from sklearn.linear_model import RidgeClassifierCV # pylint: disable=W0611
from sklearn.linear_model import SGDClassifier # pylint: disable=W0611
from sklearn.linear_model import Perceptron # pylint: disable=W0611
from sklearn.linear_model import PassiveAggressiveClassifier # pylint: disable=W0611
from sklearn.linear_model import PassiveAggressiveRegressor # pylint: disable=W0611
from sklearn.kernel_ridge import KernelRidge # pylint: disable=W0611
from sklearn.neural_network import MLPClassifier # pylint: disable=W0611
from sklearn.neural_network import MLPRegressor # pylint: disable=W0611
from sklearn.svm import LinearSVC # pylint: disable=W0611
from sklearn.svm import LinearSVR # pylint: disable=W0611
from sklearn.svm import SVC # pylint: disable=W0611
from sklearn.svm import SVR # pylint: disable=W0611
from sklearn.tree import DecisionTreeClassifier # pylint: disable=W0611
from sklearn.tree import DecisionTreeRegressor # pylint: disable=W0611
from sklearn.tree import ExtraTreeClassifier # pylint: disable=W0611
from sklearn.tree import ExtraTreeRegressor # pylint: disable=W0611
from sklearn.ensemble import AdaBoostClassifier # pylint: disable=W0611
from sklearn.ensemble import AdaBoostRegressor # pylint: disable=W0611
from sklearn.ensemble import GradientBoostingClassifier # pylint: disable=W0611
from sklearn.ensemble import GradientBoostingRegressor # pylint: disable=W0611
from sklearn.ensemble import RandomForestClassifier # pylint: disable=W0611
from sklearn.ensemble import RandomForestRegressor # pylint: disable=W0611
from sklearn.ensemble import ExtraTreesClassifier # pylint: disable=W0611
from sklearn.ensemble import BaggingClassifier # pylint: disable=W0611
from sklearn.naive_bayes import BernoulliNB # pylint: disable=W0611
from sklearn.naive_bayes import CategoricalNB # pylint: disable=W0611
from sklearn.naive_bayes import ComplementNB # pylint: disable=W0611
from sklearn.naive_bayes import GaussianNB # pylint: disable=W0611
from sklearn.naive_bayes import MultinomialNB # pylint: disable=W0611
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis # pylint: disable=W0611
from sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis # pylint: disable=W0611
from sklearn.gaussian_process import GaussianProcessClassifier # pylint: disable=W0611
from sklearn.gaussian_process import GaussianProcessRegressor # pylint: disable=W0611
# XGBoost library
from xgboost import XGBRegressor # pylint: disable=W0611
from xgboost import XGBClassifier # pylint: disable=W0611
# scikit-elm library
from skelm import ELMRegressor # pylint: disable=W0611
from skelm import ELMClassifier # pylint: disable=W0611
DEFAULT_REGRESSION_METRICS = ["R2", "MSE", "MAE"]
DEFAULT_CLASSIFICATION_METRICS = ["ACC", "F1W"]
DEFAULT_REGRESSION_MODELS = [
("Dummy Mean", DummyRegressor(strategy="mean"), {}),
("Dummy Median", DummyRegressor(strategy="median"), {}),
("Linear Regression", LinearRegression(), {}),
("Decision Tree", DecisionTreeRegressor(), {}),
("SVR", SVR(), {}),
("Linear SVR", LinearSVR(dual=True), {}),
("Ridge", Ridge(), {}),
("Passive Aggressive", PassiveAggressiveRegressor(), {}),
("KNN", KNeighborsRegressor(), {}),
("Neural Network Regressor", MLPRegressor(), {}),
("Gaussian Process", GaussianProcessRegressor(), {}),
("Random Forest", RandomForestRegressor(), {}),
("AdaBoost", AdaBoostRegressor(), {}),
("Gradient Boosting", GradientBoostingRegressor(), {}),
]
DEFAULT_CLASSIFICATION_MODELS = [
("Dummy", DummyClassifier(strategy="most_frequent"), {}),
("Decision Tree", DecisionTreeClassifier(random_state=0), {}),
("SVC", SVC(gamma="auto", kernel="rbf"), {}),
("Linear SVC", LinearSVC(random_state=0, tol=1e-5, dual=True), {}),
("Perceptron", Perceptron(random_state=0), {}),
("Logistic Regression", LogisticRegression(random_state=0, solver="lbfgs", multi_class="auto"), {}),
("Ridge Classifier", RidgeClassifier(random_state=0), {}),
("SGD Classifier", SGDClassifier(random_state=0), {}),
("Passive Aggressive Classifier", PassiveAggressiveClassifier(random_state=0), {}),
("K Neighbors Classifier", KNeighborsClassifier(), {}),
("Neural Network Classifier", MLPClassifier(random_state=0), {}),
("Gaussian Process Classifier", GaussianProcessClassifier(random_state=0), {}),
("Random Forest Classifier", RandomForestClassifier(random_state=0), {}),
("AdaBoost Classifier", AdaBoostClassifier(random_state=0), {}),
("Gradient Boosting Classifier", GradientBoostingClassifier(random_state=0), {}),
("Extra Trees Classifier", ExtraTreesClassifier(random_state=0), {}),
("Bagging Classifier", BaggingClassifier(random_state=0), {}),
]