From b4f017154695403e0d9e977dd1dbd1ab638d635f Mon Sep 17 00:00:00 2001 From: Chauhan Chauhan <j.chauhan@soton.ac.uk> Date: Sun, 23 Apr 2023 18:44:03 +0000 Subject: [PATCH] Delete 3217-classification-lr-example5.py --- 3217-classification-lr-example5.py | 34 ------------------------------ 1 file changed, 34 deletions(-) delete mode 100644 3217-classification-lr-example5.py diff --git a/3217-classification-lr-example5.py b/3217-classification-lr-example5.py deleted file mode 100644 index fa75066..0000000 --- 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)) -- GitLab