My First Machine learning program

What is machine learning ?

What is this

Types of Machine learning :

Supervised learning :

Unsupervised Learning :

Use Cases of Machine learning :

Part2:

python installed in linux

What is Sickit-learn ?

David Cournapeau
sudo apt-get update  
sudo apt-get install --no-install-recommends python2.7-minimal python2.7
sudo apt-get install python-numpy python-scipy
pip install -U scikit-learn
Training and testing process
#import our datasest from sklearn
from sklearn import datasets

# Load in the `digits` data
digits = datasets.load_digits()

# Print the `digits` data
print(digits.data)
#import our Classifier avalaible
from sklearn.svm import SVC
# Create a classifier: a support vector classifier
classifier = SVC(gamma=0.001)
# turn the data in a (samples, feature) matrix:
n_samples = len(digits.images)
data = digits.images.reshape((n_samples, -1))
# We train our model with the first half of data
classifier.fit(data[:n_samples // 2], digits.target[:n_samples // 2])
expected = digits.target[n_samples // 2:]
predicted = classifier.predict(data[n_samples // 2:])
print("Classification report for classifier %s:\n%s\n"
% (classifier, metrics.classification_report(expected, predicted)))
print("Confusion matrix:\n%s" % metrics.confusion_matrix(expected, predicted))

--

--

--

<script>alert('try your best')</script>

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Setting up environment for AI/ML or how to start with Artificial Intelligence

Simple Text Generation

Analysing the use of frame semantics in extracting NLP-based information from EHR for cancer…

Fastai Training metrics as Notification on mobile

Implementing Keras metrics F1 for a class

Summary: Reformer: The Efficient Transformer

Back-propagation Demystified in 7 Minutes

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Rebai Ahmed

Rebai Ahmed

<script>alert('try your best')</script>

More from Medium

K-Nearest Neighbors Classification

Understanding The Naive-Bayes Classifier Algorithm

The Perceptron Algorithm Simplified !

How to Approach Supervised Machine Learning Problems?