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
from sklearn.datasets import load_wine | |
from sklearn.model_selection import train_test_split | |
from sklearn.metrics import accuracy_score | |
#Classifiers | |
from sklearn.naive_bayes import GaussianNB | |
from sklearn.neighbors import KNeighborsClassifier | |
from sklearn.svm import SVC | |
from sklearn.gaussian_process import GaussianProcessClassifier | |
from sklearn.tree import DecisionTreeClassifier |
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
''' | |
Evaluating accuracy of two different classifiers - Decision Tree and GaussianNB | |
from same prepared dataset | |
''' | |
from sklearn.datasets import load_digits | |
from sklearn.model_selection import train_test_split | |
from sklearn.naive_bayes import GaussianNB | |
from sklearn.metrics import accuracy_score | |
from sklearn.tree import tree |
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
''' | |
Program to evaluate iris flower into its types - setosa, versicolor, virginica | |
using GaussianNB and rating the accuracy of the classifer | |
''' | |
from sklearn.datasets import load_iris | |
from sklearn.naive_bayes import GaussianNB | |
from sklearn.model_selection import train_test_split | |
from sklearn.metrics import accuracy_score |
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
''' | |
A simple program to calculate if a tumor is malignant or benign and judging our trained gaussianNB classifiers accuracy | |
using scikit learn module accuracy_score | |
''' | |
from sklearn.datasets import load_breast_cancer # Importing cancer dataset | |
from sklearn.model_selection import train_test_split # Importing train_test_split module to split our bulk data into training data and testing data | |
from sklearn.naive_bayes import GaussianNB # Importing classifier called 'GaussianNaiveBayes' | |
from sklearn.metrics import accuracy_score # Importing scikit learn module to evaluate accuracy of our classifier model | |
#Storing imported data into 'data' |
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
''' | |
The program predicts if a fruit is an apple or an orange from examining a | |
given data set of four fruits with two labels - apple or orange. | |
''' | |
import sklearn # Import SciKit Learn | |
from sklearn import tree # Import a classifier called 'DescisionTreeClassifier' | |
# Dataset of 4 fruits with 2 labels, apple and orange |