<jupyter_start><jupyter_text>Support Vector Machines Destek Vektör Makinesi<jupyter_code># https://en.wikipedia.org/wiki/Support-vector_machine
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# Data
from sklearn.datasets import load_breast_cancer
veri = load_breast_cancer()
type(veri)
veri.keys()
print(veri["DESCR"])
veri['feature_names']
df = pd.DataFrame(veri['data'], columns=veri['feature_names'])
df.head()
df.info()
# Hedef değişken (Label) (etiket)
y = pd.DataFrame(veri["target"], columns=['Kanser'])
y.head()
# Train-test split
from sklearn.model_selection import train_test_split
X_train, X_test, y_train, y_test = train_test_split(df, y['Kanser'], test_size=0.30)
# Scaling
from sklearn.preprocessing import StandardScaler
scaler = StandardScaler()
scaler.fit(X_train)
X_train = scaler.transform(X_train)
X_test = scaler.transform(X_test)<jupyter_output><empty_output><jupyter_text>SVC<jupyter_code>from sklearn.svm import SVC
model = SVC()
model.fit(X_train, y_train)
tahminler = model.predict(X_test)
from sklearn.metrics import classification_report
print(classification_report(y_test, tahminler))<jupyter_output>precision    recall  f1-score   support

           0       0.98      0.70      0.82        64
           1       0.85      0.99      0.91       107

    accuracy                           0.88       171
   macro avg       0.91      0.85      0.87       171
weighted avg       0.90      0.88      0.88       171
{'fraction_non_alphanumeric': 0.10457963089542037, 'fraction_numerical': 0.04032809295967191, 'mean_word_length': 3.546583850931677, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '391645', 'license': 'Apache-2.0', 'n_tokens_mistral': 551, 'n_tokens_neox': 520, 'n_words': 111, 'path': 'hafta-4/.ipynb_checkpoints/ders2-checkpoint.ipynb', 'repo_name': 'yasarkucukefe/YBS462', 'size': '1463'}