Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. import sklearn as sk
  2. from sklearn.model_selection import train_test_split
  3.  
  4. #we seperate the class labels from the original dataframe
  5. y=data.Class
  6.  
  7. #we need to drop the non-predictor columns and extract predictive features
  8. x=data.drop(['Class', 'SMILES', 'CAS'], axis=1)
  9.  
  10. #using scikit learn we can easily partition our data and train the model with 85% of the data
  11. x_train,x_test,y_train,y_test = train_test_split(x, y, test_size=0.15)
  12.  
  13. #in order to train the model we need to get a series of just the values from the dataframe
  14. 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