Commit
·
0fffa64
1
Parent(s):
40b04d6
Update model/train.py
Browse filesAdded code to properly save pipeline after creation which was missing and thus the reason for showing "Pipeline Available : False" in the frontend
- model/train.py +5 -0
model/train.py
CHANGED
@@ -222,6 +222,11 @@ class RobustModelTrainer:
|
|
222 |
('feature_select', feature_selector),
|
223 |
('model', None) # Will be set during training
|
224 |
])
|
|
|
|
|
|
|
|
|
|
|
225 |
|
226 |
return pipeline
|
227 |
|
|
|
222 |
('feature_select', feature_selector),
|
223 |
('model', None) # Will be set during training
|
224 |
])
|
225 |
+
|
226 |
+
# Save the pipeline to .pkl format
|
227 |
+
joblib.dump(pipeline, "/tmp/pipeline.pkl") # Save complete pipeline
|
228 |
+
joblib.dump(pipeline.named_steps['model'], "/tmp/model.pkl") # Individual model
|
229 |
+
joblib.dump(pipeline.named_steps['vectorize'], "/tmp/vectorizer.pkl") # Individual vectorizer
|
230 |
|
231 |
return pipeline
|
232 |
|