Skip to content

Commit 554b023

Browse files
committed
updating examples according to the new sklearn version
1 parent ff36b78 commit 554b023

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

examples/example_calibrating_classifiers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393
# DS methods.
9494
calibrated_pool = []
9595
for clf in pool_classifiers:
96-
calibrated = CalibratedClassifierCV(base_estimator=clf, cv='prefit')
96+
calibrated = CalibratedClassifierCV(estimator=clf, cv='prefit')
9797
calibrated.fit(X_dsel, y_dsel)
9898
calibrated_pool.append(calibrated)
9999

examples/plot_random_forest.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
rng = np.random.RandomState(42)
4444

4545
# Fetch a classification dataset from OpenML
46-
data = fetch_openml(name='credit-g', version=1, cache=False, as_frame=False)
46+
data = fetch_openml(name='phoneme', version=1,
47+
cache=False, as_frame=False)
4748
X = data.data
4849
y = data.target
4950
# split the data into training and test data
@@ -57,7 +58,7 @@
5758
RF.fit(X_train, y_train)
5859

5960
X_train, X_dsel, y_train, y_dsel = train_test_split(X_train, y_train,
60-
test_size=0.50,
61+
test_size=0.750,
6162
random_state=rng)
6263

6364
stacked = StackedClassifier(RF, LogisticRegression())

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy