Skip to content

Commit

Permalink
docs: Use logistic regression instead of SVC on the Iris dataset (#1087)
Browse files Browse the repository at this point in the history
Fix #1018 

In quick start example, do not use SVC on the Iris dataset, but rather
logistic regression
  • Loading branch information
sylvaincom authored Jan 12, 2025
1 parent 7dcb197 commit 5314915
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,17 @@ You can find information on the latest version [here](https://anaconda.org/conda
2. Evaluate your model using `skore.CrossValidationReporter`:
```python
from sklearn.datasets import load_iris
from sklearn.svm import SVC
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression

X, y = load_iris(return_X_y=True)
clf = SVC(kernel="linear", C=1, random_state=0)
clf_pipeline = Pipeline([
('scaler', StandardScaler()),
('clf', LogisticRegression())
])

reporter = skore.CrossValidationReporter(clf, X, y, cv=5)
reporter = skore.CrossValidationReporter(clf_pipeline, X, y, cv=5)

# Store the results in the project
my_project.put("cv_reporter", reporter)
Expand Down
8 changes: 5 additions & 3 deletions examples/getting_started/plot_quick_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@

# %%
from sklearn.datasets import load_iris
from sklearn.svm import SVC
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression

X, y = load_iris(return_X_y=True)
clf = SVC(kernel="linear", C=1, random_state=0)
clf_pipeline = Pipeline([("scaler", StandardScaler()), ("clf", LogisticRegression())])

reporter = skore.CrossValidationReporter(clf, X, y, cv=5)
reporter = skore.CrossValidationReporter(clf_pipeline, X, y, cv=5)

# %%
# Store the results in the skore project:
Expand Down

0 comments on commit 5314915

Please sign in to comment.