Skip to content

Commit e36861f

Browse files
authored
Create main.py
1 parent ad2b30d commit e36861f

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

main.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import numpy as np
2+
from sklearn.linear_model import LinearRegression
3+
4+
# Sample data
5+
X = np.array([[1], [2], [3], [4], [5]])
6+
y = np.array([1, 3, 2, 3, 5])
7+
8+
# Create a linear regression model with normalize parameter
9+
model = LinearRegression(normalize=True)
10+
11+
# Fit the model
12+
model.fit(X, y)
13+
14+
# Make predictions
15+
predictions = model.predict(X)
16+
17+
# Print the coefficients
18+
print("Coefficients:", model.coef_)
19+
print("Intercept:", model.intercept_)
20+
print("Predictions:", predictions)

0 commit comments

Comments
 (0)