I used a data set from sklearn to detect if someone has a malignant or a benign tumor. I used the KNN method (K nearest neighbors method to train my data). KNN looks for groups of data and it picks the closest group of that data points. The k value is assigned the number of "neighbors" to check. For example, if K value was 3 the and you were trying to classify a point it would be classified as whichever group has the majority of the points closest to it.
import sklearn
from sklearn import datasets
from sklearn import svm
from sklearn import metrics
from sklearn.neighbors import KNeighborsClassifier
cancer = datasets.load_breast_cancer()
#print(cancer.feature_names)
#print(cancer.target_names)
x = cancer.data
y = cancer.target
x_train, x_test, y_train, y_test = sklearn.model_selection.train_test_split(x, y, test_size=0.2)
print(x_train, y_train)
classes = ['malignant' 'benign']
#c =2 is soft margin
#clf = KNeighborsClassifier(n_neighbors=7)
clf = svm.SVC(kernel="linear", C=2 ) #kernel function increases acc dont do poly i know ur thinking about it
clf.fit(x_train, y_train)
y_pred = clf.predict(x_test)
acc = metrics.accuracy_score(y_test, y_pred) #accuracy
print(acc)