Wolfram 機械学習 | 試してみよう

コードはどれも,コード内をクリックしてから,編集したり,
+
を押して実行したりできます.
機械学習とニューラルネットワーク 従来の機械学習,統計解析,可視化,画像処理等と緊密に統合されている最新のAIを使って,生産グレードのインテリジェントなシステムが構築できます.

分類器を使い訓練する

訓練済みの分類器を使って画像を識別する:
実行
Classify"NotablePerson",

テキストに訓練済みの言語分類器を使う:
実行
Classify["Language","the house is blue","la maison est bleue","la casa es azul","das Haus ist blau","房子是蓝色的","المنزل باللون الأزرق","будинок синій"]
訓練済みモデルは他の多数の関数で使われる:
実行
ImageIdentify
,
,
,SpecificityGoal->"Low"
自作の分類器を高レベルのコードで訓練する:
実行
topicClassifier=​​Classify​​"the cat is grey"->
,​​"my cat is fast"->
,​​"this dog is scary"->
,​​"the big dog"->
​​
訓練された自作モデルを使う:
実行
topicClassifier[{"nice cat","what a dog"}]

クラスタ分析

データのクラスタを見付ける:
実行
ListPlotFindClusters
GaussianDisks

よりよく制御するためにメソッドや他のオプションを指定する:
実行
ListPlotFindClusters
Rings
,Method->"DBSCAN"
グラフにおけるクラスタを分析する:
実行
CommunityGraphPlot[ExampleData[{"NetworkGraph","JazzMusicians"}]]
画像の要素を分析する:
実行
ClusteringComponents
,7//Colorize

次元削減

色関数は,データの構造を低次元空間に埋め込むことができることを示している:
実行
ListPointPlot3D
Higher Dimension Data
,​​ColorFunction->Hue0.5-0.5
Total[
2
{#1,#2}
]
&,​​ColorFunctionScaling->False,​​
Options

このデータ集合についての次元削減関数を作成する:
実行
dr=DimensionReduction
Higher Dimension Data
,Method->"Isomap"
データに次元削減関数を適用する:
実行
ListPlotdr
Higher Dimension Data
,ColorFunction(Hue[0.5#1]&)

異常なデータを検出する

よく知られたデータ集合から情報を取得する:
実行
In[]:=
irisdata=ResourceData["Sample Data: Fisher's Irises"][All,{"PetalLength","SepalWidth"},QuantityMagnitude];
異常検出関数を作成する:
実行
detector=AnomalyDetection[irisdata]
検出関数を使って,データ集合内の異常値を見付ける:
実行
anomalies=FindAnomalies[detector,irisdata]
データと決定境界を可視化する:
実行
Show​​ContourPlotdetector[{x,y},"RarerProbability"],{x,-1,9},{y,1,5},
Options
,​​ListPlot{irisdata,anomalies},
Options
​​

欠損データの値を補完する

データ集合から何らかの情報を削除して,欠損データを含むようにする:
実行
incompletedata=
Data
/.{x_/;4<x<5,y_}:>{x,Missing[]};​​ListPlot[incompletedata]
分布を訓練して欠損値を予測する:
実行
{nonmissingdata,missingdata}=GatherBy[incompletedata,MemberQ[_Missing]];​​ld=LearnDistribution[nonmissingdata]
欠損値を合成して結果をプロットする:
実行
synthesized=SynthesizeMissingValues[ld,missingdata];​​ListPlot[{incompletedata,synthesized}]

ニューラルネットワークを訓練して調べる

分類のためによく知られたデータ集合を取得する:
実行
In[]:=
trainingdata=ResourceData["MNIST","TrainingData"];​​testdata=ResourceData["MNIST","TestData"];​​SeedRandom[1234];​​RandomSample[trainingdata,5]
Out[]=

9,
4,
0,
2,
5
そのデータでモデルを訓練する(この評価には時間がかかる場合がある):
実行
In[]:=
trainedNet=NetTrain[NetModel["LeNet"],trainingdata,MaxTrainingRounds->2]
Out[]=
NetChain
Inputport:
image
Outputport:
class
Data not saved. Save now

訓練されたネットワークの性能を見てみる:
実行
NetMeasurements[trainedNet,testdata,{"Accuracy","ConfusionMatrixPlot"}]
Out[]=
0.9889,
actual class
​
predicted class


コンピュータビジョン

自然言語処理

音声解析