images=RandomSample[ResourceData["MNIST"],10000];
test=images[[1;;3000]]; train=images[[3001;;10000]];
queries=Keys[ RandomSample[test,5]];
#->Nearest[Keys[train],#,3]&/@queries//TableForm
fe=FeatureExtraction[Keys[images]];
fetrain=fe[Keys[train]]; fetest=fe[Keys[test]];
CLF=Classify[Table[fetrain[[i]]->Values[train][[i]],{i,7000}],
Method->"NeuralNetwork"]
CM=ClassifierMeasurements[CLF,
Table[fetest[[i]]->Values[test][[i]],{i,3000}]];
Transpose[Table[CM/@ {"FScore"}//r,
{r,{Keys,Values}}]]//TableForm
CM/@{"Accuracy", "ConfusionMatrixPlot"}
queries=Keys[ RandomSample[test,5]];
#->Nearest[Keys[train],#,3]&/@queries//TableForm
fe=FeatureExtraction[Keys[images]];
fetrain=fe[Keys[train]]; fetest=fe[Keys[test]];
CLF=Classify[Table[fetrain[[i]]->Values[train][[i]],{i,7000}],
Method->"NeuralNetwork"]
CM=ClassifierMeasurements[CLF,
Table[fetest[[i]]->Values[test][[i]],{i,3000}]];
Transpose[Table[CM/@ {"FScore"}//r,
{r,{Keys,Values}}]]//TableForm
CM/@{"Accuracy", "ConfusionMatrixPlot"}
No comments:
Post a Comment