In [27]:
import pandas as pd
url = 'https://raw.githubusercontent.com/albahnsen/PracticalMachineLearningClass/master/datasets/mashable.csv'
df = pd.read_csv(url, index_col=0)
df.head()
Out[27]:
In [28]:
train_df.shape
Out[28]:
In [29]:
X = train_df.drop(['url', 'Popular'], axis=1)
y = train_df['Popular']
In [30]:
y.mean()
Out[30]:
In [32]:
# train/test split
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=1)
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]: