Skip to content

Instantly share code, notes, and snippets.

Created October 2, 2021 11:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
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(), ytrain), ytrain), ytrain), 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment