0Pricing
NLP Academy · Lección

Precisión, exhaustividad y F1

Compromisos que debe comprender

Precisión, exhaustividad y F1 es una lección gratuita de NLP Academy en CoddyKit. Esta es la lección 2 de 4. Puedes leer la lección completa abajo gratuitamente — luego la practicas en el navegador con un editor de código integrado y un tutor de IA 24/7. Forma parte de la ruta de aprendizaje de NLP Academy, y tu progreso se sincroniza en la web y la app de CoddyKit. El curso de NLP Academy incluye 4 lecciones en total.

Partes de esta lección aún no han sido traducidas y se muestran en inglés.

Beyond One Number

To see past accuracy you split results into four buckets per class. From them come precision, recall, and F1, the metrics that matter.

The Positive Class

Pick the class you care about as positive, like spam or fraud. Precision and recall both describe how well you handle that class.

Precision: Trust the Alarms

Precision asks: of everything you flagged as positive, how many truly were? High precision means few false alarms.

Recall: Catch Them All

Recall asks: of all the real positives, how many did you catch? High recall means few misses slip through.

The Tug of War

Precision and recall usually trade off. Flag more items and recall rises but precision drops; flag fewer and the reverse happens.

Which One First?

Spam filters favor precision, since wrongly trashing real mail is costly. Cancer screens favor recall, since a missed case is far worse.

F1: One Balanced Score

The F1 score blends precision and recall into one number using their harmonic mean, rewarding models that do both well.

Why Harmonic Mean

F1 uses the harmonic mean so a model cannot fake it. If either precision or recall is near zero, F1 stays low too.

See Them in Python

scikit-learn prints all three at once with a tidy classification report you can scan per class.

from sklearn.metrics import classification_report
print(classification_report(y_true, y_pred))

Get One Metric Alone

You can also pull a single metric directly when you only need F1 for the positive class.

from sklearn.metrics import f1_score
f1 = f1_score(y_true, y_pred)

Pick by the Cost

No metric is best everywhere. Choose precision, recall, or F1 by the real-world cost of each mistake in your problem.

Quick Check

Match the metric to the question it answers.

Recap

Precision limits false alarms, recall limits misses, and F1 balances both. Let the cost of each error pick your metric. 📊

Preguntas frecuentes

¿La lección «Precisión, exhaustividad y F1» es gratis?

Sí — el texto completo de «Precisión, exhaustividad y F1» es gratis para leer aquí en la web. Para practicarla de forma interactiva (editor de código integrado y tutor de IA 24/7) y desbloquear el resto del curso de NLP Academy, actualiza a CoddyKit PRO. El curso de NLP Academy incluye 4 lecciones en total.

¿Qué aprenderé en «Precisión, exhaustividad y F1»?

Compromisos que debe comprender Practicas NLP Academy con código real que ejecutas directamente en el navegador, y un tutor de IA 24/7 responde tus preguntas mientras trabajas en la lección.

¿Necesito experiencia previa para empezar NLP Academy?

No se requiere experiencia previa. NLP Academy en CoddyKit está estructurado para principiantes hasta estudiantes avanzados, así que puedes empezar aquí o desde el inicio y avanzar a tu ritmo. Esta es la lección 2 de 4.

¿Cuánto tiempo toma la lección «Precisión, exhaustividad y F1»?

La mayoría de las lecciones de CoddyKit toman alrededor de 5–10 minutos. Cada una es compacta e interactiva, así que avanzas constantemente y retomas exactamente por donde dejaste en la web y la app.

¿Puedo escribir y ejecutar código en esta lección de NLP Academy?

Sí. Cada lección de NLP Academy incluye un editor de código integrado, así que escribes y ejecutas código real directamente en tu navegador y obtienes retroalimentación instantánea de IA — sin configuración local necesaria.

Todas las lecciones de este curso

  1. Por qué la precisión puede engañar
  2. Precisión, exhaustividad y F1
  3. Lectura de la matriz de confusión
  4. Validación cruzada bien hecha
← Volver a NLP Academy