diff --git a/examples/basic_usage.ipynb b/examples/basic_usage.ipynb index 5e0c9153..db3199b1 100644 --- a/examples/basic_usage.ipynb +++ b/examples/basic_usage.ipynb @@ -631,13 +631,39 @@ "cell_type": "markdown", "id": "57", "metadata": {}, + "source": [ + "---\n", + "## Cross-validation with skore" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "58", + "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, project=project)" + ] + }, + { + "cell_type": "markdown", + "id": "59", + "metadata": {}, "source": [ "_Stay tuned for some new features!_" ] }, { "cell_type": "markdown", - "id": "58", + "id": "60", "metadata": {}, "source": [ "---\n", @@ -649,7 +675,7 @@ { "cell_type": "code", "execution_count": null, - "id": "59", + "id": "61", "metadata": {}, "outputs": [], "source": [ @@ -662,7 +688,7 @@ { "cell_type": "code", "execution_count": null, - "id": "60", + "id": "62", "metadata": {}, "outputs": [], "source": [ @@ -675,7 +701,7 @@ { "cell_type": "code", "execution_count": null, - "id": "61", + "id": "63", "metadata": {}, "outputs": [], "source": [ @@ -687,7 +713,7 @@ { "cell_type": "code", "execution_count": null, - "id": "62", + "id": "64", "metadata": {}, "outputs": [], "source": [ @@ -700,7 +726,7 @@ { "cell_type": "code", "execution_count": null, - "id": "63", + "id": "65", "metadata": {}, "outputs": [], "source": [ @@ -713,7 +739,7 @@ { "cell_type": "code", "execution_count": null, - "id": "64", + "id": "66", "metadata": {}, "outputs": [], "source": [ @@ -726,7 +752,7 @@ { "cell_type": "code", "execution_count": null, - "id": "65", + "id": "67", "metadata": {}, "outputs": [], "source": [] diff --git a/examples/basic_usage.py b/examples/basic_usage.py index 964997fc..c117fe72 100644 --- a/examples/basic_usage.py +++ b/examples/basic_usage.py @@ -303,6 +303,20 @@ def my_func(x): project.put("my_fitted_pipeline", my_pipeline) +# %% [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, project=project) + # %% [markdown] # _Stay tuned for some new features!_ diff --git a/skore-ui/src/components/VegaWidget.vue b/skore-ui/src/components/VegaWidget.vue index 1b3f0744..191bbd44 100644 --- a/skore-ui/src/components/VegaWidget.vue +++ b/skore-ui/src/components/VegaWidget.vue @@ -1,8 +1,8 @@