Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sklearn as sk
- from sklearn.model_selection import train_test_split
- #we seperate the class labels from the original dataframe
- y=data.Class
- #we need to drop the non-predictor columns and extract predictive features
- x=data.drop(['Class', 'SMILES', 'CAS'], axis=1)
- #using scikit learn we can easily partition our data and train the model with 85% of the data
- x_train,x_test,y_train,y_test = train_test_split(x, y, test_size=0.15)
- #in order to train the model we need to get a series of just the values from the dataframe
- x2 = x_train.iloc[0:607, [0,1,2,3,4,5,6,7,8,9,10]].values
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement