<jupyter_start><jupyter_text>Este notebook foi usado para estudo da aula referente a introdução ML da Alura.*   Aluno: <NAME>*   Data: Fev/2021<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
from sklearn import svm
from matplotlib import style
style.use("ggplot")
x = [1, 5, 1.5, 8, 1, 9]
x
y = [2, 8, 1.8, 8, 0.6, 11]
y
plt.scatter(x,y)
X = np.array([[1,2],
    [5,8],
    [1.5,1.8],
    [8,8],
    [1,0.6],
    [9,11]
    ])
X
Y = [0, 1, 0, 1, 0, 1]
Y
clf = svm.SVC(kernel = 'linear', C = 1.0)
clf.fit(X,Y)
previsao = clf.predict([[1.58, 1.76]])
print(f'Previsao é {previsao}')
w = clf.coef_[0]
print(w)
a = -w[0] / w[1]
xx = np.linspace(0, 12)
yy = a*xx-clf.intercept_[0] / w[1]
h0 = plt.plot(xx, yy, 'k-', label = "non weighted div")
plt.scatter(X[:, 0], X[:, 1], c = y)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.2095006090133983, 'fraction_numerical': 0.07429963459196103, 'mean_word_length': 3.5921787709497206, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '487048', 'license': 'MIT', 'n_tokens_mistral': 435, 'n_tokens_neox': 410, 'n_words': 105, 'path': 'python_alura/04-linear_SVC_example.ipynb', 'repo_name': 'ferris77/my_notebooks', 'size': '829'}