Commit 18c6903 1 parent 8439a8c commit 18c6903 Copy full SHA for 18c6903
File tree 2 files changed +13
-1
lines changed
course4/week3-ungraded-labs/C4_W3_Lab_4_Github_Actions/app
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 9
9
app = FastAPI (title = "Predicting Wine Class with batching" )
10
10
11
11
# Open classifier in global scope
12
- with open ("models/wine-95.pkl" , "rb" ) as file :
12
+ with open ("models/wine-95-fixed .pkl" , "rb" ) as file :
13
13
clf = pickle .load (file )
14
14
15
15
Original file line number Diff line number Diff line change 1
1
import pickle
2
2
from main import clf
3
+ from sklearn .pipeline import Pipeline
4
+ from sklearn .preprocessing import StandardScaler
3
5
6
+ def test_pipeline_and_scaler ():
7
+ # Check if clf is an instance of sklearn.pipeline.Pipeline
8
+ isPipeline = isinstance (clf , Pipeline )
9
+ assert isPipeline
10
+
11
+ if isPipeline :
12
+ # Check if first step of pipeline is an instance of
13
+ # sklearn.preprocessing.StandardScaler
14
+ firstStep = [v for v in clf .named_steps .values ()][0 ]
15
+ assert isinstance (firstStep , StandardScaler )
4
16
5
17
def test_accuracy ():
6
18
You can’t perform that action at this time.
0 commit comments