calibration not improves
This commit is contained in:
parent
d1d4e08314
commit
8d45db86b9
|
|
@ -57,7 +57,7 @@ def main():
|
|||
|
||||
print('Fitting the Verificator')
|
||||
if args.C is None:
|
||||
params = {'C': np.logspace(-4, +3, 8)}
|
||||
params = {'C': np.logspace(-3, +3, 7)}
|
||||
C = 1.
|
||||
else:
|
||||
params = None
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ class AuthorshipVerificator:
|
|||
print(f'Best params: {self.estimator.best_params_} (cross-validation F1={f1_mean:.3f})')
|
||||
self.estimator = self.estimator.best_estimator_
|
||||
|
||||
self.estimator = CalibratedClassifierCV(base_estimator=self.estimator, cv=self.nfolds, ensemble=False)
|
||||
self.estimator.fit(X, y)
|
||||
#self.estimator = CalibratedClassifierCV(base_estimator=self.estimator, cv=self.nfolds, ensemble=False)
|
||||
#self.estimator.fit(X, y)
|
||||
|
||||
return self
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ from sklearn.base import (BaseEstimator, ClassifierMixin, RegressorMixin, clone,
|
|||
from sklearn.preprocessing import label_binarize, LabelBinarizer
|
||||
from sklearn.utils import check_array, indexable, column_or_1d
|
||||
from sklearn.utils.validation import check_is_fitted, check_consistent_length
|
||||
from sklearn.utils.validation import _check_sample_weight
|
||||
#from sklearn.utils.validation import _check_sample_weight
|
||||
from sklearn.isotonic import IsotonicRegression
|
||||
from sklearn.svm import LinearSVC
|
||||
from sklearn.model_selection import check_cv, cross_val_predict
|
||||
|
|
@ -586,4 +586,4 @@ def calibration_curve(y_true, y_prob, *, normalize=False, n_bins=5,
|
|||
prob_true = bin_true[nonzero] / bin_total[nonzero]
|
||||
prob_pred = bin_sums[nonzero] / bin_total[nonzero]
|
||||
|
||||
return prob_true, prob_pred
|
||||
return prob_true, prob_pred
|
||||
|
|
|
|||
Loading…
Reference in New Issue