Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jmoss #895

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Jmoss #895

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 .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2

defaults: &defaults
docker:
- image: circleci/python:3.7.2
- image: circleci/python:3.8
working_directory: ~/project

prepare_venv: &prepare_venv
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.
9 changes: 7 additions & 2 deletions packages/ml_api/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
--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

# Install from gemfury
regression-model==1.0.0
regression-model==0.1.1
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
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