Fix data paths

This commit is contained in:
conache 2024-03-07 15:25:44 +02:00
parent 33f03671b6
commit 5f1ff8a93d
No known key found for this signature in database

View File

@ -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)