-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8969ade
commit a9edbc0
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
Hedging with Real Estate/Store Sales Prediction/Model/evaluate_model.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import pandas as pd | ||
from sklearn.metrics import mean_squared_error | ||
import joblib | ||
def evaluate_model(df, model): | ||
X = df.drop('target', axis=1) | ||
y = df['target'] | ||
predictions = model.predict(X) | ||
mse = mean_squared_error(y, predictions) | ||
print(f'Mean Squared Error: {mse}') | ||
if __name__ == "__main__": | ||
df = pd.read_csv('path/to/features_data.csv') | ||
model = joblib.load('path/to/model.pkl') | ||
evaluate_model(df, model) |