[FAQ] HW5 (2026): predict_proba differs — locked env, artifact checksum, normalize_record
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 1/5
- Tiempo estimado
- Menos de una hora
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Documentación
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- docker, numpy, python, scikit-learn
Línea de trabajo
The issue already provides a full FAQ answer, including commands and references to cohorts/2026/homework/05-deployment/homework.md and model.py. Check whether that guidance matches the frozen homework release and API behavior; done means the answer is accurate and resolves the reported probability mismatch. The FAQ checklist says the answer is already complete, so this is not an evident first contribution.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Course
machine-learning-zoomcamp
Question
Homework 5 (2026): Why do my predict_proba results differ from the expected options, even though my code runs without errors?
Answer
Fix first — make sure you run the frozen 2026 release exactly as checked in, without retraining or regenerating anything:
-
Verify the artifact before using it (from
cohorts/2026/homework/05-deployment/):sha256sum pipeline.binIt must match the hash in
homework.md. If it differs, re-download the directory instead of debugging numbers. -
Use the locked environment, don't regenerate it:
uv sync --lockedDo not run
uv syncwithout--lockedand do not regenerateuv.lock. A different scikit-learn/numpy build can shift probabilities. -
Normalize the lead exactly like the API does (
model.py):import pickle from model import normalize_record with open("pipeline.bin", "rb") as f: pipeline = pickle.load(f) record = normalize_record(lead) # training-set medians, "NA" for missing categoricals prob = float(pipeline.predict_proba([record])[0, 1])Hand-rolling imputation (e.g.
fillna(0)) instead ofnormalize_recordchanges the vector and the probability. -
Serve and containerize without edits:
uv run uvicorn predict:app --host 0.0.0.0 --port 9696 docker build -t zoomcamp-model:2026-hw5 . docker run --rm -p 9696:9696 zoomcamp-model:2026-hw5 curl -s http://localhost:9696/healthFree port 9696 first (stop any local uvicorn). The container must return the same inference as local; if it doesn't, the artifact or lockfile inside the build context differs.
Reference: cohorts/2026/homework/05-deployment/homework.md (frozen lead-scoring release, DictVectorizer + LogisticRegression(solver="liblinear", C=1.0)).
Checklist
- I have searched existing FAQs and this question is not already answered
- The answer provides accurate, helpful information
- I have included any relevant code examples or links
- Lenguaje dominante
- Python
- Estrellas
- 7
- Forks
- 20
- Merge medio
- 7 d 9 h
- PR fusionados (30 d)
- 8
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de DataTalksClub/faq
-
[FAQ]Posiblemente ocupada @github-actions la tomó hace 1 día. Abiertofaq-proposal
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
DataTalksClub/faq#521 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
DataTalksClub/faq#518 ·
Los mantenedores suelen responder en 2 días
-
[FAQ] Commit ID for ProjectsPosiblemente ocupada @github-actions la tomó hace 3 días. Abiertofaq-proposal
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
DataTalksClub/faq#503 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
DataTalksClub/faq#486 ·
Los mantenedores suelen responder en 2 días
-
[FAQ] Can I deploy my final project without a credit card using separate frontend, API, and database services?Posiblemente ocupada @github-actions la tomó hace 1 día. Abiertofaq-proposal
Dificultad 1/5 Menos de una hora Aptitud para principiantes 30/100
DataTalksClub/faq#519 · 1 comentario ·
Los mantenedores suelen responder en 2 días
Todos los issues de DataTalksClub/faq
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
[oblt-aw][autodoc] Document obs-aw-automerge contract and fix automerge doc inconsistenciesPosiblemente ocupada @github-actions la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
admission-deferred priority: medium status: ready work-class: scoped
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
melodic-software/claude-code-plugins#10887 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
backend bug good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
PoCInnovation/Distribox#255 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
google/langextract#598 ·
Los mantenedores suelen responder en 1 día