Skip to content

Commit

Permalink
Merge pull request #47 from aviadsusman/remove_calibration_model
Browse files Browse the repository at this point in the history
removed calibration model
  • Loading branch information
03bennej authored Jan 31, 2024
2 parents 2217461 + 672a754 commit 440360f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
11 changes: 1 addition & 10 deletions eipy/ei.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ class EnsembleIntegration:
Backend to use in joblib. See joblib.Parallel() for other options.
project_name : str, default='project'
Name of project.
calibration_model : sklearn estimator, default=None
Calibrate base predictor predictions with calibration_model. Intended for use
with sklearn's CalibratedClassifierCV().
model_building : bool, default=True
Whether or not to train and save final models.
verbose : int, default=1
Expand Down Expand Up @@ -138,7 +135,6 @@ def __init__(
random_state=None,
parallel_backend="loky",
project_name="project",
calibration_model=None,
model_building=True,
verbose=1,
):
Expand All @@ -157,7 +153,6 @@ def __init__(
self.random_state = random_state
self.parallel_backend = parallel_backend
self.project_name = project_name
self.calibration_model = calibration_model
self.model_building = model_building
self.verbose = verbose

Expand Down Expand Up @@ -568,11 +563,7 @@ def _train_predict_single_base_predictor(
strategy=self.sampling_strategy,
random_state=sample_random_state,
)

if self.calibration_model is not None:
self.calibration_model.estimator = model
model = self.calibration_model


model.fit(X_sample, y_sample)

if model_building:
Expand Down
2 changes: 0 additions & 2 deletions tests/test_ei.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
def test_ensemble_integration(sampling_strategy, dtype):

from sklearn.linear_model import LogisticRegression
from sklearn.calibration import CalibratedClassifierCV
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from xgboost import XGBClassifier
Expand Down Expand Up @@ -64,7 +63,6 @@ def test_ensemble_integration(sampling_strategy, dtype):
metrics=metrics,
random_state=42,
project_name="demo",
calibration_model=CalibratedClassifierCV(cv=2),
model_building=True)

# Train base models
Expand Down

0 comments on commit 440360f

Please sign in to comment.