From 5f1ff8a93d677d9ceda70313ab538811e792b586 Mon Sep 17 00:00:00 2001 From: conache Date: Thu, 7 Mar 2024 15:25:44 +0200 Subject: [PATCH] Fix data paths --- model.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/model.py b/model.py index 2cea035..07d4258 100644 --- a/model.py +++ b/model.py @@ -94,6 +94,9 @@ def train_model(): model = LinearRegression() 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 with open(model_file_path, "wb") as f: pickle.dump(model, f)