AI, Machine Learning, Python, Data Science, Artificial Intelligence.
sklearn.linear_model import LinearRegression X_train, X_test, y_train, y_test = train_test_split(X_scaled, y, test_size=0.2, random_state=42) reg = LinearRegression() reg.fit(X_train, y_train) y_pred = reg.predict(X_test) We’ve split the data into training and testing sets, trained a linear