diff --git a/3217-classification-lr-example5.py b/3217-classification-lr-example5.py deleted file mode 100644 index fa7506699351e8ba3e9036de4caf39cb72018eb9..0000000000000000000000000000000000000000 --- a/3217-classification-lr-example5.py +++ /dev/null @@ -1,34 +0,0 @@ -#Import scikit-learn dataset library -from sklearn import datasets -from sklearn.model_selection import train_test_split -from sklearn import svm, metrics - - - -#Load dataset -cancer = datasets.load_breast_cancer() - -# print the names of the features -print("Features: ", cancer.feature_names) - -# print the label type of cancer('malignant' 'benign') -print("Labels: ", cancer.target_names) - -# print data(feature)shape -print (cancer.data.shape) - - -# Split dataset into training set and test set -X_train, X_test, y_train, y_test = train_test_split(cancer.data, cancer.target, test_size=0.2) # 70% training and 30% test - - -#Create a svm Classifier -clf = svm.SVC(kernel='linear') # Linear Kernel - -#Train the model using the training sets -clf.fit(X_train, y_train) - -#Predict the response for test dataset -y_pred = clf.predict(X_test) - -print("Accuracy:",metrics.accuracy_score(y_test, y_pred))