Spaces:
No application file
No application file
| import pandas as pd | |
| from sklearn.ensemble import RandomForestRegressor | |
| import joblib | |
| from data_loader import load_data | |
| df = load_data() | |
| features = ['PA', 'WICOPE', 'backlog', 'cuaca_bin', 'resign', 'bad_ethic', 'incompetent'] | |
| target = 'PTY' | |
| X = df[features] | |
| y = df[target] | |
| model = RandomForestRegressor() | |
| model.fit(X, y) | |
| joblib.dump(model, "model_pty.pkl") | |
| print("✅ Model trained and saved as model_pty.pkl") | |