Skip to content
Open

Moss #894

6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jobs:
test_regression_model:
working_directory: ~/project
docker:
- image: circleci/python:3.7.2
- image: circleci/python:3.8
steps:
- checkout
- run:
Expand All @@ -20,7 +20,7 @@ jobs:
test_ml_api:
working_directory: ~/project
docker:
- image: circleci/python:3.7.2
- image: circleci/python:3.8
steps:
- checkout
- run:
Expand All @@ -35,7 +35,7 @@ jobs:
train_and_upload_regression_model:
working_directory: ~/project
docker:
- image: circleci/python:3.7.2
- image: circleci/python:3.8
steps:
- checkout
- run:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Deploying Machine Learning Models
For the documentation, visit the course on Udemy.
For the documentation, visit the course on Udemy.
6 changes: 5 additions & 1 deletion packages/ml_api/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
--extra-index-url=${PIP_EXTRA_INDEX_URL}

# api
flask==1.0.2
flask==1.1.1
jinja2==2.10.3
markupsafe==1.1.1
itsdangerous==1.1.0
werkzeug==0.16.0

# schema validation
marshmallow==2.17.0
Expand Down
2 changes: 1 addition & 1 deletion packages/ml_api/tests/test_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ def test_prediction_endpoint_returns_prediction(flask_test_client):
response_json = json.loads(response.data)
prediction = response_json['predictions']
response_version = response_json['version']
assert math.ceil(prediction[0]) == 112476
assert math.ceil(prediction[0]) == 112512
assert response_version == _version
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def fit(self, X, y=None):

for var in self.variables:
# the encoder will learn the most frequent categories
t = pd.Series(X[var].value_counts() / np.float(len(X)))
t = pd.Series(X[var].value_counts() / np.float64(len(X)))
# frequent labels:
self.encoder_dict_[var] = list(t[t >= self.tol].index)

Expand Down
Binary file not shown.
16 changes: 8 additions & 8 deletions packages/regression_model/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
# updates/fixes, whilst ensuring we don't install a major update which could introduce backwards incompatible changes.

# Model Building Requirements
numpy>=1.18.1,<1.19.0
pandas>=0.25.3,<0.26.0
scikit-learn>=0.22.1,<0.23.0
joblib>=0.14.1,<0.15.0
numpy>=1.18.1
pandas>=0.25.3
scikit-learn>=0.21.3
joblib>=0.14.1

# testing requirements
pytest>=5.3.2,<6.0.0
pytest>=5.3.2

# packaging
setuptools>=41.4.0,<42.0.0
wheel>=0.33.6,<0.34.0
setuptools>=41.4.0
wheel>=0.33.6

# fetching datasets
kaggle>=1.5.6,<1.6.0
kaggle>=1.5.6
2 changes: 1 addition & 1 deletion packages/regression_model/tests/test_predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_make_single_prediction():
# Then
assert subject is not None
assert isinstance(subject.get('predictions')[0], float)
assert math.ceil(subject.get('predictions')[0]) == 112476
assert math.ceil(subject.get('predictions')[0]) == 112512


def test_make_multiple_predictions():
Expand Down
4 changes: 3 additions & 1 deletion scripts/fetch_kaggle_dataset.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env bash

kaggle competitions download -c house-prices-advanced-regression-techniques -p packages/regression_model/regression_model/datasets/
kaggle competitions download -c house-prices-advanced-regression-techniques -p packages/regression_model/regression_model/datasets/

unzip packages/regression_model/regression_model/datasets/house-prices-advanced-regression-techniques.zip -d packages/regression_model/regression_model/datasets