diff --git a/README.md b/README.md index 5d75f6f17..b33b97c93 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Machine Learning Engineering for Production +# Machine Learning Engineering for Production Welcome to the public repo for [deeplearning.ai](https://www.deeplearning.ai/)'s Machine Learning Engineering for Production Specialization. @@ -6,4 +6,4 @@ Here you will find public resources for the courses of this specialization. ## Want to contribute? -At the time being we are not accepting Pull Requests but if you have any suggestion or spot any bug please raise an issue. \ No newline at end of file +At the time being we are not accepting Pull Requests but if you have any suggestion or spot any bug please raise an issue. diff --git a/course4/week3-ungraded-labs/C4_W3_Lab_4_Github_Actions/app/main.py b/course4/week3-ungraded-labs/C4_W3_Lab_4_Github_Actions/app/main.py index 2f94e9ff2..cd231e7bb 100644 --- a/course4/week3-ungraded-labs/C4_W3_Lab_4_Github_Actions/app/main.py +++ b/course4/week3-ungraded-labs/C4_W3_Lab_4_Github_Actions/app/main.py @@ -9,7 +9,7 @@ app = FastAPI(title="Predicting Wine Class with batching") # Open classifier in global scope -with open("models/wine.pkl", "rb") as file: +with open("models/wine-95-fixed.pkl", "rb") as file: clf = pickle.load(file) diff --git a/course4/week3-ungraded-labs/C4_W3_Lab_4_Github_Actions/app/test_clf.py b/course4/week3-ungraded-labs/C4_W3_Lab_4_Github_Actions/app/test_clf.py index 2d957fecd..c3e455b06 100644 --- a/course4/week3-ungraded-labs/C4_W3_Lab_4_Github_Actions/app/test_clf.py +++ b/course4/week3-ungraded-labs/C4_W3_Lab_4_Github_Actions/app/test_clf.py @@ -1,9 +1,9 @@ +from sklearn.pipeline import Pipeline +from sklearn.preprocessing import StandardScaler import pickle from main import clf - def test_accuracy(): - # Load test data with open("data/test_data.pkl", "rb") as file: test_data = pickle.load(file) @@ -16,3 +16,14 @@ def test_accuracy(): # Accuracy should be over 90% assert acc > 0.9 + +def test_pipeline_and_scaler(): + # Check if clf is an instance of sklearn.pipeline.Pipeline + is_pipeline = isinstance(clf, Pipeline) + assert is_pipeline + + if is_pipeline: + # Check if the first step of the pipeline is an instance of + # sklearn.preprocessing.StandardScaler + first_step = clf.named_steps.values()[0] + assert isinstance(first_step, StandardScaler)