Skip to content

Commit

Permalink
deploy: acc2743
Browse files Browse the repository at this point in the history
  • Loading branch information
JesperDramsch committed Feb 11, 2024
1 parent a5909ab commit 022c481
Show file tree
Hide file tree
Showing 21 changed files with 790 additions and 480 deletions.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
12 changes: 7 additions & 5 deletions _sources/frontmatter/conda-m1.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# Conda on Apple M1 Chip

If you're using a Mac with the latest M1 chip, it is highly recommended to install the packages in
If you're using a Mac with the latest M1 chip, it is highly recommended to install the packages in
your conda environment specifically tailored for your hardware architecture (i.e. `arm64`).
To do so, please execute the following command:
To do so, please execute the following command:

```
$ CONDA_SUBDIR=osx-arm64 conda env create -f environment.yml
$ CONDA_SUBDIR=osx-arm64 conda env create -f requirements/tutorial.yml
```

This will make sure that `conda` will automatically fetch the appropriate packages from channels, if required.

To activate the environment, please run:
To activate the environment, please run:

```
$ conda activate pydata-global-2022-ml-repro
$ conda activate ml-recipes
```

Once the environment is activated, please set the `subdir` for future package installations:

```
$ conda config --env --set subdir osx-arm64
```
8 changes: 4 additions & 4 deletions _sources/frontmatter/conda.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Using Conda

⚠️ If you're using Apple with M1 Chip, please follow these [instructions](#note-for-conda-on-apple-m1-chip)
⚠️ If you're using Apple with M1 Chip, please follow these [instructions](/frontmatter/conda-m1.html)

You can create an `pydata-global-2022-ml-repro` conda environment executing:
You can create an `ml-recipes` conda environment executing:

```
$ conda env create -f requirements/tutorial.yml
Expand All @@ -11,11 +11,11 @@ $ conda env create -f requirements/tutorial.yml
and later activate the environment:

```
$ conda activate pydata-global-2022-ml-repro
$ conda activate ml-recipes
```

You might also only update your current environment using:

```
$ conda env update --prefix ./env --file environment.yml --prune
$ conda env update --prefix ./env --file requirements/tutorial.yml --prune
```
49 changes: 30 additions & 19 deletions _sources/notebooks/0-basic-data-prep-and-model.ipynb

Large diffs are not rendered by default.

54 changes: 20 additions & 34 deletions _sources/notebooks/3-model-sharing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -172,19 +172,7 @@
"shell.execute_reply": "2022-12-13T01:42:17.575770Z"
}
},
"outputs": [
{
"ename": "ModuleNotFoundError",
"evalue": "No module named 'sklearn'",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn [3], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01msklearn\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mmodel_selection\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m train_test_split\n\u001b[0;32m 2\u001b[0m num_features \u001b[38;5;241m=\u001b[39m [\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCulmen Length (mm)\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCulmen Depth (mm)\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mFlipper Length (mm)\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[0;32m 3\u001b[0m cat_features \u001b[38;5;241m=\u001b[39m [\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mSex\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n",
"\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'sklearn'"
]
}
],
"outputs": [],
"source": [
"from sklearn.model_selection import train_test_split\n",
"num_features = [\"Culmen Length (mm)\", \"Culmen Depth (mm)\", \"Flipper Length (mm)\"]\n",
Expand All @@ -199,7 +187,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"First we'll build a quick model, like in [the Data notebook](/notebooks/0-basic-data-prep-and-model.html)."
"First we'll build a quick model, as we did in [the Data notebook](/notebooks/0-basic-data-prep-and-model.html)."
]
},
{
Expand All @@ -215,15 +203,14 @@
},
"outputs": [
{
"ename": "ModuleNotFoundError",
"evalue": "No module named 'sklearn'",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn [4], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01msklearn\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01msvm\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m SVC\n\u001b[0;32m 2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01msklearn\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mcompose\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m ColumnTransformer\n\u001b[0;32m 3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01msklearn\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mpipeline\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Pipeline\n",
"\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'sklearn'"
]
"data": {
"text/plain": [
"1.0"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
Expand All @@ -242,7 +229,7 @@
"\n",
"model = Pipeline(steps=[\n",
" ('preprocessor', preprocessor),\n",
" ('classifier', SVC()),\n",
" ('classifier', SVC(random_state=42)),\n",
"])\n",
"\n",
"model.fit(X_train, y_train)\n",
Expand Down Expand Up @@ -292,15 +279,14 @@
},
"outputs": [
{
"ename": "ModuleNotFoundError",
"evalue": "No module named 'joblib'",
"output_type": "error",
"traceback": [
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[1;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[1;32mIn [6], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mjoblib\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m dump, load\n\u001b[0;32m 3\u001b[0m dump(model, MODEL_EXPORT_FILE)\n\u001b[0;32m 5\u001b[0m clf \u001b[38;5;241m=\u001b[39m load(MODEL_EXPORT_FILE)\n",
"\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'joblib'"
]
"data": {
"text/plain": [
"1.0"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
Expand Down Expand Up @@ -506,7 +492,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
"version": "3.11.7"
},
"vscode": {
"interpreter": {
Expand Down
494 changes: 312 additions & 182 deletions _sources/notebooks/5-interpretability.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 022c481

Please sign in to comment.