Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/deploy-gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: 3.11

- name: Install dependencies
run: |
Expand Down
6 changes: 3 additions & 3 deletions check_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
pyversion_str = f"{sys.version_info.major}.{sys.version_info.minor}"
pyversion = Version(pyversion_str)

if pyversion < Version("3.8"):
if pyversion < Version("3.11"):
print(
FAIL,
(
"Python version 3.8 or above is required,"
"Python version 3.11 or above is required,"
f" but {pyversion_str} is installed."
),
)
Expand Down Expand Up @@ -66,7 +66,7 @@ def import_version(pkg, min_ver, fail_msg=""):
"numpy": "1.16",
"scipy": "1.2",
"matplotlib": "3.0",
"sklearn": "1.6",
"sklearn": "1.8",
"pandas": "1",
"seaborn": "0.11",
"notebook": "5.7",
Expand Down
5 changes: 3 additions & 2 deletions environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: scikit-learn-course
channels:
- conda-forge
dependencies:
- scikit-learn >= 1.6
- python=3.11
- scikit-learn >= 1.8
- pandas >= 1
- matplotlib-base
- seaborn >= 0.13
Expand All @@ -13,4 +14,4 @@ dependencies:
- packaging
- pip
- pip:
- jupyter-book >= 0.11
- jupyter-book < 2.0
3 changes: 2 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ channels:
- conda-forge

dependencies:
- scikit-learn >= 1.6
- python=3.11
- scikit-learn >= 1.8
- pandas >= 1
- matplotlib-base
- seaborn >= 0.13
Expand Down
2 changes: 1 addition & 1 deletion local-install-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Using python in /home/lesteve/miniconda3/envs/scikit-learn-course
[ OK ] numpy version 1.19.5
[ OK ] scipy version 1.6.0
[ OK ] matplotlib version 3.3.3
[ OK ] sklearn version 1.6
[ OK ] sklearn version 1.8
[ OK ] pandas version 2.0
[ OK ] seaborn version 0.13
[ OK ] notebook version 6.2.0
Expand Down
2 changes: 1 addition & 1 deletion notebooks/linear_models_ex_01.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"penguins = pd.read_csv(\"../datasets/penguins_regression.csv\")\n",
"feature_name = \"Flipper Length (mm)\"\n",
"target_name = \"Body Mass (g)\"\n",
"data, target = penguins[[feature_name]], penguins[target_name]"
"data, target = penguins[[feature_name]], penguins[[target_name]]"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions notebooks/linear_models_sol_01.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"penguins = pd.read_csv(\"../datasets/penguins_regression.csv\")\n",
"feature_name = \"Flipper Length (mm)\"\n",
"target_name = \"Body Mass (g)\"\n",
"data, target = penguins[[feature_name]], penguins[target_name]"
"data, target = penguins[[feature_name]], penguins[[target_name]]"
]
},
{
Expand Down Expand Up @@ -152,7 +152,7 @@
"def goodness_fit_measure(true_values, predictions):\n",
" # we compute the error between the true values and the predictions of our\n",
" # model\n",
" errors = np.ravel(true_values) - np.ravel(predictions)\n",
" errors = true_values - predictions\n",
" # We have several possible strategies to reduce all errors to a single value.\n",
" # Computing the mean error (sum divided by the number of element) might seem\n",
" # like a good solution. However, we have negative errors that will misleadingly\n",
Expand Down
2 changes: 1 addition & 1 deletion python_scripts/linear_models_ex_01.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
penguins = pd.read_csv("../datasets/penguins_regression.csv")
feature_name = "Flipper Length (mm)"
target_name = "Body Mass (g)"
data, target = penguins[[feature_name]], penguins[target_name]
data, target = penguins[[feature_name]], penguins[[target_name]]

# %% [markdown]
# ### Model definition
Expand Down
4 changes: 2 additions & 2 deletions python_scripts/linear_models_sol_01.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
penguins = pd.read_csv("../datasets/penguins_regression.csv")
feature_name = "Flipper Length (mm)"
target_name = "Body Mass (g)"
data, target = penguins[[feature_name]], penguins[target_name]
data, target = penguins[[feature_name]], penguins[[target_name]]

# %% [markdown]
# ### Model definition
Expand Down Expand Up @@ -106,7 +106,7 @@ def linear_model_flipper_mass(
def goodness_fit_measure(true_values, predictions):
# we compute the error between the true values and the predictions of our
# model
errors = np.ravel(true_values) - np.ravel(predictions)
errors = true_values - predictions
# We have several possible strategies to reduce all errors to a single value.
# Computing the mean error (sum divided by the number of element) might seem
# like a good solution. However, we have negative errors that will misleadingly
Expand Down
1 change: 0 additions & 1 deletion python_scripts/parameter_tuning_grid_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
remainder="passthrough",
# Silence a deprecation warning in scikit-learn v1.6 related to how the
# ColumnTransformer stores an attribute that we do not use in this notebook
Comment on lines 92 to 93
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need to remove the comments related to force_int_remainder_cols=False from this and the other notebooks

Suggested change
# Silence a deprecation warning in scikit-learn v1.6 related to how the
# ColumnTransformer stores an attribute that we do not use in this notebook

force_int_remainder_cols=False,
)

# %% [markdown]
Expand Down
1 change: 0 additions & 1 deletion python_scripts/parameter_tuning_nested.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
preprocessor = make_column_transformer(
(categorical_preprocessor, categorical_columns),
remainder="passthrough",
force_int_remainder_cols=False, # Silence a warning in scikit-learn v1.6.
)

# %%
Expand Down
1 change: 0 additions & 1 deletion python_scripts/parameter_tuning_randomized_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
preprocessor = make_column_transformer(
(categorical_preprocessor, categorical_columns),
remainder="passthrough",
force_int_remainder_cols=False, # Silence a warning in scikit-learn v1.6.
)

# %%
Expand Down
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
scikit-learn>=1.6
scikit-learn>=1.8
pandas >= 1
matplotlib
seaborn >= 0.13
plotly
jupyter-book>=0.11
jupyter-book < 2.0
jupytext
beautifulsoup4
IPython
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
scikit-learn>=1.6
scikit-learn>=1.8
pandas >= 1
matplotlib>=3.10
seaborn >= 0.13
Expand Down