Srastog commited on
Commit
088d766
·
verified ·
1 Parent(s): 17f0ebe

Update app/modelling.py

Browse files
Files changed (1) hide show
  1. app/modelling.py +4 -10
app/modelling.py CHANGED
@@ -33,16 +33,10 @@ def train(dataset):
33
  model.fit(X_train,y_train)
34
  predict=model.predict(X_test)
35
 
36
- cwd=os.getcwd()
37
- transform_pth=os.path.join(cwd,"app","transform.pkl")
38
- encoder_pth=os.path.join(cwd,"app","encoder.pkl")
39
- model_pth=os.path.join(cwd,"app","model.pkl")
40
-
41
- joblib.dump(transform,transform_pth)
42
- joblib.dump(encoder,encoder_pth)
43
- joblib.dump(model,model_pth)
44
-
45
- return {"Accuracy":f"{accuracy_score(y_test,predict):4f}",
46
  "F1_Score":f"{f1_score(y_test,predict):4f}"}
47
 
48
 
 
33
  model.fit(X_train,y_train)
34
  predict=model.predict(X_test)
35
 
36
+ return {"model":model,
37
+ "encoder":encoder,
38
+ "transform":transform,
39
+ "Accuracy":f"{accuracy_score(y_test,predict):4f}",
 
 
 
 
 
 
40
  "F1_Score":f"{f1_score(y_test,predict):4f}"}
41
 
42