Mar-11-2020, 12:23 AM
I'm confused regarding your datasets.
Assuming you are starting with a dataset with two columns, one for year and the other for population, and let's make those the column names
You split the dataset into
test_set
valid_set
train_set
Try this. I can't test without your full code and csv, but this should get you close.
Assuming you are starting with a dataset with two columns, one for year and the other for population, and let's make those the column names
You split the dataset into
test_set
valid_set
train_set
Try this. I can't test without your full code and csv, but this should get you close.
poly = PolynomialFeatures(2) X = train_set['year'] y = train_set['population'] poly.fit_transform(X) lm = linear_model.LinearRegression() lm.fit(X, y)