Skip to content

Commit 3c5ebf6

Browse files
committed
make release-tag: Merge branch 'master' into stable
2 parents f934db0 + 76a0b57 commit 3c5ebf6

16 files changed

+195
-57
lines changed

.github/workflows/tests.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ jobs:
1919
uses: actions/setup-python@v2
2020
with:
2121
python-version: ${{ matrix.python-version }}
22+
- name: Upgrade pip
23+
run: pip install -U pip setuptools wheel
24+
- name: Install lightfm
25+
run: python -m pip install --no-use-pep517 'lightfm<2'
2226
- name: Install package
2327
run: pip install .[dev]
2428
- name: make test-devel
@@ -36,6 +40,10 @@ jobs:
3640
uses: actions/setup-python@v2
3741
with:
3842
python-version: ${{ matrix.python-version }}
43+
- name: Upgrade pip
44+
run: pip install -U pip setuptools wheel
45+
- name: Install lightfm
46+
run: python -m pip install --no-use-pep517 'lightfm<2'
3947
- name: Install package and dependencies
4048
run: pip install rundoc .[mlprimitives]
4149
- name: make test-readme
@@ -45,7 +53,7 @@ jobs:
4553
runs-on: ${{ matrix.os }}
4654
strategy:
4755
matrix:
48-
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
56+
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11']
4957
os: [ubuntu-20.04, macos-latest]
5058
steps:
5159
- uses: actions/checkout@v1
@@ -70,6 +78,10 @@ jobs:
7078
uses: actions/setup-python@v2
7179
with:
7280
python-version: ${{ matrix.python-version }}
81+
- name: Upgrade pip
82+
run: pip install -U pip setuptools wheel
83+
- name: Install lightfm
84+
run: python -m pip install --no-use-pep517 'lightfm<2'
7385
- name: Install package and dependencies
7486
run: pip install .[test]
7587
- name: make test-mlprimitives
@@ -90,6 +102,10 @@ jobs:
90102
- if: matrix.os == 'ubuntu-20.04'
91103
name: Install dependencies - Ubuntu
92104
run: sudo apt-get install graphviz
105+
- name: Upgrade pip
106+
run: pip install -U pip setuptools wheel
107+
- name: Install lightfm
108+
run: python -m pip install --no-use-pep517 'lightfm<2'
93109
- name: Install package and dependencies
94110
run: pip install .[examples]
95111
- name: make test-tutorials

HISTORY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Changelog
22
=========
33

4+
0.6.1 - 2023-09-26
5+
------------------
6+
7+
* Add python 3.11 to MLBlocks - [Issue #143](https://github.com/MLBazaar/MLBlocks/issues/143) by @sarahmish
8+
49
0.6.0 - 2023-04-14
510
------------------
611

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,15 @@ pipeline which combines primitives from [MLPrimitives](https://github.com/MLBaza
8686
[scikit-learn](https://scikit-learn.org/) and [xgboost](https://xgboost.readthedocs.io/).
8787

8888
```python3
89+
import pandas as pd
8990
from mlblocks import MLPipeline
90-
from mlprimitives.datasets import load_dataset
91+
from sklearn.model_selection import train_test_split
92+
from sklearn.metrics import accuracy_score
9193

92-
dataset = load_dataset('census')
93-
X_train, X_test, y_train, y_test = dataset.get_splits(1)
94+
dataset = pd.read_csv('http://mlblocks.s3.amazonaws.com/census.csv')
95+
label = dataset.pop('label')
96+
97+
X_train, X_test, y_train, y_test = train_test_split(dataset, label, stratify=label)
9498

9599
primitives = [
96100
'mlprimitives.custom.preprocessing.ClassEncoder',
@@ -104,7 +108,7 @@ pipeline = MLPipeline(primitives)
104108
pipeline.fit(X_train, y_train)
105109
predictions = pipeline.predict(X_test)
106110

107-
dataset.score(y_test, predictions)
111+
accuracy_score(y_test, predictions)
108112
```
109113

110114
# What's Next?

docs/getting_started/quickstart.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,13 @@ labels.
104104
.. ipython:: python
105105
:okwarning:
106106
107-
from mlprimitives.datasets import load_census
108-
dataset = load_census()
109-
X_train, X_test, y_train, y_test = dataset.get_splits(1)
107+
import pandas as pd
108+
from sklearn.model_selection import train_test_split
109+
110+
dataset = pd.read_csv('http://mlblocks.s3.amazonaws.com/census.csv')
111+
label = dataset.pop('label')
112+
113+
X_train, X_test, y_train, y_test = train_test_split(dataset, label, stratify=label)
110114
pipeline.fit(X_train, y_train)
111115
112116
Once we have fitted our model to our data, we can call the ``predict`` method passing new data
@@ -115,9 +119,11 @@ to obtain predictions from the pipeline.
115119
.. ipython:: python
116120
:okwarning:
117121
122+
from sklearn.metrics import accuracy_score
123+
118124
predictions = pipeline.predict(X_test)
119125
predictions
120-
dataset.score(y_test, predictions)
126+
accuracy_score(y_test, predictions)
121127
122128
.. _you have already installed them: install.html#additional-dependencies
123129
.. _MLPipeline class: ../api_reference.html#mlblocks.MLPipeline

examples/tutorials/1. Using and MLPipeline.ipynb

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
"metadata": {},
3434
"outputs": [],
3535
"source": [
36-
"from mlprimitives.datasets import load_dataset\n",
36+
"from utils import load_census\n",
3737
"\n",
38-
"dataset = load_dataset('census')"
38+
"dataset = load_census()"
3939
]
4040
},
4141
{
@@ -528,7 +528,16 @@
528528
"cell_type": "code",
529529
"execution_count": 13,
530530
"metadata": {},
531-
"outputs": [],
531+
"outputs": [
532+
{
533+
"name": "stderr",
534+
"output_type": "stream",
535+
"text": [
536+
"/Users/sarah/anaconda3/envs/mlp/lib/python3.8/site-packages/sklearn/impute/_base.py:382: FutureWarning: The 'verbose' parameter was deprecated in version 1.1 and will be removed in 1.3. A warning will always be raised upon the removal of empty columns in the future version.\n",
537+
" warnings.warn(\n"
538+
]
539+
}
540+
],
532541
"source": [
533542
"pipeline.fit(X_train, y_train)"
534543
]
@@ -546,9 +555,7 @@
546555
{
547556
"cell_type": "code",
548557
"execution_count": 14,
549-
"metadata": {
550-
"scrolled": false
551-
},
558+
"metadata": {},
552559
"outputs": [],
553560
"source": [
554561
"predictions = pipeline.predict(X_test)"
@@ -611,7 +618,7 @@
611618
],
612619
"metadata": {
613620
"kernelspec": {
614-
"display_name": "Python 3",
621+
"display_name": "Python 3 (ipykernel)",
615622
"language": "python",
616623
"name": "python3"
617624
},
@@ -625,7 +632,7 @@
625632
"name": "python",
626633
"nbconvert_exporter": "python",
627634
"pygments_lexer": "ipython3",
628-
"version": "3.6.9"
635+
"version": "3.8.16"
629636
}
630637
},
631638
"nbformat": 4,

examples/tutorials/3. Setting MLPipeline Hyperparameters.ipynb

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
"metadata": {},
3838
"outputs": [],
3939
"source": [
40-
"from mlprimitives.datasets import load_dataset\n",
40+
"from utils import load_census\n",
4141
"\n",
42-
"dataset = load_dataset('census')\n",
42+
"dataset = load_census()\n",
4343
"X_train, X_test, y_train, y_test = dataset.get_splits(1)"
4444
]
4545
},
@@ -268,6 +268,14 @@
268268
"execution_count": 7,
269269
"metadata": {},
270270
"outputs": [
271+
{
272+
"name": "stderr",
273+
"output_type": "stream",
274+
"text": [
275+
"/Users/sarah/anaconda3/envs/mlp/lib/python3.8/site-packages/sklearn/impute/_base.py:382: FutureWarning: The 'verbose' parameter was deprecated in version 1.1 and will be removed in 1.3. A warning will always be raised upon the removal of empty columns in the future version.\n",
276+
" warnings.warn(\n"
277+
]
278+
},
271279
{
272280
"data": {
273281
"text/plain": [
@@ -394,6 +402,14 @@
394402
"execution_count": 11,
395403
"metadata": {},
396404
"outputs": [
405+
{
406+
"name": "stderr",
407+
"output_type": "stream",
408+
"text": [
409+
"/Users/sarah/anaconda3/envs/mlp/lib/python3.8/site-packages/sklearn/impute/_base.py:382: FutureWarning: The 'verbose' parameter was deprecated in version 1.1 and will be removed in 1.3. A warning will always be raised upon the removal of empty columns in the future version.\n",
410+
" warnings.warn(\n"
411+
]
412+
},
397413
{
398414
"data": {
399415
"text/plain": [
@@ -415,7 +431,7 @@
415431
],
416432
"metadata": {
417433
"kernelspec": {
418-
"display_name": "Python 3",
434+
"display_name": "Python 3 (ipykernel)",
419435
"language": "python",
420436
"name": "python3"
421437
},
@@ -429,7 +445,7 @@
429445
"name": "python",
430446
"nbconvert_exporter": "python",
431447
"pygments_lexer": "ipython3",
432-
"version": "3.6.9"
448+
"version": "3.8.16"
433449
}
434450
},
435451
"nbformat": 4,

examples/tutorials/4. Saving and Loading a Pipeline.ipynb

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
"metadata": {},
3636
"outputs": [],
3737
"source": [
38-
"from mlprimitives.datasets import load_dataset\n",
38+
"from utils import load_census\n",
3939
"\n",
40-
"dataset = load_dataset('census')"
40+
"dataset = load_census()"
4141
]
4242
},
4343
{
@@ -71,7 +71,16 @@
7171
"cell_type": "code",
7272
"execution_count": 4,
7373
"metadata": {},
74-
"outputs": [],
74+
"outputs": [
75+
{
76+
"name": "stderr",
77+
"output_type": "stream",
78+
"text": [
79+
"/Users/sarah/anaconda3/envs/mlp/lib/python3.8/site-packages/sklearn/impute/_base.py:382: FutureWarning: The 'verbose' parameter was deprecated in version 1.1 and will be removed in 1.3. A warning will always be raised upon the removal of empty columns in the future version.\n",
80+
" warnings.warn(\n"
81+
]
82+
}
83+
],
7584
"source": [
7685
"pipeline.fit(X_train, y_train)"
7786
]
@@ -166,7 +175,7 @@
166175
],
167176
"metadata": {
168177
"kernelspec": {
169-
"display_name": "Python 3",
178+
"display_name": "Python 3 (ipykernel)",
170179
"language": "python",
171180
"name": "python3"
172181
},
@@ -180,7 +189,7 @@
180189
"name": "python",
181190
"nbconvert_exporter": "python",
182191
"pygments_lexer": "ipython3",
183-
"version": "3.6.9"
192+
"version": "3.8.16"
184193
}
185194
},
186195
"nbformat": 4,

examples/tutorials/5. Partial execution and pipeline debugging.ipynb

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
"metadata": {},
3737
"outputs": [],
3838
"source": [
39-
"from mlprimitives.datasets import load_dataset\n",
39+
"from utils import load_census\n",
4040
"\n",
41-
"dataset = load_dataset('census')"
41+
"dataset = load_census()"
4242
]
4343
},
4444
{
@@ -430,7 +430,16 @@
430430
"cell_type": "code",
431431
"execution_count": 11,
432432
"metadata": {},
433-
"outputs": [],
433+
"outputs": [
434+
{
435+
"name": "stderr",
436+
"output_type": "stream",
437+
"text": [
438+
"/Users/sarah/anaconda3/envs/mlp/lib/python3.8/site-packages/sklearn/impute/_base.py:382: FutureWarning: The 'verbose' parameter was deprecated in version 1.1 and will be removed in 1.3. A warning will always be raised upon the removal of empty columns in the future version.\n",
439+
" warnings.warn(\n"
440+
]
441+
}
442+
],
434443
"source": [
435444
"fit_context = pipeline.fit(start_=1, output_=2, **fit_context)"
436445
]
@@ -690,7 +699,7 @@
690699
],
691700
"metadata": {
692701
"kernelspec": {
693-
"display_name": "Python 3",
702+
"display_name": "Python 3 (ipykernel)",
694703
"language": "python",
695704
"name": "python3"
696705
},
@@ -704,7 +713,7 @@
704713
"name": "python",
705714
"nbconvert_exporter": "python",
706715
"pygments_lexer": "ipython3",
707-
"version": "3.6.9"
716+
"version": "3.8.16"
708717
}
709718
},
710719
"nbformat": 4,

0 commit comments

Comments
 (0)