a guest Jul 23rd, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- from sklearn.model_selection import train_test_split
- X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3) # 70% training and 30% test
- #Import Random Forest Model
- from sklearn.ensemble import RandomForestClassifier
- #Create a Gaussian Classifier
- #Train the model using the training sets y_pred=clf.predict(X_test)
- #Import scikit-learn metrics module for accuracy calculation
- from sklearn import metrics
- # Model Accuracy, how often is the classifier correct?
- print("Accuracy:",metrics.accuracy_score(y_test, y_pred))
RAW Paste Data