<jupyter_start><jupyter_text>Kernel kernel parameters selects the type of hyperplane used to separate the data. Using 'linear' will use a linear hyperplane (a line in the case of 2D data). 'rbf' and 'poly' uses a non linear hyper-plane<jupyter_code>kernels = ['linear', 'rbf', 'poly']
for kernel in kernels:
    svc = svm.SVC(kernel=kernel).fit(X, y)
    plotSVC('kernel=' + str(kernel))<jupyter_output><empty_output><jupyter_text>gamma gamma is a parameter for non linear hyperplanes. The higher the gamma value it tries to exactly fit the training data set<jupyter_code>gammas = [0.1, 1, 10, 100]
for gamma in gammas:
    svc = svm.SVC(kernel='rbf', gamma=gamma).fit(X, y)
    plotSVC('gamma=' + str(gamma))<jupyter_output><empty_output><jupyter_text>We can see that increasing gamma leads to overfitting as the classifier tries to perfectly fit the training data  C C is the penalty parameter of the error term. It controls the trade off between smooth decision boundary and classifying the training points correctly.<jupyter_code>cs = [0.1, 1, 10, 100, 1000]
for c in cs:
    svc = svm.SVC(kernel='rbf', C=c).fit(X, y)
    plotSVC('C=' + str(c))<jupyter_output><empty_output><jupyter_text>Increasing C values may lead to overfitting the training data.  degree degree is a parameter used when kernel is set to 'poly'. It's basically the degree of the polynomial used to find the hyperplane to split the data.<jupyter_code>degrees = [0, 1, 2, 3, 4, 5, 6]
for degree in degrees:
    svc = svm.SVC(kernel='poly', degree=degree).fit(X, y)
    plotSVC('degree=' + str(degree))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.10785536159600997, 'fraction_numerical': 0.017456359102244388, 'mean_word_length': 5.149425287356322, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '362670', 'license': 'MIT', 'n_tokens_mistral': 560, 'n_tokens_neox': 522, 'n_words': 196, 'path': 'SVC.ipynb', 'repo_name': 'maviator/ml_in_depth', 'size': '1604'}