Machine Learning

Etienne Bernard, Wolfram Research

Machine Learning ?

Computer “learns” a model from data

⟶

{ ->cat, ->dog,...}	⟶

Typical tasks

Classification of images, sound, text, etc.

->cat, ->dog,...

Prediction of a variable in a dataset

(6 yo, female) -> 1.15 m, (11 yo, male) -> 1.48 m, ...

Prediction of a time series

Text translation

“the house is blue” -> “la maison est bleue”

Anomaly detection

Data clustering

Robot learning how to move

In the Wolfram Language

High-level functionalities

Predict, Classify, ClusterClassify, FeatureExtraction, etc.

Task oriented

Automatic

Wide range of data types (Numerical, Images, text, etc.)

Low-level functionalities

Neural network framework (NetTrain, NetChain, etc.)

Model oriented

High flexibility

See talk of Sebastian Bodenstein  - Friday 10 AM

Developed using Machine Learning

Built-in classifiers, ImageIdentify, TextCases, etc.

High-level functions

Supervised Learning

Classify

Predict

FindFormula

Unsupervised Learning

DimensionReduction

FeatureExtraction

ClusterClassify

ClusteringTree

FindDistribution

“Active” Learning

BayesianMinimization

11.1:

ActiveClassification

ActivePrediction

Classify & Predict

Predict - basic example

data={-1.2->1.2,1.4->1.4,3.1->1.8,4.5->1.6};

Show[Plot[{
p[x],
p[x]+StandardDeviation[p[x,"Distribution"]],p[x]-StandardDeviation[p[x,"Distribution"]]
},{x,-2,6},PlotStyle->{Blue,Gray,Gray},Filling->{2->{3}},Exclusions-> False,PerformanceGoal->"Speed",PlotLegends->{"Prediction","Confidence Interval"}],ListPlot[List@@@data,PlotStyle->Red,PlotLegends->{"Data"}]]

Image Classification

ServiceConnect["BingSearch"]

creaturesname={"centaur","griffin","dragon","unicorn"};

creatureimages=ServiceExecute["BingSearch","Search",{"Query"->#,"SearchType"->"Images","MaxItems"->60,"Elements"->"Thumbnails"}] & /@ creaturesname;

labeledcreatures=RandomSample[DeleteDuplicates[Flatten[Thread /@ Thread[creatureimages->creaturesname]]]];

training = labeledcreatures[[;;100]];
test = labeledcreatures[[101;;]];

FeatureExtraction

Learn a feature extractor from data

Use “built-in” feature extractor + dimensionality reduction

Useful for most machine learning application

mythicalcreatures=labeledcreatures[[All,1]];

Visualization

features=FeatureExtract[mythicalcreatures];

xy=DimensionReduce[features,2];

ListPlot[List/@xy,PlotMarkers->(Image[#,ImageSize->30]& /@ mythicalcreatures),ImageSize->1000]

Search system

dataset=mythicalcreatures[[;;150]];
queries=mythicalcreatures[[151;;]];

fe=FeatureExtraction[dataset]

nf=Nearest[fe[dataset]->Automatic]

nearestcreature=dataset[[First@nf[fe[#]]]]&

Built-in Machine Learning

Built-in Classifiers

Classify["Language","Quelle est cette langue"]

Classify["FacebookTopic","I play guitar"]

Classify["NotablePerson",]

ImageIdentify

ImageIdentify[]

ImageIdentify[]

TextStructure

str=TextStructure["The house is blue. My dog is fast."]

TextCases

moon=WikipediaData["Moon"];

Sentences, words, ...

TextCases[moon,"Sentence"]

Grammatical units:

TextCases[moon,"Noun"]

Languages

TextCases["John and Mary went to Italy. Et je suis francais. La casa es azul. And english again", "English"]

TextCases["John and Mary went to Italy. Et je suis francais. La casa es azul. And english again", {"English","Spanish"}->{"Type","Position"}]

Various entity types:

TextCases[moon,"Country"]

Quantities:

TextCases[moon,"Quantity"->"Interpretation"]

Also:

“PhoneNumber”

“EmailAddress”

“URL”

...

What’s next

Multiple-output prediction

LearnDistribution

MissingImputation

AnomalyDetection

...

Reinforcement learning

??