[PDF] [PDF] Python pour lapprentissage automatique avec Scikit-Learn





Previous PDF Next PDF



Machine Learning with Python

Machine Learning with Python ii. About the Tutorial. Machine Learning (ML) is basically that field of computer science with the help of which.



Présentation PowerPoint

Python pour l'apprentissage automatique avec Scikit-Learn. Laurent Risser https://pythonprogramming.net/neural-networks-machine-learning-tutorial/.



Prediction of COVID-19 using Machine Learning Techniques

16 mai 2020 In this thesis the following python libraries were used [45]. • Pandas - It is a python package that provides expressive data structures de-.



Réseaux de neurones et deep learning : Utilisation et méthodologie

Réseaux de neurones et deep learning. À partir de mi-octobre. Séances de 30/40 mn suivies de 20 mn de discussion. ? Séance 1 : Introduction aux réseaux de 



MACHINE LEARNING TECHNIQUE BASED PARKINSONS

The patients spiral drawing is analyzed using python. From these drawings principal component analysis. (PCA) algorithm for feature extraction from the spiral 



Machine Learning in Materials Modeling – Fundamentals and the

Thus at a time when AI and machine learning is pervading almost all Java-based data modelling which is easily accessible by Python and R based modules.



cours-python.pdf

22 mars 2018 Introduction à la programmation Python pour la biologie ... est que vous pouvez installer gratuitement Python sur votre machine que.



Python For Data Science Cheat Sheet

DataCamp. Learn Python for Data Science Interactively. Scientific computing. Data analysis. 2D plotting. Machine learning. Also see Lists.



How to Use the PowerPoint Template

Oracle Machine Learning for Python (OML4Py) Oracle Machine Learning for Python Oracle Machine Learning for Spark (OML4Spark) Oracle R Advanced Analytics ...



Introduction to TensorFlow

TensorFlow is an open-source library for Deep Learning. ? Developed by the Google Brain team and released in conda create -n tensorflow python=3.5.





MACHINE LEARNING WITH PYTHON - PowerPoint PPT Presentation

BEST MACHINE LEARNING ONLINE COURSE HENRY HARVIN EDUCATION – A free PowerPoint PPT presentation (displayed as an HTML5 slide show) on PowerShow com 



Machine Learning Using Python - SlideShare

22 août 2021 · K-Nearest neighbours K Nearest Neighbour is a simple algorithm that stores all the available cases and classifies the new data or case based 



[PDF] Machine Learning with Python - Tutorialspoint

This tutorial is a stepping stone to your Machine Learning journey Prerequisites The reader must have basic knowledge of artificial intelligence He/she 



[PPT] Machine Learning with Python - WordPresscom

Python implements popular machine learning techniques such as Classification Regression Recommendation and Clustering Python offers ready-made framework for 



[PDF] A Quick Introduction to Python and Machine Learning

17 avr 2019 · Help on getting stated with machine learning An Python package example: skrf 3 There are many Python tutorials available online



[PPT] Basic machine learning background with Python scikit-learn

Python Simple Python programs Data science Data science Simple definition: reasoning and making decisions from data; Contains machine learning 



[PDF] Python pour lapprentissage automatique avec Scikit-Learn

Tous les modules Python d'analyse de données utilisent des numpy array https://pythonprogramming net/neural-networks-machine-learning-tutorial/



[PDF] Des modules TECH et THEM - Université dOrléans

Data Mining : Fondements et Outils Python Data Sciences et Langage récentes comme le machine learning le deep-learning etc



[PDF] 01-Introduction-2020pdf

17 jan 2020 · En python ou PyTorch 1 seule acétate sans animation format pdf Deep Learning Rule- based systems Classic machine learning 

  • How Python is used for machine learning?

    Python includes a modular machine learning library known as PyBrain, which provides easy-to-use algorithms for use in machine learning tasks. The best and most reliable coding solutions require a proper structure and tested environment, which is available in the Python frameworks and libraries.
  • Is machine learning with Python easy?

    If you're going to pursue machine learning, it's a good idea to start with these key mathematical concepts and move onto the coding aspects from there. Many of the languages associated with artificial intelligence such as Python are considered relatively easy.
  • What is machine learning PDF?

    Machine learning (ML) is the scientific study of algorithms and statistical models that computer systems use to perform a specific task without being explicitly programmed.
  • Python AI: How to Build a Neural Network & Make Predictions

    1Computing the Prediction Error.2Understanding How to Reduce the Error.3Applying the Chain Rule.4Adjusting the Parameters With Backpropagation.5Creating the Neural Network Class.6Training the Network With More Data.7Adding More Layers to the Neural Network.
Python pour l'apprentissage automatique avec Scikit-Learn Laurent RisserInstitut de Mathématiques de Toulouse (IMT) lrisser@math.univ-toulouse.fr

OMP 2018 - ToulouseL. Risser

Présentation générale

L. RisserPlan:

1.Généralités sur Python

2.Écosystème Python pour l'analyse de données (non exhaustif !!!)

Scipy

NetworkX

Pandas

TensorFlow, Caffe, Pytorch, ...

Scikit-learn

3.Sous-Modules de Scikit-learn

OMP 2018 - Toulouse

L. RisserOMP 2018 - Toulouse1) Généralités sur Python

En bref :

•Libre •Langage généraliste mais très compact •Nombreuses extensions et bibliothèques disponibles •Orienté objet (mais on peut en faire abstraction)

Découvrir Python :

•www.docs.python.org •http://apprendre-python.com •... mon cours... •" Ask google »

Python pour l'apprentissage :

•Moins spécialisé que R...

•... mais il existe un écosystème de modules Python pour l'analyse (franchement) avancée ...

•... tout en profitant d'autres modules de lecture et traitement de données variées Les grandes forces de Python sont la taille et le dynamisme de sa communauté

L. RisserOMP 2018 - Toulouse1) Généralités sur Python

Numpy :LE module Python pour la programmation numériqueContient le data type array et des fonctions pour le manipulerTous les modules Python d'analyse de données utilisent des numpy.array

import numpy as np my_1D_array = np.array([4,3,2],dtype=np.lfloat128) print(my_1D_array) →[4.0 3.0 2.0] toto=np.random.randn(2,3) print(toto) →[[-0.37716423 -0.53787731 -0.73762654] [-2.90642102 -1.0586924 0.20380006]] toto.mean() → -0.902330239148 L. RisserOMP 2018 - Toulouse2) Écosystème - Scipy Scipy est une bibliothèque pour les mathématiques, la science, et l'ingénierie On peut voir ce que Scipy peut faire à la page http://docs.scipy.org/doc/scipy/reference/ : • Integration (scipy.integrate) • Optimization and root finding (scipy.optimize) • Interpolation (scipy.interpolate) • Fourier Transforms (scipy.fftpack) • Signal Processing (scipy.signal) • Linear Algebra (scipy.linalg) • Sparse Eigenvalue Problems with ARPACK • Compressed Sparse Graph Routines scipy.sparse.csgraph • Spatial data structures and algorithms (scipy.spatial) • Statistics (scipy.stats) • Multi-dimensional image processing (scipy.ndimage) • Clustering package (scipy.cluster) • Orthogonal distance regression (scipy.odr) • Sparse matrices (scipy.sparse) • Sparse linear algebra (scipy.sparse.linalg) • Compressed Sparse Graph Routines (scipy.sparse.csgraph) • File inputs/outputs (scipy.io) •... et bien d'autres encoreSciPy L. RisserOMP 2018 - Toulouse2) Écosystème - Scipy - Un petit exemple SciPy import scipy.stats rvs1 = scipy.stats.norm.rvs(loc=5, scale=10, size=500) rvs2 = scipy.stats.norm.rvs(loc=5, scale=10, size=500) rvs3 = scipy.stats.norm.rvs(loc=8, scale=10, size=500) #t-test (returns: calculated t-statistic / two-tailed p-value) scipy.stats.ttest_ind(rvs1, rvs2) →(-0.5489, 0.5831) scipy.stats.ttest_ind(rvs1, rvs3) →(-4.533, 6.507e-6) #Kolmogorov-Smirnov test (returns: KS statistic / two-tailed p-value) scipy.stats.ks_2samp(rvs1, rvs2) →(0.0259, 0.9954) scipy.stats.ks_2samp(rvs1, rvs3) →(0.1139, 0.0027) L. RisserOMP 2018 - Toulouse2) Écosystème - NetworkX L. RisserOMP 2018 - Toulouse2) Écosystème - NetworkX - Un petit exemple import networkx as nx import csv

RefGraph=nx.Graph()

with open(EdgesCsvFile_or_List,'r') as csvfile: data = csv.reader(csvfile, delimiter=' ', quotechar='%') for row in data:

T=nx.minimum_spanning_tree(RefGraph)

Gestion efficace de graphes relativement gros (105 noeuds) : L. RisserOMP 2018 - Toulouse2) Écosystème - Pandas Pandas : Librairie Python pour extraire, préparer et éventuellement analyser, des données •Contient les classes Series et DataFrame (tables de données) •Lecture des fichiers .csv, xls, hdf5, HTML, XML, JSON, MongoDB, SQL, ... •Sélection/Suppression/Ajout de lignes et de colonnes, fusion de DataFrames •Gestion de données manquantes et aberrantes •Génération de nombres aléatoires •Tests statistiques élémentaires •Fonctions graphiques •Gestion des dates •Gestion de très grosses données (via HDF5) L. RisserOMP 2018 - Toulouse2) Écosystème - Pandas - Un petit exemple import pandas as pd data = {"state": ["Ohio", "Ohio", "Ohio","Nevada"], "year": [2000, 2001, 2002, 2001], "pop": [1.5, 1.7, 3.6, 2.4]} frame = pd.DataFrame(data , columns=["year", "state", "pop"]) print frame → yearstate pop → 02000 Ohio 1.5 → 1 2001 Ohio 1.7 → 2 2002 Ohio 3.6 → 3 2001 Nevada 2.4 frame2=pd.DataFrame(data, columns=["year", "state", "pop", "debt"], index=["one", "two", "three", "four"]) print frame2 → year state pop debt → one 2000 Ohio 1.5 NaN → two 2001 Ohio 1.7 NaN → three 2002 Ohio 3.6 NaN → four 2001 Nevada 2.4 NaN frame["state"] →0 Ohio →1 Ohio →2 Ohio →3 Nevada →4 Nevada frame2["debt"] = 16.5 frame2.set_value('four', 'debt', 10) print frame2 → yearstate pop debt →one2000Ohio 1.5 16.5 →two 2001Ohio 1.7 16.5 →three2002Ohio 3.6 16.5 →four2001Nevada2.4 10.0 → Utilisation massive des dataframes comme en R ! L. RisserOMP 2018 - Toulouse2) Écosystème - TensorFlow, Caffe, PyTorch, ...

Deep-learning sous Python

+ Apprentissage supervisé et prédiction avec XGBoost : L. RisserOMP 2018 - Toulouse2) Écosystème - Scikit-learn Scikit-learn est la bibliothèque de référence pour l'analyse de données sous Python. → Utilise massivement NumPy, Matplotlib et SciPy.

On peut se faire une idée de ce que Scikit-learn peut faire à http://scikit-learn.org/stable/ :

•Classification supervisée→SVM, random forest, ... •Regression→Ridge regression, Lasso, ... •Clustering→k-Means, spectral clustering, mean-shift, ... •Dimensonality reduction→PCA, non-negative matrix factorization, ... •Model selection→cross validation, parameter search, classification metrics, ... L. RisserOMP 2018 - Toulouse3) Scikit-learn - Exemple en classification supervisée SVM (http://scikit-learn.org/stable/auto_examples/svm/plot_iris.html) import numpy as np import matplotlib.pyplot as plt from sklearn import svm, datasets # import some data to play with iris = datasets.load_iris() print(iris.data) →[[ 5.1 3.5 1.4 0.2] [ 4.9 3. 1.4 0.2] [ 6.2 3.4 5.4 2.3] [ 5.9 3. 5.1 1.8]] print(iris.target) →[0 0 0 0 0 ... 1 1 1 ... 2 2 2]150 observations en dimension 4

150 labels dans {0,1,2}

L. RisserOMP 2018 - Toulouse3) Scikit-learn - Exemple en classification supervisée SVM (http://scikit-learn.org/stable/auto_examples/svm/plot_iris.html) import numpy as np import matplotlib.pyplot as plt from sklearn import svm, datasets # import some data to play with iris = datasets.load_iris() print(iris.data) →[[ 5.1 3.5 1.4 0.2] [ 4.9 3. 1.4 0.2] [ 6.2 3.4 5.4 2.3] [ 5.9 3. 5.1 1.8]] print(iris.target) →[0 0 0 0 0 ... 1 1 1 ... 2 2 2] # we create an instance of SVM and fit out data.

X = iris.data[:, :2]

y = iris.target svm_inst=svm.SVC(kernel='linear', C=1.0) svc = svm_inst.fit(X, y)# create a mesh of values to test x_min, x_max = X[:, 0].min() - 1, X[:, 0].max() + 1 y_min, y_max = X[:, 1].min() - 1, X[:, 1].max() + 1 xx, yy = np.meshgrid(np.arange(x_min, x_max, 0.02), np.arange(y_min, y_max, 0.02)) #predict the class of the points on the mesh

Z = clf.predict(np.c_[xx.ravel(), yy.ravel()])

#plot the result L. RisserOMP 2018 - Toulouse3) Scikit-learn - Exemple en classification supervisée SVM (http://scikit-learn.org/stable/auto_examples/svm/plot_iris.html) import numpy as np import matplotlib.pyplot as plt from sklearn import svm, datasets # import some data to play with iris = datasets.load_iris() print(iris.data) →[[ 5.1 3.5 1.4 0.2] [ 4.9 3. 1.4 0.2] [ 6.2 3.4 5.4 2.3] [ 5.9 3. 5.1 1.8]] print(iris.target) →[0 0 0 0 0 ... 1 1 1 ... 2 2 2] # we create an instance of SVM and fit out data.

X = iris.data[:, :2]

y = iris.target svm_inst=svm.SVC(kernel='linear', C=1.0) svc = svm_inst.fit(X, y)# create a mesh of values to test x_min, x_max = X[:, 0].min() - 1, X[:, 0].max() + 1 y_min, y_max = X[:, 1].min() - 1, X[:, 1].max() + 1 xx, yy = np.meshgrid(np.arange(x_min, x_max, 0.02), np.arange(y_min, y_max, 0.02)) #predict the class of the points on the mesh

Z = clf.predict(np.c_[xx.ravel(), yy.ravel()])

#plot the result

L. RisserOMP 2018 - Toulouse3) Scikit-learn - Exemple en classification non-supervisée (clustering)

import numpy as np import matplotlib.pyplot as plt from sklearn.cluster import KMeans from sklearn.datasets import load_digits from sklearn.decomposition import PCA from sklearn.preprocessing import scale np.random.seed(42) digits = load_digits() print(digits.data) →[[ 0. 0. 5. ..., 0. 0. 0.] [ 0. 0. 0. ..., 10. 0. 0.] [ 0. 0. 1. ..., 6. 0. 0.] [ 0. 0. 10. ..., 12. 1. 0.]]1797 observations

en dimension 64Reduction de dimension et K-means (http://scikit-learn.org/stable/auto_examples/cluster/plot_kmeans_digits.html)

L. RisserOMP 2018 - Toulouse3) Scikit-learn - Exemple en classification non-supervisée (clustering)

Reduction de dimension et K-means (http://scikit-learn.org/stable/auto_examples/cluster/plot_kmeans_digits.html)

import numpy as np import matplotlib.pyplot as plt from sklearn.cluster import KMeans from sklearn.datasets import load_digits from sklearn.decomposition import PCA from sklearn.preprocessing import scale np.random.seed(42) digits = load_digits() print(digits.data) →[[ 0. 0. 5. ..., 0. 0. 0.] [ 0. 0. 0. ..., 10. 0. 0.] [ 0. 0. 1. ..., 6. 0. 0.] [ 0. 0. 10. ..., 12. 1. 0.]] data = scale(digits.data) #centre/réduit les donnees print(red_data) →[[ 1.91422151 -0.95454005] [ 0.58898326 0.92462171] [ 1.07605978 -0.38092876] [-1.25771163 -2.22756272]]1797 observations en dimension 64

1797 observations

en dimension 2

L. RisserOMP 2018 - Toulouse3) Scikit-learn - Exemple en classification non-supervisée (clustering)

Reduction de dimension et K-means (http://scikit-learn.org/stable/auto_examples/cluster/plot_kmeans_digits.html)

import numpy as np import matplotlib.pyplot as plt from sklearn.cluster import KMeans from sklearn.datasets import load_digits from sklearn.decomposition import PCA from sklearn.preprocessing import scale np.random.seed(42) digits = load_digits() print(digits.data) →[[ 0. 0. 5. ..., 0. 0. 0.] [ 0. 0. 0. ..., 10. 0. 0.] [ 0. 0. 1. ..., 6. 0. 0.] [ 0. 0. 10. ..., 12. 1. 0.]] data = scale(digits.data) #centre/réduit les donnees print(red_data) →[[ 1.91422151 -0.95454005] [ 0.58898326 0.92462171] [ 1.07605978 -0.38092876] [-1.25771163 -2.22756272]]#lance le clustering kmeans = KMeans(init='k-means++', n_clusters=9, n_init=9) kmeans.fit(reduced_data) #représente le résultat

Z = kmeans.predict(reduced_data)

plt.scatter(reduced_data[:, 0],reduced_data[:, 1],c=Z) plt.show()

L. RisserOMP 2018 - Toulouse3) Scikit-learn - Exemple en classification non-supervisée (clustering)

Reduction de dimension et K-means (http://scikit-learn.org/stable/auto_examples/cluster/plot_kmeans_digits.html)

import numpy as np import matplotlib.pyplot as plt from sklearn.cluster import KMeans from sklearn.datasets import load_digits from sklearn.decomposition import PCA from sklearn.preprocessing import scale np.random.seed(42) digits = load_digits() print(digits.data) →[[ 0. 0. 5. ..., 0. 0. 0.] [ 0. 0. 0. ..., 10. 0. 0.] [ 0. 0. 1. ..., 6. 0. 0.] [ 0. 0. 10. ..., 12. 1. 0.]] data = scale(digits.data) #centre/réduit les donnees print(red_data) →[[ 1.91422151 -0.95454005] [ 0.58898326 0.92462171] [ 1.07605978 -0.38092876] [-1.25771163 -2.22756272]]#lance le clustering kmeans = KMeans(init='k-means++', n_clusters=9, n_init=9) kmeans.fit(reduced_data) #représente le résultat

Z = kmeans.predict(reduced_data)

plt.scatter(reduced_data[:, 0],reduced_data[:, 1],c=Z) plt.show() L. RisserOMP 2018 - Toulouse3) Scikit-learn - Exemple en régression Régression (http://scikit-learn.org/stable/_downloads/plot_isotonic_regression.py) import numpy as np import matplotlib.pyplot as plt from matplotlib.collections import LineCollection from sklearn.linear_model import LinearRegression from sklearn.isotonic import IsotonicRegression from sklearn.utils import check_random_state n = 100 x = np.arange(n) rs = check_random_state(0) y = rs.randint(-50, 50, size=(n,)) + 50. * np.log(1 + np.arange(n)) # Fit IsotonicRegression and LinearRegression models ir = IsotonicRegression() y_ = ir.fit_transform(x, y) lr = LinearRegression() lr.fit(x[:, np.newaxis], y) # plot result segments = [[[i, y[i]], [i, y_[i]]] for i in range(n)] lc = LineCollection(segments, zorder=0) lc.set_array(np.ones(len(y))) lc.set_linewidths(0.5 * np.ones(n))

L. RisserOMP 2018 - Toulouse4) A vous !!!

JOUEZ LES EXERCICES PROPOSES

ET REPONDEZ AUX QUESTIONS

Ensuite vous pouvez jouer les

notebooks wikistat : www.wikistat.frquotesdbs_dbs19.pdfusesText_25
[PDF] macintosh

[PDF] macleay valley travel reviews

[PDF] macleay valley travel tasmania

[PDF] macos 10.15 compatibility

[PDF] macos catalina security features

[PDF] macos security guide

[PDF] macos server

[PDF] macos server mojave

[PDF] macos virtualization license

[PDF] macromolecules

[PDF] macron ce soir

[PDF] macros in 8086 microprocessor pdf

[PDF] macros in excel pdf books

[PDF] macy's billing

[PDF] macy's card discount exclusions