Untitled
unknown
plain_text
a year ago
343 B
3
Indexable
import numpy as np from sklearn.linear_model import LinearRegression # Sample data X = np.array([[1], [2], [3], [4], [5]]) y = np.array([2, 4, 5, 4, 5]) # Create and fit the model model = LinearRegression() model.fit(X, y) # Make predictions new_x = np.array([[6], [7]]) predictions = model.predict(new_x) print(predictions)
Editor is loading...
Leave a Comment