Skip to content
Permalink
f8944e4b75
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
14 lines (10 sloc) 452 Bytes
#Model Development Code =
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
x = df_full['Trips 1-25 Miles'].values.reshape(-1, 1)
y = df['Number of Trips 10-25'].values
X_train, X_test, y_train, y_test = train_test_split(x, y, test_size=0.2, random_state=0)
model = LinearRegression()
model.fit(X_train, y_train)
r_sq = model.score(X_train, y_train)
y_pred = model.predict(X_test)