Neroml / train_model.py
deedrop1140's picture
Upload 69 files
6491927 verified
import numpy as np
from sklearn.linear_model import LinearRegression
import joblib
model = joblib.load('C:\\Users\\deeku\\OneDrive\\Desktop\\neroml\\supervised_model.pkl')
# Training data
hours_studied = np.array([1, 2, 3, 4, 5]).reshape(-1, 1)
scores = np.array([35, 45, 55, 65, 75])
# Create and train the model
model = LinearRegression()
model.fit(hours_studied, scores)
# Print the model parameters
print(f"Slope (m): {model.coef_[0]}")
print(f"Intercept (b): {model.intercept_}")
# Save the model
joblib.dump(model, 'supervised_model.pkl')