<jupyter_start><jupyter_text>SVM Basics<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm
from sklearn.datasets.samples_generator import make_blobs
# we create 1 40 separable points
X, y = make_blobs(n_sample=40, centers=2, random_state= 20)
# fit the model
clf = svm.SVC(kernel='linear' , C=1)
clf.fit(X,y)
# Display the data in the graph
plt.scatter(X[:,0], X[:,1], c=y, s=30,cmap=plt.cm.Paired )
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1278825995807128, 'fraction_numerical': 0.027253668763102725, 'mean_word_length': 6.587301587301587, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '162421', 'license': 'Apache-2.0', 'n_tokens_mistral': 201, 'n_tokens_neox': 192, 'n_words': 47, 'path': '03 Misc/04 svm_basics.ipynb', 'repo_name': 'alphaolomi/colab', 'size': '477'}