Skip to content

Commit

Permalink
update basic_usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
augustebaum committed Oct 9, 2024
1 parent c49b6e6 commit 32e26fd
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
26 changes: 26 additions & 0 deletions examples/basic_usage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,32 @@
"_Stay tuned for some new features!_"
]
},
{
"cell_type": "markdown",
"id": "e5e0c4ae",
"metadata": {},
"source": [
"---\n",
"# Cross-validation with skore"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "09fe42fe",
"metadata": {},
"outputs": [],
"source": [
"from sklearn import datasets, linear_model\n",
"from skore.cross_validate import cross_validate\n",
"diabetes = datasets.load_diabetes()\n",
"X = diabetes.data[:150]\n",
"y = diabetes.target[:150]\n",
"lasso = linear_model.Lasso()\n",
"\n",
"cv_results = cross_validate(lasso, X, y, cv=3)"
]
},
{
"cell_type": "markdown",
"id": "555665f0",
Expand Down
14 changes: 14 additions & 0 deletions examples/basic_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,20 @@ def my_func(x):
# %% [markdown]
# _Stay tuned for some new features!_

# %% [markdown]
# ---
# # Cross-validation with skore

# %%
from sklearn import datasets, linear_model
from skore.cross_validate import cross_validate
diabetes = datasets.load_diabetes()
X = diabetes.data[:150]
y = diabetes.target[:150]
lasso = linear_model.Lasso()

cv_results = cross_validate(lasso, X, y, cv=3)

# %% [markdown]
# ---
# # Manipulating the skore UI
Expand Down

0 comments on commit 32e26fd

Please sign in to comment.