mirror of
https://github.com/ArthurDanjou/ArtStudies.git
synced 2026-01-28 16:56:01 +01:00
Add Jupyter notebook for supervised machine learning algorithms and update dependencies
- Created a new Jupyter notebook: 2025_M2_ISF_TP_4.ipynb for supervised machine learning exercises, including data preparation, model building, and performance analysis. - Added 'imblearn' as a dependency in pyproject.toml to support handling imbalanced datasets. - Updated uv.lock to include the 'imbalanced-learn' package and its dependencies.
This commit is contained in:
@@ -46,7 +46,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 56,
|
||||
"execution_count": 1,
|
||||
"id": "97d58527",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -100,7 +100,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 57,
|
||||
"execution_count": 2,
|
||||
"id": "c9597b48",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -119,7 +119,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 58,
|
||||
"execution_count": 3,
|
||||
"id": "8051b5f4",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -163,7 +163,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 59,
|
||||
"execution_count": 4,
|
||||
"id": "c427a4b8",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
@@ -173,7 +173,7 @@
|
||||
"(824, 14)"
|
||||
]
|
||||
},
|
||||
"execution_count": 59,
|
||||
"execution_count": 4,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
@@ -200,7 +200,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 60,
|
||||
"execution_count": 5,
|
||||
"id": "c8fd3ee1",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
@@ -284,7 +284,7 @@
|
||||
"type": "float"
|
||||
}
|
||||
],
|
||||
"ref": "8fcd0abc-8334-4a0d-96b7-b6d7e17b3fb7",
|
||||
"ref": "e29190e7-d62c-4ab7-ab0a-43dd875c8b98",
|
||||
"rows": [
|
||||
[
|
||||
"count",
|
||||
@@ -760,7 +760,7 @@
|
||||
"max NaN 83421.850000 "
|
||||
]
|
||||
},
|
||||
"execution_count": 60,
|
||||
"execution_count": 5,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
@@ -795,7 +795,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 61,
|
||||
"execution_count": 6,
|
||||
"id": "1b156435",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
@@ -805,7 +805,7 @@
|
||||
"(824, 13)"
|
||||
]
|
||||
},
|
||||
"execution_count": 61,
|
||||
"execution_count": 6,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
@@ -817,7 +817,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 62,
|
||||
"execution_count": 7,
|
||||
"id": "0ef0fcc0",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -853,7 +853,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 63,
|
||||
"execution_count": 8,
|
||||
"id": "e130aae5",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -863,7 +863,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 9,
|
||||
"id": "c39e2ad0",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
@@ -1811,7 +1811,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 65,
|
||||
"execution_count": 10,
|
||||
"id": "a16215ab",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -1821,7 +1821,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 66,
|
||||
"execution_count": 11,
|
||||
"id": "532ca6c4",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
@@ -2764,7 +2764,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 67,
|
||||
"execution_count": 12,
|
||||
"id": "b8530717",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -2785,7 +2785,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 68,
|
||||
"execution_count": 13,
|
||||
"id": "4ff3847d",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -2814,7 +2814,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 14,
|
||||
"id": "6a1c7907",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -2845,14 +2845,14 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 70,
|
||||
"execution_count": 15,
|
||||
"id": "053e013c",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"data": {
|
||||
"text/html": [
|
||||
"<style>#sk-container-id-3 {\n",
|
||||
"<style>#sk-container-id-1 {\n",
|
||||
" /* Definition of color scheme common for light and dark mode */\n",
|
||||
" --sklearn-color-text: #000;\n",
|
||||
" --sklearn-color-text-muted: #666;\n",
|
||||
@@ -2883,15 +2883,15 @@
|
||||
" }\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 {\n",
|
||||
"#sk-container-id-1 {\n",
|
||||
" color: var(--sklearn-color-text);\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 pre {\n",
|
||||
"#sk-container-id-1 pre {\n",
|
||||
" padding: 0;\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 input.sk-hidden--visually {\n",
|
||||
"#sk-container-id-1 input.sk-hidden--visually {\n",
|
||||
" border: 0;\n",
|
||||
" clip: rect(1px 1px 1px 1px);\n",
|
||||
" clip: rect(1px, 1px, 1px, 1px);\n",
|
||||
@@ -2903,7 +2903,7 @@
|
||||
" width: 1px;\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-dashed-wrapped {\n",
|
||||
"#sk-container-id-1 div.sk-dashed-wrapped {\n",
|
||||
" border: 1px dashed var(--sklearn-color-line);\n",
|
||||
" margin: 0 0.4em 0.5em 0.4em;\n",
|
||||
" box-sizing: border-box;\n",
|
||||
@@ -2911,7 +2911,7 @@
|
||||
" background-color: var(--sklearn-color-background);\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-container {\n",
|
||||
"#sk-container-id-1 div.sk-container {\n",
|
||||
" /* jupyter's `normalize.less` sets `[hidden] { display: none; }`\n",
|
||||
" but bootstrap.min.css set `[hidden] { display: none !important; }`\n",
|
||||
" so we also need the `!important` here to be able to override the\n",
|
||||
@@ -2921,7 +2921,7 @@
|
||||
" position: relative;\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-text-repr-fallback {\n",
|
||||
"#sk-container-id-1 div.sk-text-repr-fallback {\n",
|
||||
" display: none;\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
@@ -2937,14 +2937,14 @@
|
||||
"\n",
|
||||
"/* Parallel-specific style estimator block */\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-parallel-item::after {\n",
|
||||
"#sk-container-id-1 div.sk-parallel-item::after {\n",
|
||||
" content: \"\";\n",
|
||||
" width: 100%;\n",
|
||||
" border-bottom: 2px solid var(--sklearn-color-text-on-default-background);\n",
|
||||
" flex-grow: 1;\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-parallel {\n",
|
||||
"#sk-container-id-1 div.sk-parallel {\n",
|
||||
" display: flex;\n",
|
||||
" align-items: stretch;\n",
|
||||
" justify-content: center;\n",
|
||||
@@ -2952,28 +2952,28 @@
|
||||
" position: relative;\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-parallel-item {\n",
|
||||
"#sk-container-id-1 div.sk-parallel-item {\n",
|
||||
" display: flex;\n",
|
||||
" flex-direction: column;\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-parallel-item:first-child::after {\n",
|
||||
"#sk-container-id-1 div.sk-parallel-item:first-child::after {\n",
|
||||
" align-self: flex-end;\n",
|
||||
" width: 50%;\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-parallel-item:last-child::after {\n",
|
||||
"#sk-container-id-1 div.sk-parallel-item:last-child::after {\n",
|
||||
" align-self: flex-start;\n",
|
||||
" width: 50%;\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-parallel-item:only-child::after {\n",
|
||||
"#sk-container-id-1 div.sk-parallel-item:only-child::after {\n",
|
||||
" width: 0;\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"/* Serial-specific style estimator block */\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-serial {\n",
|
||||
"#sk-container-id-1 div.sk-serial {\n",
|
||||
" display: flex;\n",
|
||||
" flex-direction: column;\n",
|
||||
" align-items: center;\n",
|
||||
@@ -2991,14 +2991,14 @@
|
||||
"\n",
|
||||
"/* Pipeline and ColumnTransformer style (default) */\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-toggleable {\n",
|
||||
"#sk-container-id-1 div.sk-toggleable {\n",
|
||||
" /* Default theme specific background. It is overwritten whether we have a\n",
|
||||
" specific estimator or a Pipeline/ColumnTransformer */\n",
|
||||
" background-color: var(--sklearn-color-background);\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"/* Toggleable label */\n",
|
||||
"#sk-container-id-3 label.sk-toggleable__label {\n",
|
||||
"#sk-container-id-1 label.sk-toggleable__label {\n",
|
||||
" cursor: pointer;\n",
|
||||
" display: flex;\n",
|
||||
" width: 100%;\n",
|
||||
@@ -3011,13 +3011,13 @@
|
||||
" gap: 0.5em;\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 label.sk-toggleable__label .caption {\n",
|
||||
"#sk-container-id-1 label.sk-toggleable__label .caption {\n",
|
||||
" font-size: 0.6rem;\n",
|
||||
" font-weight: lighter;\n",
|
||||
" color: var(--sklearn-color-text-muted);\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 label.sk-toggleable__label-arrow:before {\n",
|
||||
"#sk-container-id-1 label.sk-toggleable__label-arrow:before {\n",
|
||||
" /* Arrow on the left of the label */\n",
|
||||
" content: \"▸\";\n",
|
||||
" float: left;\n",
|
||||
@@ -3025,13 +3025,13 @@
|
||||
" color: var(--sklearn-color-icon);\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 label.sk-toggleable__label-arrow:hover:before {\n",
|
||||
"#sk-container-id-1 label.sk-toggleable__label-arrow:hover:before {\n",
|
||||
" color: var(--sklearn-color-text);\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"/* Toggleable content - dropdown */\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-toggleable__content {\n",
|
||||
"#sk-container-id-1 div.sk-toggleable__content {\n",
|
||||
" max-height: 0;\n",
|
||||
" max-width: 0;\n",
|
||||
" overflow: hidden;\n",
|
||||
@@ -3040,12 +3040,12 @@
|
||||
" background-color: var(--sklearn-color-unfitted-level-0);\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-toggleable__content.fitted {\n",
|
||||
"#sk-container-id-1 div.sk-toggleable__content.fitted {\n",
|
||||
" /* fitted */\n",
|
||||
" background-color: var(--sklearn-color-fitted-level-0);\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-toggleable__content pre {\n",
|
||||
"#sk-container-id-1 div.sk-toggleable__content pre {\n",
|
||||
" margin: 0.2em;\n",
|
||||
" border-radius: 0.25em;\n",
|
||||
" color: var(--sklearn-color-text);\n",
|
||||
@@ -3053,79 +3053,79 @@
|
||||
" background-color: var(--sklearn-color-unfitted-level-0);\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-toggleable__content.fitted pre {\n",
|
||||
"#sk-container-id-1 div.sk-toggleable__content.fitted pre {\n",
|
||||
" /* unfitted */\n",
|
||||
" background-color: var(--sklearn-color-fitted-level-0);\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 input.sk-toggleable__control:checked~div.sk-toggleable__content {\n",
|
||||
"#sk-container-id-1 input.sk-toggleable__control:checked~div.sk-toggleable__content {\n",
|
||||
" /* Expand drop-down */\n",
|
||||
" max-height: 200px;\n",
|
||||
" max-width: 100%;\n",
|
||||
" overflow: auto;\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {\n",
|
||||
"#sk-container-id-1 input.sk-toggleable__control:checked~label.sk-toggleable__label-arrow:before {\n",
|
||||
" content: \"▾\";\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"/* Pipeline/ColumnTransformer-specific style */\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
|
||||
"#sk-container-id-1 div.sk-label input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
|
||||
" color: var(--sklearn-color-text);\n",
|
||||
" background-color: var(--sklearn-color-unfitted-level-2);\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-label.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
|
||||
"#sk-container-id-1 div.sk-label.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
|
||||
" background-color: var(--sklearn-color-fitted-level-2);\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"/* Estimator-specific style */\n",
|
||||
"\n",
|
||||
"/* Colorize estimator box */\n",
|
||||
"#sk-container-id-3 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
|
||||
"#sk-container-id-1 div.sk-estimator input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
|
||||
" /* unfitted */\n",
|
||||
" background-color: var(--sklearn-color-unfitted-level-2);\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-estimator.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
|
||||
"#sk-container-id-1 div.sk-estimator.fitted input.sk-toggleable__control:checked~label.sk-toggleable__label {\n",
|
||||
" /* fitted */\n",
|
||||
" background-color: var(--sklearn-color-fitted-level-2);\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-label label.sk-toggleable__label,\n",
|
||||
"#sk-container-id-3 div.sk-label label {\n",
|
||||
"#sk-container-id-1 div.sk-label label.sk-toggleable__label,\n",
|
||||
"#sk-container-id-1 div.sk-label label {\n",
|
||||
" /* The background is the default theme color */\n",
|
||||
" color: var(--sklearn-color-text-on-default-background);\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"/* On hover, darken the color of the background */\n",
|
||||
"#sk-container-id-3 div.sk-label:hover label.sk-toggleable__label {\n",
|
||||
"#sk-container-id-1 div.sk-label:hover label.sk-toggleable__label {\n",
|
||||
" color: var(--sklearn-color-text);\n",
|
||||
" background-color: var(--sklearn-color-unfitted-level-2);\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"/* Label box, darken color on hover, fitted */\n",
|
||||
"#sk-container-id-3 div.sk-label.fitted:hover label.sk-toggleable__label.fitted {\n",
|
||||
"#sk-container-id-1 div.sk-label.fitted:hover label.sk-toggleable__label.fitted {\n",
|
||||
" color: var(--sklearn-color-text);\n",
|
||||
" background-color: var(--sklearn-color-fitted-level-2);\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"/* Estimator label */\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-label label {\n",
|
||||
"#sk-container-id-1 div.sk-label label {\n",
|
||||
" font-family: monospace;\n",
|
||||
" font-weight: bold;\n",
|
||||
" display: inline-block;\n",
|
||||
" line-height: 1.2em;\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-label-container {\n",
|
||||
"#sk-container-id-1 div.sk-label-container {\n",
|
||||
" text-align: center;\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"/* Estimator-specific */\n",
|
||||
"#sk-container-id-3 div.sk-estimator {\n",
|
||||
"#sk-container-id-1 div.sk-estimator {\n",
|
||||
" font-family: monospace;\n",
|
||||
" border: 1px dotted var(--sklearn-color-border-box);\n",
|
||||
" border-radius: 0.25em;\n",
|
||||
@@ -3135,18 +3135,18 @@
|
||||
" background-color: var(--sklearn-color-unfitted-level-0);\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-estimator.fitted {\n",
|
||||
"#sk-container-id-1 div.sk-estimator.fitted {\n",
|
||||
" /* fitted */\n",
|
||||
" background-color: var(--sklearn-color-fitted-level-0);\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"/* on hover */\n",
|
||||
"#sk-container-id-3 div.sk-estimator:hover {\n",
|
||||
"#sk-container-id-1 div.sk-estimator:hover {\n",
|
||||
" /* unfitted */\n",
|
||||
" background-color: var(--sklearn-color-unfitted-level-2);\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 div.sk-estimator.fitted:hover {\n",
|
||||
"#sk-container-id-1 div.sk-estimator.fitted:hover {\n",
|
||||
" /* fitted */\n",
|
||||
" background-color: var(--sklearn-color-fitted-level-2);\n",
|
||||
"}\n",
|
||||
@@ -3234,7 +3234,7 @@
|
||||
"\n",
|
||||
"/* \"?\"-specific style due to the `<a>` HTML tag */\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 a.estimator_doc_link {\n",
|
||||
"#sk-container-id-1 a.estimator_doc_link {\n",
|
||||
" float: right;\n",
|
||||
" font-size: 1rem;\n",
|
||||
" line-height: 1em;\n",
|
||||
@@ -3249,31 +3249,31 @@
|
||||
" border: var(--sklearn-color-unfitted-level-1) 1pt solid;\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 a.estimator_doc_link.fitted {\n",
|
||||
"#sk-container-id-1 a.estimator_doc_link.fitted {\n",
|
||||
" /* fitted */\n",
|
||||
" border: var(--sklearn-color-fitted-level-1) 1pt solid;\n",
|
||||
" color: var(--sklearn-color-fitted-level-1);\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"/* On hover */\n",
|
||||
"#sk-container-id-3 a.estimator_doc_link:hover {\n",
|
||||
"#sk-container-id-1 a.estimator_doc_link:hover {\n",
|
||||
" /* unfitted */\n",
|
||||
" background-color: var(--sklearn-color-unfitted-level-3);\n",
|
||||
" color: var(--sklearn-color-background);\n",
|
||||
" text-decoration: none;\n",
|
||||
"}\n",
|
||||
"\n",
|
||||
"#sk-container-id-3 a.estimator_doc_link.fitted:hover {\n",
|
||||
"#sk-container-id-1 a.estimator_doc_link.fitted:hover {\n",
|
||||
" /* fitted */\n",
|
||||
" background-color: var(--sklearn-color-fitted-level-3);\n",
|
||||
"}\n",
|
||||
"</style><div id=\"sk-container-id-3\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>DecisionTreeRegressor()</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-3\" type=\"checkbox\" checked><label for=\"sk-estimator-id-3\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>DecisionTreeRegressor</div></div><div><a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.6/modules/generated/sklearn.tree.DecisionTreeRegressor.html\">?<span>Documentation for DecisionTreeRegressor</span></a><span class=\"sk-estimator-doc-link fitted\">i<span>Fitted</span></span></div></label><div class=\"sk-toggleable__content fitted\"><pre>DecisionTreeRegressor()</pre></div> </div></div></div></div>"
|
||||
"</style><div id=\"sk-container-id-1\" class=\"sk-top-container\"><div class=\"sk-text-repr-fallback\"><pre>DecisionTreeRegressor()</pre><b>In a Jupyter environment, please rerun this cell to show the HTML representation or trust the notebook. <br />On GitHub, the HTML representation is unable to render, please try loading this page with nbviewer.org.</b></div><div class=\"sk-container\" hidden><div class=\"sk-item\"><div class=\"sk-estimator fitted sk-toggleable\"><input class=\"sk-toggleable__control sk-hidden--visually\" id=\"sk-estimator-id-1\" type=\"checkbox\" checked><label for=\"sk-estimator-id-1\" class=\"sk-toggleable__label fitted sk-toggleable__label-arrow\"><div><div>DecisionTreeRegressor</div></div><div><a class=\"sk-estimator-doc-link fitted\" rel=\"noreferrer\" target=\"_blank\" href=\"https://scikit-learn.org/1.6/modules/generated/sklearn.tree.DecisionTreeRegressor.html\">?<span>Documentation for DecisionTreeRegressor</span></a><span class=\"sk-estimator-doc-link fitted\">i<span>Fitted</span></span></div></label><div class=\"sk-toggleable__content fitted\"><pre>DecisionTreeRegressor()</pre></div> </div></div></div></div>"
|
||||
],
|
||||
"text/plain": [
|
||||
"DecisionTreeRegressor()"
|
||||
]
|
||||
},
|
||||
"execution_count": 70,
|
||||
"execution_count": 15,
|
||||
"metadata": {},
|
||||
"output_type": "execute_result"
|
||||
}
|
||||
@@ -3293,7 +3293,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 71,
|
||||
"execution_count": 16,
|
||||
"id": "c4ca2cf9",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
@@ -3322,7 +3322,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 72,
|
||||
"execution_count": 17,
|
||||
"id": "4b739d5b",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
@@ -3330,9 +3330,9 @@
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"MAE: 5124.14\n",
|
||||
"MSE: 84535204.52\n",
|
||||
"RMSE: 9194.30\n"
|
||||
"MAE: 5969.32\n",
|
||||
"MSE: 161922043.77\n",
|
||||
"RMSE: 12724.86\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -3408,7 +3408,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 73,
|
||||
"execution_count": 18,
|
||||
"id": "ab1e1367",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -3439,7 +3439,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 74,
|
||||
"execution_count": 19,
|
||||
"id": "b515460e",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -3462,7 +3462,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 75,
|
||||
"execution_count": 20,
|
||||
"id": "eebb394f",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
@@ -3496,7 +3496,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 76,
|
||||
"execution_count": 21,
|
||||
"id": "b067126c",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
@@ -3522,7 +3522,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 77,
|
||||
"execution_count": 22,
|
||||
"id": "6597152c",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
@@ -3546,7 +3546,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 78,
|
||||
"execution_count": 23,
|
||||
"id": "63ff1c9d",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
@@ -3594,7 +3594,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 24,
|
||||
"id": "d9342ad6",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -3625,12 +3625,11 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"execution_count": 36,
|
||||
"id": "6d58dbc2",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"#Initialisation\n",
|
||||
"# Nombre de sous-échantillons pour la cross-validation\n",
|
||||
"num_splits = 5\n",
|
||||
"\n",
|
||||
@@ -3643,9 +3642,9 @@
|
||||
"RMSE_scores = []\n",
|
||||
"\n",
|
||||
"# Hyperparamètres à tester\n",
|
||||
"n_estimators_values = []\n",
|
||||
"max_depth_values = []\n",
|
||||
"min_samples_split_values = []\n",
|
||||
"n_estimators_values = [50, 100, 200, 300]\n",
|
||||
"max_depth_values = [2, 5, 10]\n",
|
||||
"min_samples_split_values = [2, 5, 10]\n",
|
||||
"\n",
|
||||
"# Liste pour sauveagrder les meilleurs résultats\n",
|
||||
"best_score = np.inf\n",
|
||||
@@ -3658,12 +3657,11 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 87,
|
||||
"execution_count": 37,
|
||||
"id": "47da5172",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"#Complétez ici avec votre code\n",
|
||||
"for n_estimators in n_estimators_values:\n",
|
||||
" for max_depth in max_depth_values:\n",
|
||||
" for min_samples_split in min_samples_split_values:\n",
|
||||
@@ -3710,7 +3708,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 88,
|
||||
"execution_count": 33,
|
||||
"id": "d4936c46",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
@@ -3731,7 +3729,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 82,
|
||||
"execution_count": 34,
|
||||
"id": "3215c463",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -3745,7 +3743,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 83,
|
||||
"execution_count": 29,
|
||||
"id": "bb9a5c9b",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
@@ -3757,7 +3755,7 @@
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 84,
|
||||
"execution_count": 30,
|
||||
"id": "0f0768ad",
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
|
||||
Reference in New Issue
Block a user