<jupyter_start><jupyter_text>On comparing the results from the above table, we comment TRUE/FALSE:NOTE: Here I assume kernel coefficient gamma = 'scale' - 4.c) i. When C = 0.0001, training error is higher at Q = 5Ans: FALSEii. When C = 0.001, the number of support vectors is lower at Q = 5Ans: TRUEiii. When C = 0.01, training error is higher at Q = 5Ans: FALSEiv. When C = 1, test error is lower at Q = 5Ans: TRUE<jupyter_code>"""Question 4.d"""
print("=====================================")
print("Solution - Question 4.d")
print("-------------------------------------")
print("%14s|%-10s|%-10s|" % (" ", "Train_Err", "Test_Err"))
print("-------------------------------------")
for i in range(-2, 8, 2):
    c = 1 * pow(10, i)
    train_err, test_err = classify_SVM_rbf(train_x, train_Y, test_x, test_Y, c)
    print("C = %-10.2f|%10f|%10f|" % (c, train_err, test_err))
print("======================================")<jupyter_output>=====================================
Solution - Question 4.d
-------------------------------------
              |Train_Err |Test_Err  |
-------------------------------------
C = 0.01      |  0.005125|  0.016509|
C = 1.00      |  0.004484|  0.021226|
C = 100.00    |  0.003203|  0.018868|
C = 10000.00  |  0.002562|  0.018868|
C = 1000000.00|  0.002562|  0.023585|
======================================
{'fraction_non_alphanumeric': 0.348993288590604, 'fraction_numerical': 0.10216256524981357, 'mean_word_length': 2.423469387755102, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '649386', 'license': 'MIT', 'n_tokens_mistral': 541, 'n_tokens_neox': 439, 'n_words': 125, 'path': 'SVM/Code/Assign2_codeQ4.ipynb', 'repo_name': 'Tauhait/ml-projects', 'size': '1341'}