NI-ROZ / ANI-ROZ

Volba metody pro rozpoznáváníChoosing a recognition method

Devět algoritmů a jeden kontrolovaný experiment.Nine algorithms and one controlled experiment.

Osm úvodních slidů a 90 minut praktické práce.Eight introductory slides and a 90-minute practical session.

Actual training images from load_digits, 8 × 8 pixels.
Skutečné trénovací obrázky z load_digits, 8 × 8 pixelů.Actual training images from load_digits, 8 × 8 pixels.

Devět metod, různé úlohyNine methods, different tasks

MetodaMethodÚloha zdeTask herePrincipIdea
Linear regressionregreseregressionPřímka v příznacích, predikce číselné hodnotyA linear combination of features predicts a number
Logistic regressionklasifikaceclassificationLineární skóre a model pravděpodobností třídLinear scores and a model of class probabilities
Decision treeklasifikaceclassificationPosloupnost dělení, zde hloubka 8A sequence of splits, depth 8 here
Random forestklasifikaceclassificationPrůměrování randomizovaných stromůAn average of randomized trees
SVM (SVC)klasifikaceclassificationHranice s marginem, zde RBF kernelA margin-based boundary, using an RBF kernel here
k-NNklasifikaceclassificationHlasování tří nejbližších trénovacích vzorůA vote of the three nearest training examples
k-meansshlukováníclusteringDeset shluků, počet K dodávámeTen clusters, with K supplied as an input
Gaussian naive BayesklasifikaceclassificationModel hustot s podmíněnou nezávislostí příznakůDensity models with conditional feature independence
Gradient boostingklasifikaceclassificationPostupně přidáváme malé stromy podle ztrátySmall trees added sequentially using a loss function

Role v tabulce odpovídá zvolené variantě. Například k-NN a stromy mají i regresní varianty.The table describes the chosen variants. For example, k-NN and trees also have regression variants.

Trénink, validace a testTraining, validation and test

ČástSubsetPočetCountPoužitíPurpose
Train1077Učení parametrů i scaleruFit parameters and scalers
Validation360Volba metody, příznaků a nastaveníChoose method, features and settings
Test360Závěrečné posouzení předem vybrané variantyFinal evaluation of a previously selected configuration

Dělení je po obrázcích. V tomto příkladu neověřujeme zobecnění na nové pisatele.The split is image-based. This example does not test generalization to new writers.

Porovnání klasifikátorůComparing classifiers

Example run on the same validation split. Dummy is an added control baseline, not one of the post’s nine methods.
Vzorový běh na stejné validaci. Dummy je kontrolní základ, nikoli jedna z devíti metod příspěvku.Example run on the same validation split. Dummy is an added control baseline, not one of the post’s nine methods.

Které chyby se skrývají za jedním číslem? Prohlédněte matici záměn.Which errors does a single score hide? Inspect the confusion matrix.

Příznaky a měřítkoFeatures and feature units

Left: only the features change. Right: one pixel changes units. All runs use k-NN, k = 3.
Vlevo měníme pouze příznaky. Vpravo přepočítáme jeden pixel na jiné jednotky. Všude používáme k-NN, k = 3.Left: only the features change. Right: one pixel changes units. All runs use k-NN, k = 3.

Jeden průměr ztratí uspořádání pixelů. Škálování mění vzdálenosti, podle kterých hledáme sousedy.A single mean loses pixel layout. Scaling changes the distances used to find neighbours.

Kapacita stromu a soubory modelůTree capacity and ensembles

Actual runs of the same tree algorithm at different maximum depths.
Skutečný běh stejného stromového algoritmu s různou maximální hloubkou.Actual runs of the same tree algorithm at different maximum depths.

Random forest: randomizované stromy a průměrování. Gradient boosting: postupné přidávání modelů podle ztráty.Random forest: randomized trees and averaging. Gradient boosting: sequential additions guided by the loss.

Pro klasifikační log-loss používáme záporný gradient. Obyčejná rezidua y − ŷ odpovídají speciálnímu případu kvadratické regrese.Classification with log-loss uses the negative gradient. Ordinary residuals y − ŷ describe the special case of squared-error regression.

Shluky a třídyClusters and classes

K-means centres learned without class labels. K = 10 is supplied in advance.
Centra k-means naučená bez třídních štítků. K = 10 dodáváme předem.K-means centres learned without class labels. K = 10 is supplied in advance.

ARI na validaci: 0.490. Po přejmenování shluků: 0.490.Validation ARI: 0.490. After renaming clusters: 0.490.

Číslo shluku nemá samo o sobě význam číslice.A cluster ID does not by itself denote a digit.

Regrese a samostatný experimentRegression and an independent experiment

Synthetic regression task. Both models use linear regression with different features.
Syntetická regresní úloha. Oba modely používají lineární regresi, liší se příznaky.Synthetic regression task. Both models use linear regression with different features.

Přidání x² umožní popsat zakřivení. Regresi hodnotíme pomocí MAE a RMSE.Adding x² represents curvature. We evaluate regression with MAE and RMSE.

V závěru si zvolíte jednu klasifikační variantu podle validace a popíšete její chyby. Test otevřete až po této volbě.At the end, choose one classification configuration using validation and explain its errors. Open the test only after choosing.

Závěrečné zadáníFinal assignment