<jupyter_start><jupyter_text>Lets try training the data without encoding every single champion using one hot enocder / dummies<jupyter_code>from sklearn.model_selection import train_test_split
X = df2.drop('Winner',axis=1)
y = df2['Winner']
X_train,X_test,y_train,y_test = train_test_split(X,y,test_size=0.3,random_state=101)
from sklearn.svm import SVC
svm = SVC()
svm.fit(X_train,y_train)
predictions = svm.predict(X_test)
from sklearn.metrics import classification_report,confusion_matrix
print(confusion_matrix(y_test,predictions))
print('\n')
print(classification_report(y_test,predictions))<jupyter_output>[[2955    0]
 [2949    0]]


              precision    recall  f1-score   support

           0       0.50      1.00      0.67      2955
           1       0.00      0.00      0.00      2949

    accuracy                           0.50      5904
   macro avg       0.25      0.50      0.33      5904
weighted avg       0.25      0.50      0.33      5904<jupyter_text>Lets try using Gridsearch to get the optimum values for hyperparameters C and Gamma<jupyter_code>from sklearn.model_selection import GridSearchCV
params = {'C':[0.1,1,10,100,1000],'gamma':[1,0.1,0.01,0.001,0.0001]}
grid = GridSearchCV(SVC(),params,verbose=3)
grid.fit(X_train,y_train)
grid_predictions = grid.predict(X_test)
print(confusion_matrix(y_test,grid_predictions))
print('\n')
print(classification_report(y_test,grid_predictions))<jupyter_output>[[2949    6]
 [2946    3]]


              precision    recall  f1-score   support

           0       0.50      1.00      0.67      2955
           1       0.33      0.00      0.00      2949

    accuracy                           0.50      5904
   macro avg       0.42      0.50      0.33      5904
weighted avg       0.42      0.50      0.33      5904
{'fraction_non_alphanumeric': 0.09446618222470654, 'fraction_numerical': 0.10061486864169927, 'mean_word_length': 2.3457943925233646, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '651388', 'license': 'MIT', 'n_tokens_mistral': 702, 'n_tokens_neox': 625, 'n_words': 130, 'path': 'models/level2/SVM-Complex.ipynb', 'repo_name': 'TechLabs-Aachen-e-V/WiSe20_Team_10_Main', 'size': '1789'}