Spaces:
Build error
Build error
Download train_model.py from Abhi10000/AMCENGINESPACE: direct link, hf CLI and curl.
- Browser
- Download file 337 Bytes
-
https://huggingface.co/spaces/Abhi10000/AMCENGINESPACE/resolve/main/train_model.py
- Command line
-
hf download hf://spaces/Abhi10000/AMCENGINESPACE/train_model.py
-
curl -L -o train_model.py https://huggingface.co/spaces/Abhi10000/AMCENGINESPACE/resolve/main/train_model.py
337 Bytes
| import pandas as pd | |
| from sklearn.linear_model import LinearRegression | |
| from joblib import dump | |
| # Load historical AMC data | |
| data = pd.read_csv("training_data.csv") | |
| X = data[["last_service_days"]] | |
| y = data["next_service_days"] | |
| # Train the model | |
| model = LinearRegression().fit(X, y) | |
| # Save the model to a file | |
| dump(model, "amc_model.pkl") | |