fix(eda): cat_distr — intro del cuerpo reducida a términos clicables mínimos
Quita la frase descriptiva del cuerpo del capítulo ('Cada columna categórica
ocupa su propia página — ...: cardinalidad, top de categorías y gráfico de
barras. El dataset tiene N filas...'); ya vivía duplicada en la entrada de
glosario 'pagina_categorica'. El intro deja solo los términos clicables
mínimos ([[term:entropia]] · [[term:pagina_categorica]]) bajo el heading
'Entropía y cardinalidad'. El total de filas del dataset sigue disponible por
columna en la tabla de cardinalidad ('Total filas (dataset)').
This commit is contained in:
@@ -439,24 +439,17 @@ def _topk_table(cat: dict):
|
|||||||
note=note)
|
note=note)
|
||||||
|
|
||||||
|
|
||||||
def _intro_blocks(n_rows, mark_term: bool = False):
|
def _intro_blocks(mark_term: bool = False):
|
||||||
total = _fmt_int(n_rows)
|
# The full explanation of entropy AND of how each categorical page is laid out
|
||||||
# Mark the first appearance of each term as a clickable glossary jump when the
|
# lives in the GLOSARIO chapter; the chapter body keeps only the minimal
|
||||||
# terms were registered (mark_term). The full definition of the entropy term
|
# clickable terms — no descriptive prose — to avoid duplicating the glossary.
|
||||||
# AND of how each categorical page is laid out live in the GLOSARIO chapter, so
|
# The dataset row total is not repeated here: each column's cardinality table
|
||||||
# the intro only names the clickable terms instead of repeating the long
|
# already carries "Total filas (dataset)".
|
||||||
# explanation (avoids the redundancy with the glossary).
|
|
||||||
entropia = ("[[term:entropia]]entropía[[/term]]" if mark_term
|
entropia = ("[[term:entropia]]entropía[[/term]]" if mark_term
|
||||||
else "entropía")
|
else "entropía")
|
||||||
pagina = ("[[term:pagina_categorica]]cómo se organiza cada página[[/term]]"
|
pagina = ("[[term:pagina_categorica]]cómo se organiza cada página[[/term]]"
|
||||||
if mark_term else "cómo se organiza cada página")
|
if mark_term else "cómo se organiza cada página")
|
||||||
text = (
|
text = f"Términos: {entropia} · {pagina}."
|
||||||
f"Cada columna categórica ocupa su propia página — {pagina}: "
|
|
||||||
f"cardinalidad (incluida la {entropia}), top de categorías y un gráfico "
|
|
||||||
"de barras de las más comunes."
|
|
||||||
)
|
|
||||||
if n_rows is not None:
|
|
||||||
text += f" El dataset tiene {total} filas en total como referencia."
|
|
||||||
return [
|
return [
|
||||||
model.Heading(text="Entropía y cardinalidad", level=2),
|
model.Heading(text="Entropía y cardinalidad", level=2),
|
||||||
model.Markdown(text=text),
|
model.Markdown(text=text),
|
||||||
@@ -484,7 +477,7 @@ def build_cat_distr(profile: dict, ctx: dict):
|
|||||||
_TERM_ENTROPIA_DEF)
|
_TERM_ENTROPIA_DEF)
|
||||||
glossary.add(_TERM_PAGINA_KEY, _TERM_PAGINA_LABEL)
|
glossary.add(_TERM_PAGINA_KEY, _TERM_PAGINA_LABEL)
|
||||||
mark_term = True
|
mark_term = True
|
||||||
blocks = list(_intro_blocks(n_rows, mark_term=mark_term))
|
blocks = list(_intro_blocks(mark_term=mark_term))
|
||||||
|
|
||||||
# Business description + unit per column come from the LLM dictionary
|
# Business description + unit per column come from the LLM dictionary
|
||||||
# (profile['llm']['dictionary'], matched by column name); absent without
|
# (profile['llm']['dictionary'], matched by column name); absent without
|
||||||
|
|||||||
Reference in New Issue
Block a user