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

update: lines 57 and 95 in CircleCI config #903

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
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
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- run:
name: Deploy to Railway App (You must set RAILWAY_TOKEN env var)
command: |
cd section-07-ci-and-publishing/house-prices-api && railway up --detach
cd section-07-ci-and-publishing/house-prices-api && railway up --detach -s MLDevOps-Beginner -e production

section_07_test_and_upload_regression_model:
<<: *defaults
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
- run:
name: Build and run Dockerfile (see https://docs.railway.app/deploy/dockerfiles)
command: |
cd section-08-deploying-with-containers && railway up --detach
cd section-08-deploying-with-containers && railway up --detach -s MLDevOps-Beginner -e production

test_regression_model_py37:
docker:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
Accompanying repo for the online course Deployment of Machine Learning Models.

For the documentation, visit the [course on Udemy](https://www.udemy.com/deployment-of-machine-learning-models/?couponCode=TIDREPO).

update: only for testing CI/ CD pipeline
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import numpy as np
from config.core import config
from pipeline import price_pipe
from processing.data_manager import load_dataset, save_pipeline
from sklearn.model_selection import train_test_split

def run_training() -> None:
"""Train the model"""

# read training data
data = load_dataset(file_name=config.app_config.training_data_file)

# divide train and test
X_train, X_test, y_train, y_test = train_test_split(
data[config.model_config.features], # predictors
data[config.model_config.target],
test_size=config.model_config.test_size,
# we are setting the random seed here for reproductivity
random_state=config.model_config.random_state,
)
y_train= np.log(y_train)

# fit model
price_pipe.fit(X_train, y_train)

# persist trained model
save_pipeline(pipeline_to_persist=price_pipe)

if __name__ == "__main__":
run_training()
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# We use compatible release functionality (see PEP 440 here: https://www.python.org/dev/peps/pep-0440/#compatible-release)
# to specify acceptable version ranges of our project dependencies. This gives us the flexibility to keep up with small
# updates/fixes, whilst ensuring we don't install a major update which could introduce backwards incompatible changes.
numpy>=1.21.0,<2.0.0
numpy>=1.21.0,<1.24.9 #2.0.0
pandas>=1.3.5,<2.0.0
pydantic>=1.8.1,<2.0.0
scikit-learn>=1.1.3,<2.0.0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pathlib import Path
from typing import Dict, List, Sequence
from typing import Dict, List, Optional, Sequence

from pydantic import BaseModel
from strictyaml import YAML, load
Expand Down Expand Up @@ -69,7 +69,7 @@ def find_config_file() -> Path:
raise Exception(f"Config not found at {CONFIG_FILE_PATH!r}")


def fetch_config_from_yaml(cfg_path: Path = None) -> YAML:
def fetch_config_from_yaml(cfg_path: Optional[Path] = None) -> YAML:
"""Parse YAML containing the package configuration."""

if not cfg_path:
Expand Down