'Compare graph for Accuracy of different models

What's wrong in the below code. I did not understand the errors. Please Help!! First I imported our models. after that tried to find out accuracy score with comparison graph by box plot. Got so many errors. Please Help!!

from sklearn.svm import SVC
svm=SVC()
from sklearn.ensemble import RandomForestClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.linear_model import LogisticRegression
from sklearn import model_selection 

models = []
models.append(('SVM', SVC()))
models.append(('RFC', RandomForestClassifier))
models.append(('CART', DecisionTreeClassifier()))
models.append(('LR', LogisticRegression()))

results = []
names = []
scoring = 'accuracy'
for name, model in models:
  kfold = model_selection.KFold(n_splits=10, random_state=None)
  cv_results = model_selection.cross_val_score(model, X_cow_train, Y_cow_train, cv=kfold, scoring=scoring)
  results.append(cv_results)
  names.append(name)
  msg = "%s: %f (%f)" % (name, cv_results.mean(), cv_results.std())
  print(msg)
# boxplot algorithm comparison
fig = plt.figure()
fig.suptitle('Comparison between different MLAs')
ax = fig.add_subplot(111)
plt.boxplot(results)
ax.set_xticklabels(names)
[Errors][1]plt.show()


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source