Abhi10000 commited on
Commit
bc38de8
·
verified ·
1 Parent(s): 7e9b895

Create train_model.py

Browse files
Files changed (1) hide show
  1. train_model.py +14 -0
train_model.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pandas as pd
2
+ from sklearn.linear_model import LinearRegression
3
+ from joblib import dump
4
+
5
+ # Load historical AMC data
6
+ data = pd.read_csv("training_data.csv")
7
+ X = data[["last_service_days"]]
8
+ y = data["next_service_days"]
9
+
10
+ # Train the model
11
+ model = LinearRegression().fit(X, y)
12
+
13
+ # Save the model to a file
14
+ dump(model, "amc_model.pkl")