application_vnd.jupyter.stderr_output_1.png
from sklearn.ensemble import RandomForestClassifier

from sklearn.linear_model import SGDClassifier

from sklearn.metrics import accuracy_score

from sklearn.model_selection import GridSearchCV,train_test_split

from sklearn.linear_model import SGDClassifier
from sklearn.model_selection import GridSearchCV, train_test_split
from sklearn.ensemble import RandomForestClassifier
sgd = SGDClassifier()
RandForest = RandomForestClassifier()

param_sgd = {'max_iter': [400, 600, 1000, 1500, 2000], 'loss': ['hinge', 'modified_huber'], 'penalty': ['l2', 'l1', 'elasticnet']}
grid_search_sgd = GridSearchCV(sgd, param_sgd)
grid_search_sgd.fit(x_train, y_train)
final_sgd = grid_search_sgd.best_estimator_

final_sgd.fit(x_train, y_train)
y_pred_sgd = final_sgd.predict(x_test)
accuracy_score(y_test, y_pred_sgd)