AI Dictionary › Fondamenti AI
Precisione e Richiamo (Precision-Recall)
Precision and recall are two complementary metrics for evaluating a classification model, each sensitive to a different type of error. Precision answers the question: among all the cases the model flagged as positive, how many actually were? Recall answers a different question: among all the truly positive cases, how many did the model manage to find?
Precision and recall are two complementary metrics for evaluating a classification model, each sensitive to a different type of error. Precision answers the question: among all the cases the model flagged as positive, how many actually were? Recall answers a different question: among all the truly positive cases, how many did the model manage to find?
Precision is calculated by dividing true positives by the sum of true positives and false positives: a model with high precision makes few wrong calls, but might miss many real ones. Recall is calculated by dividing true positives by the sum of true positives and false negatives: a model with high recall finds nearly all positive cases, but may do so at the cost of flagging many that were not positive. The two measures are often in tension: increasing one tends to decrease the other, and the model's decision threshold lets you shift the balance one way or the other. F1-score combines the two into a single number by computing their harmonic mean.
Whether to favor precision or recall depends on the relative cost of the two types of error: a fraud detection system often favors high recall, even at the cost of some false alarms, because missing a real fraud is more costly; a system that automatically filters content for removal often favors high precision, to avoid unfairly penalizing legitimate content. These are central metrics in information retrieval, medical diagnostics, content moderation and anomaly detection.
The two concepts originate in distinct fields that later merged: precision and recall were formalized in the information retrieval community, the search for relevant documents in large archives, as early as the 1950s and 60s, to measure how well a search system returned relevant results without missing too many. With the growth of machine learning and automatic classification, these two indicators migrated permanently into the standard vocabulary of model evaluation.
Precisione e richiamo sono due metriche complementari per valutare un modello di classificazione, ciascuna sensibile a un tipo diverso di errore. La precisione risponde alla domanda: tra tutti i casi che il modello ha segnalato come positivi, quanti lo erano davvero? Il richiamo risponde a una domanda diversa: tra tutti i casi realmente positivi, quanti il modello è riuscito a trovare?
La precisione si calcola dividendo i veri positivi per la somma di veri positivi e falsi positivi: un modello con alta precisione fa poche segnalazioni sbagliate, ma potrebbe lasciarsene sfuggire molte vere. Il richiamo si calcola dividendo i veri positivi per la somma di veri positivi e falsi negativi: un modello con alto richiamo trova quasi tutti i casi positivi, ma può farlo a costo di segnalarne molti che non lo erano. Le due misure sono spesso in tensione tra loro: aumentare l'una tende a far diminuire l'altra, e la soglia di decisione del modello permette di spostare l'equilibrio da una parte o dall'altra. L'F1-score combina le due in un unico numero, calcolandone la media armonica.
La scelta di privilegiare precisione o richiamo dipende dal costo relativo dei due tipi di errore: in un sistema antifrode si preferisce spesso un richiamo alto, anche a costo di qualche falso allarme, perché lasciarsi sfuggire una frode reale è più costoso; in un sistema che filtra automaticamente contenuti da rimuovere si preferisce spesso una precisione alta, per evitare di penalizzare ingiustamente contenuti legittimi. Sono metriche centrali in ricerca di informazioni, diagnostica medica, moderazione dei contenuti e rilevamento di anomalie.
I due concetti nascono in ambiti distinti che poi confluiscono: precisione e richiamo vengono formalizzati nella comunità dell'information retrieval, la ricerca di documenti rilevanti in grandi archivi, già dagli anni '50 e '60, per misurare quanto un sistema di ricerca restituisse risultati pertinenti senza perderne troppi. Con la crescita del machine learning e della classificazione automatica, questi due indicatori sono migrati stabilmente nel vocabolario standard della valutazione dei modelli.
From our network
Magellano GPS — Fleet Tracking Made Simple
Real-time GPS tracking, remote engine lock, fuel and CO₂ reporting for your fleet.
Visit magellanogps.com →From the Agora Intelligence blog
📱 Download the Android app (beta) iOS coming soon
Say what you mean. Get what you need.
Grace Certified — the AI coach that trains and certifies your prompt engineering — by Agora Intelligence.