<jupyter_start><jupyter_text>Build Classification Model<jupyter_code>import pandas as pd
cuisines_df = pd.read_csv("../data/cleaned_cuisines.csv")
cuisines_df.head()
cuisines_label_df = cuisines_df['cuisine']
cuisines_label_df.head()
cuisines_feature_df = cuisines_df.drop(['Unnamed: 0', 'cuisine'], axis=1)
cuisines_feature_df.head()
from sklearn.model_selection import train_test_split, cross_val_score
from sklearn.linear_model import LinearRegression
from sklearn.neighbors import KNeighborsClassifier
from sklearn.svm import SVC
from sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier
from sklearn.metrics import accuracy_score, precision_score, classification_report, confusion_matrix, precision_recall_curve
import numpy as np
X_train, X_test, y_train, y_test = train_test_split(cuisines_feature_df, cuisines_label_df, test_size= 0.3, random_state= 0)
C = 10
classifiers = {
    'Linear SVC': SVC(kernel='linear', C = C, probability=True , random_state=0),
    'K Neighbours': KNeighborsClassifier(n_neighbors=C),
    'SVC': SVC(),
    'Random Forest': RandomForestClassifier(n_estimators=100),
    'Ada Boost': AdaBoostClassifier(n_estimators=100)
}
for index, (name, classifier) in enumerate(classifiers.items()):
    classifier.fit(X_train, y_train)
    y_pred = classifier.predict(X_test)
    accuracy = accuracy_score(y_test, y_pred)
    print('Accuracy for %s model is %0.1f%%' % (name, accuracy*100))
    print('classification Report', classification_report(y_test, y_pred))<jupyter_output>Accuracy for Linear SVC model is 78.1%
classification Report               precision    recall  f1-score   support

     chinese       0.68      0.73      0.70       245
      indian       0.84      0.90      0.87       233
    japanese       0.77      0.73      0.75       249
      korean       0.84      0.74      0.78       222
        thai       0.80      0.80      0.80       250

    accuracy                           0.78      1199
   macro avg       0.78      0.78      0.78      1199
weighted avg       0.78      0.78      0.78      1199

Accuracy for K Neighbours model is 73.6%
classification Report               precision    recall  f1-score   support

     chinese       0.67      0.67      0.67       245
      indian       0.82      0.85      0.83       233
    japanese       0.65      0.83      0.73       249
      korean       0.90      0.53      0.66       222
        thai       0.75      0.80      0.77       250

    accuracy                           0.74      1199
   macr[...]