My First Machine learning program

What is machine learning ?

What is this

Types of Machine learning :

Supervised learning :

  • Build the Model
  • Train the Model
  • Test the Model
  1. Support vector machines (SVM)
  2. Naïve Bayes classifier.
  3. Decision trees
  4. Nearest neighbors (KNN)
  5. Neural Networks
  6. ……
  • Linear regression
  • Nonlinear regression
  • Generalized linear models
  • Support Vector Regression (SVR)
  • Back-Propagation Neural Network (BPNN)
  • Partial Least Squares (PLS)
  • Multiple Linear Regression (MLR)

Unsupervised Learning :

  • K-Means Clustering
  • Hierarchical Clustering
  • Density based Clustering

Use Cases of Machine learning :

  • Spam Filters
  • Recommendation System
  • Chatbots
  • fraud detection
  • Self-Drive Cars
  • Self-Drive Drone
  • Image Recognition
  • Speech Recognition
  • Object Detection
  • Cancer Detection
  • and many other …..


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
#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[:n_samples // 2],[:n_samples // 2])
expected =[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))



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>