Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
magixer.cf

magixer magixer

💭
magixer.cf
  • India
View GitHub Profile
@magixer
magixer / 05-RatingClassifiers.py
Last active Oct 22, 2017
Rating accuracy of 6 different classifiers
View 05-RatingClassifiers.py
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
@magixer
magixer / 04-TwiceTheClassifier.py
Last active Oct 21, 2017
Evaluating accuracy of 2 diff classifiers from same prepared dataset
View 04-TwiceTheClassifier.py
'''
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
View 03-AnotherDataSet.py
'''
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
@magixer
magixer / 02-RealWorldData-Program.py
Last active Oct 21, 2017
First program to predict from real world data
View 02-RealWorldData-Program.py
'''
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'
@magixer
magixer / 01-First_Program.py
Created Oct 20, 2017
Beginners guide to their first machine learning program.
View 01-First_Program.py
'''
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
You can’t perform that action at this time.