Skip to content

Commit eda9ecb

Browse files
committed
feat: add new classifier with scaling
1 parent 9ed5834 commit eda9ecb

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

38-github-actions/app/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# Open classifier in global scope
1212
# with open("models/wine.pkl", "rb") as file:
13-
with open("models/wine-95.pkl", "rb") as file:
13+
with open("models/wine-95-fixed.pkl", "rb") as file:
1414
clf = pickle.load(file)
1515

1616

38-github-actions/app/test_clf.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import pickle
22
from main import clf
3+
from sklearn.pipeline import Pipeline
4+
from sklearn.preprocessing import StandardScaler
35

46

57
def test_accuracy():
@@ -16,3 +18,15 @@ def test_accuracy():
1618

1719
# Accuracy should be over 90%
1820
assert acc > 0.9
21+
22+
def test_pipeline_and_scaler():
23+
24+
# Check if clf is an instance of sklearn.pipeline.Pipeline
25+
isPipeline = isinstance(clf, Pipeline)
26+
assert isPipeline
27+
28+
if isPipeline:
29+
# Check if first step of pipeline is an instance of
30+
# sklearn.preprocessing.StandardScaler
31+
firstStep = [v for v in clf.named_steps.values()][0]
32+
assert isinstance(firstStep, StandardScaler)

0 commit comments

Comments
 (0)