Skip to content

Commit

Permalink
Merge branch 'main' into update-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
fkiraly committed Aug 26, 2023
2 parents a0591d1 + be2b1f0 commit 37974df
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions examples/custom_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import numpy as np
from scipy.stats import norm
from sklearn.datasets.base import load_boston
from sklearn.datasets.base import load_diabetes
from sklearn.model_selection import train_test_split

from skpro.base import ProbabilisticEstimator
Expand Down Expand Up @@ -50,7 +50,7 @@ def fit(self, X, y):
# Use custom model
model = MyCustomModel()

X, y = load_boston(return_X_y=True)
X, y = load_diabetes(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3)
y_pred = model.fit(X_train, y_train).predict(X_test)
print("Loss: %f+-%f" % log_loss(y_test, y_pred, return_std=True))
4 changes: 2 additions & 2 deletions examples/parametric/hyperparameters.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# LEGACY MODULE - TODO: remove or refactor
from sklearn.datasets.base import load_boston
from sklearn.datasets.base import load_diabetes
from sklearn.ensemble import RandomForestRegressor
from sklearn.model_selection import GridSearchCV

Expand All @@ -14,7 +14,7 @@
clf = GridSearchCV(model, parameters)

# Optimize hyperparameters
X, y = load_boston(return_X_y=True)
X, y = load_diabetes(return_X_y=True)
clf.fit(X, y)

print("Best score is %f for parameter: %s" % (clf.best_score_, clf.best_params_))
Expand Down
4 changes: 2 additions & 2 deletions examples/parametric/simple.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# LEGACY MODULE - TODO: remove or refactor
from sklearn.datasets.base import load_boston
from sklearn.datasets.base import load_diabetes
from sklearn.ensemble import RandomForestRegressor
from sklearn.model_selection import train_test_split

Expand All @@ -14,7 +14,7 @@
)

# Train and predict on boston housing data
X, y = load_boston(return_X_y=True)
X, y = load_diabetes(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3)
y_pred = model.fit(X_train, y_train).predict(X_test)

Expand Down
4 changes: 2 additions & 2 deletions examples/simple.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
from sklearn.datasets.base import load_boston
from sklearn.datasets.base import load_diabetes
from sklearn.model_selection import train_test_split

from skpro.baselines import DensityBaseline
from skpro.metrics import log_loss

# Load boston housing data
X, y = load_boston(return_X_y=True)
X, y = load_diabetes(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3)

# Train and predict on boston housing data using a baseline model
Expand Down
4 changes: 2 additions & 2 deletions skpro/workflow/manager/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import urllib.request

import numpy as np
from sklearn.datasets import load_boston, load_diabetes
from sklearn.datasets import load_diabetes
from sklearn.model_selection import train_test_split


Expand Down Expand Up @@ -70,7 +70,7 @@ def __init__(self, X=None, y=None, split=0.2, name=None, random_state=None):
# autoload sklearn datasets, urls and files
name = X
if name.lower() == "boston":
X, y = load_boston(return_X_y=True)
X, y = load_diabetes(return_X_y=True)
elif name.lower() == "diabetes":
X, y = load_diabetes(return_X_y=True)
elif name.startswith("http"):
Expand Down

0 comments on commit 37974df

Please sign in to comment.