train, test = train_test_split(data , 0.8) code example
Example 1: train test split
from sklearn.linear_model import LinearRegression
rl = LinearRegression().fit(X, y)
rl.fit(X, y) #We can fit model to dataset in this way too
Example 2: train_test_split example
train_test_split example