Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
343 B
0
Indexable
Never
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)
Leave a Comment