407a5112ab430db6f23fc4317a7400ada797d274,examples/bench.py,,,#,5
Before Change
import mord
import numpy as np
for n_samples in range(40, 200, 20):
X, y = datasets.make_classification(n_samples=n_samples, n_features=10000,
n_classes=5, n_informative=5)
clf1 = linear_model.LogisticRegressionCV(solver="lbfgs",
multi_class="multinomial")
clf2 = grid_search.GridSearchCV(mord.LogisticIT(), {"alpha": np.logspace(
-3, 3, 10)})
cv = cross_validation.StratifiedShuffleSplit(y, test_size=0.3)
print(cross_validation.cross_val_score(clf1, X, y, cv=cv).mean())
print(cross_validation.cross_val_score(clf2, X, y, cv=cv).mean())
print()
After Change
clf1 = linear_model.LogisticRegression(
solver="lbfgs", multi_class="multinomial")
clf1.fit(X, y)
print("Mean Absolute Error of LogisticRegression: %s" %
metrics.mean_absolute_error(clf1.predict(X), y))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: fabianp/mord
Commit Name: 407a5112ab430db6f23fc4317a7400ada797d274
Time: 2015-10-21
Author: f@bianp.net
File Name: examples/bench.py
Class Name:
Method Name:
Project Name: scikit-learn/scikit-learn
Commit Name: 3250ffb785fed45712868fd618929a3015639b1c
Time: 2020-07-16
Author: 34657725+jeremiedbb@users.noreply.github.com
File Name: sklearn/cluster/tests/test_k_means.py
Class Name:
Method Name: test_transform
Project Name: scikit-optimize/scikit-optimize
Commit Name: 45ffcc4d387da3e767ea675640f411dbea349ff0
Time: 2017-06-28
Author: iaroslav.email@gmail.com
File Name: skopt/wrappers/scikit_learn.py
Class Name:
Method Name: