-
-
Save amankharwal/0e46dd5b82f101fdde9471f72251410c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = np.array(data[["Age", "EstimatedSalary"]]) | |
y = np.array(data[["Purchased"]]) | |
xtrain, xtest, ytrain, ytest = train_test_split(x, y, test_size=0.10, random_state=42) | |
decisiontree = DecisionTreeClassifier() | |
logisticregression = LogisticRegression() | |
knearestclassifier = KNeighborsClassifier() | |
svm_classifier = SVC() | |
bernoulli_naiveBayes = BernoulliNB() | |
passiveAggressive = PassiveAggressiveClassifier() | |
knearestclassifier.fit(xtrain, ytrain) | |
decisiontree.fit(xtrain, ytrain) | |
logisticregression.fit(xtrain, ytrain) | |
passiveAggressive.fit(xtrain, ytrain) | |
data1 = {"Classification Algorithms": ["KNN Classifier", "Decision Tree Classifier", | |
"Logistic Regression", "Passive Aggressive Classifier"], | |
"Score": [knearestclassifier.score(x,y), decisiontree.score(x, y), | |
logisticregression.score(x, y), passiveAggressive.score(x,y) ]} | |
score = pd.DataFrame(data1) | |
score |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment