Fix data paths
This commit is contained in:
parent
33f03671b6
commit
5f1ff8a93d
3
model.py
3
model.py
@ -94,6 +94,9 @@ def train_model():
|
|||||||
model = LinearRegression()
|
model = LinearRegression()
|
||||||
model.fit(x_train, y_train)
|
model.fit(x_train, y_train)
|
||||||
|
|
||||||
|
# create the model's parent directory if it doesn't exist
|
||||||
|
os.makedirs(os.path.dirname(model_file_path), exist_ok=True)
|
||||||
|
|
||||||
# Save the trained model to a file
|
# Save the trained model to a file
|
||||||
with open(model_file_path, "wb") as f:
|
with open(model_file_path, "wb") as f:
|
||||||
pickle.dump(model, f)
|
pickle.dump(model, f)
|
||||||
|
Loading…
Reference in New Issue
Block a user