{"licence":{"name":"CC BY-SA 4.0","spdx":"CC-BY-SA-4.0","url":"https://creativecommons.org/licenses/by-sa/4.0/","attribution":"Atlas, a bilingual technical dictionary (https://cmaintz.github.io/tech-atlas/)"},"id":"ai/classification","url":{"en":"https://cmaintz.github.io/tech-atlas/en/terms/ai/classification/","da":"https://cmaintz.github.io/tech-atlas/da/terms/ai/classification/"},"term":{"en":"Classification","da":"Klassifikation"},"aka":{"en":[],"da":["klassificering","classification"]},"domain":["ai"],"cluster":"ml-fundamentals","layer":"training","status":"current","summary":{"en":"Teaching a computer to sort each new case into one of a fixed set of groups, such as approve or reject, or real attack or false alarm.","da":"At lære en computer at sortere hvert nyt tilfælde i én af nogle faste grupper, fx godkend eller afvis, ægte angreb eller falsk alarm."},"body":{"formal":{"en":"A task in machine learning where the model learns from labelled examples to give each new input one label from a known, fixed list, often together with a score for how sure it is.","da":"En opgave i maskinlæring, hvor modellen lærer af mærkede eksempler at give hvert nyt input én mærkat fra en kendt, fast liste, ofte sammen med en score for, hvor sikker den er."},"plain":{"en":"Like a coin-sorting machine at a bank; every coin drops into the slot for its value, and there is no slot for a coin it has never seen.","da":"Som en møntsorteringsmaskine i banken - hver mønt falder ned i hullet for sin værdi, og der er intet hul til en mønt, den aldrig har set."},"inPractice":{"en":"At a shipping company, a model trained on thousands of invoices a bookkeeper had already sorted puts each new invoice into one of 40 cost types, such as fuel or harbour fees, and sends the unsure ones back to her.","da":"I et rederi sætter en model, der er trænet på tusindvis af fakturaer, som en bogholder allerede havde sorteret, hver ny faktura i én af 40 slags udgifter, fx brændstof eller havneafgifter, og sender de usikre tilbage til hende."},"whyItMatters":{"en":"No model sorts every case right, and wrong calls differ in cost (a missed attack usually costs more than a false alarm), so someone must decide which mistakes to accept and where a person checks.","da":"Ingen model sorterer alle tilfælde rigtigt, og forkerte afgørelser koster forskelligt - et overset angreb koster som regel mere end en falsk alarm - så nogen må beslutte, hvilke fejl man accepterer, og hvor et menneske tjekker."}},"deepDive":{"en":"Variants differ in output structure. Binary classification picks one of two classes; multiclass picks exactly one of K; multilabel assigns any subset of labels (an email can be both \"invoice\" and \"urgent\"). Hierarchical classification respects a taxonomy, and extreme classification deals with tens of thousands of labels or more. Most modern classifiers output a score vector: a logistic sigmoid for the binary case, a softmax that normalises K logits into a probability distribution for multiclass, and independent sigmoids for multilabel. Training minimises cross-entropy (log loss) between the predicted distribution and the true label.\n\nModel families range from logistic regression, naive Bayes, k-nearest neighbours, support vector machines and decision trees to ensembles such as random forests and gradient-boosted trees (XGBoost, LightGBM), which are strong defaults for tabular data, and neural networks for images, audio and text. A persistent naming trap is that logistic regression is a classification method despite its name: it regresses the log-odds, then thresholds.\n\nThe decision threshold is a policy choice, not a model property. The default of 0.5 on a binary score is arbitrary; moving it trades false positives against false negatives along the ROC curve, and the right point depends on the relative costs and the base rate. Evaluation therefore uses the confusion matrix and derived measures such as precision, recall, F1 and ROC-AUC, with precision-recall curves preferred under heavy class imbalance. Under imbalance, a fraud model that always predicts \"legitimate\" can reach 99.9 percent accuracy and catch nothing. Remedies include class weighting, resampling, cost-sensitive loss and choosing the threshold on a validation set against a business cost matrix.\n\nScores are not automatically probabilities. Modern neural networks tend to be overconfident (Guo et al., 2017), and calibration methods such as Platt scaling, isotonic regression or temperature scaling are fitted on held-out data so that \"0.8\" means right about 80 percent of the time; reliability diagrams and expected calibration error measure this. Calibration matters whenever scores drive routing, such as sending uncertain cases to a human.\n\nA closed-set classifier has no \"none of the above\" option and will confidently assign an out-of-distribution input to some known class. Open-set recognition and out-of-distribution detection add a reject option, and selective classification abstains below a confidence level. Adversarial examples exploit the same geometry by pushing inputs across a decision boundary with small perturbations. Machine-learning classification is also unrelated to information-security data classification, which labels information by confidentiality level.","da":"Varianterne adskiller sig ved outputstrukturen. Binær klassifikation vælger én af to klasser; multiklasse vælger præcis én af K; multilabel tildeler en vilkårlig delmængde af mærkater (en mail kan både være \"faktura\" og \"haster\"). Hierarkisk klassifikation respekterer en taksonomi, og ekstrem klassifikation håndterer titusindvis af mærkater eller flere. De fleste moderne klassifikatorer giver en scorevektor: en logistisk sigmoid i det binære tilfælde, en softmax, der normaliserer K logits til en sandsynlighedsfordeling, ved multiklasse og uafhængige sigmoider ved multilabel. Træningen minimerer krydsentropi (log loss) mellem den forudsagte fordeling og den sande mærkat.\n\nModelfamilierne spænder fra logistisk regression, naiv Bayes, k-nærmeste naboer, support vector machines og beslutningstræer til ensembler som random forests og gradient-boostede træer (XGBoost, LightGBM), der er stærke standardvalg til tabeldata, og neurale netværk til billeder, lyd og tekst. En sejlivet navnefælde er, at logistisk regression er en klassifikationsmetode trods navnet: Den laver regression på log-odds og anvender derefter en tærskel.\n\nBeslutningstærsklen er et politisk valg, ikke en egenskab ved modellen. Standardværdien 0,5 på en binær score er vilkårlig; flytter man den, bytter man falske positiver mod falske negativer langs ROC-kurven, og det rigtige punkt afhænger af de relative omkostninger og basisraten. Evalueringen bruger derfor forvekslingsmatricen og afledte mål som præcision, recall, F1 og ROC-AUC, mens precision-recall-kurver foretrækkes ved kraftig klasseubalance. Ved ubalance kan en svindelmodel, der altid siger \"legitim\", nå 99,9 procent nøjagtighed og fange ingenting. Modtræk er klassevægtning, resampling, omkostningsfølsomt tab og valg af tærskel på et valideringssæt ud fra en forretningsmæssig omkostningsmatrix.\n\nScorer er ikke automatisk sandsynligheder. Moderne neurale netværk er ofte overdrevent selvsikre (Guo m.fl., 2017), og kalibreringsmetoder som Platt scaling, isotonisk regression eller temperature scaling tilpasses på tilbageholdte data, så \"0,8\" betyder rigtigt i omkring 80 procent af tilfældene; reliability-diagrammer og expected calibration error måler dette. Kalibrering er vigtig, når scorer styrer videresendelse, fx når usikre sager sendes til et menneske.\n\nEn klassifikator med lukket klassemængde har ingen \"ingen af delene\"-mulighed og vil med stor sikkerhed placere et input uden for træningsfordelingen i en kendt klasse. Open-set-genkendelse og out-of-distribution-detektion tilføjer en afvisningsmulighed, og selektiv klassifikation undlader at svare under et vist sikkerhedsniveau. Adversarial examples udnytter samme geometri ved at skubbe input over en beslutningsgrænse med små ændringer. Klassifikation i maskinlæring har heller intet med dataklassifikation i informationssikkerhed at gøre, hvor information mærkes efter fortrolighedsniveau."},"edges":[{"type":"kind-of","to":"ai/supervised-learning","confidence":"high","strength":"normal"},{"type":"contrasts-with","to":"ai/regression","why":{"en":"Classification picks one group from a fixed list; regression gives a number on a scale, such as a price or a time.","da":"Klassifikation vælger én gruppe fra en fast liste; regression giver et tal på en skala, fx en pris eller en tid."},"confidence":"high","strength":"primary"},{"type":"contrasts-with","to":"ai/clustering","why":{"en":"Classification sorts into groups that people named in advance and taught with examples; clustering finds its own groups with no names given.","da":"Klassifikation sorterer i grupper, som mennesker har navngivet på forhånd og vist eksempler på; klyngeanalyse finder selv grupper uden givne navne."},"confidence":"high","strength":"primary"},{"type":"contrasts-with","to":"ai/generative-ai","why":{"en":"Classification only decides which group an input belongs to; generative AI makes new text, images or sound.","da":"Klassifikation afgør kun, hvilken gruppe et input hører til; generativ AI skaber ny tekst, nye billeder eller ny lyd."},"confidence":"high","strength":"normal"},{"type":"contrasts-with","to":"security/data-classification","why":{"en":"Same word, different job. Data classification is people labelling files by how secret they are, not a machine sorting inputs.","da":"Samme ord, forskelligt arbejde - dataklassifikation er, at mennesker mærker filer efter, hvor fortrolige de er, ikke at en maskine sorterer input."},"confidence":"high","strength":"normal"},{"type":"used-with","to":"security/false-positive","confidence":"high","strength":"normal"},{"type":"used-with","to":"ai/convolutional-neural-network","why":{"en":"CNNs are the classic tool for sorting images into categories.","da":"CNN'er er det klassiske værktøj til at sortere billeder i kategorier."},"confidence":"medium","strength":"normal"}],"depth":0,"sources":[{"title":"Russell & Norvig, Artificial Intelligence: A Modern Approach","url":"https://aima.cs.berkeley.edu/","tier":"textbook","publisher":"Pearson"},{"title":"ISO/IEC 22989:2022, Artificial intelligence concepts and terminology","url":"https://www.iso.org/standard/74296.html","tier":"standard","publisher":"ISO/IEC"},{"title":"Guo, Pleiss, Sun & Weinberger (2017), On Calibration of Modern Neural Networks","url":"https://arxiv.org/abs/1706.04599","tier":"reference","publisher":"ICML 2017"},{"title":"scikit-learn User Guide, Probability calibration","url":"https://scikit-learn.org/stable/modules/calibration.html","tier":"official-doc","publisher":"scikit-learn"}],"draft":true}