Back to your course / CR3-S05
Computing and Robotics · 3.º ESO · Learn
Artificial intelligence and thoughtful use of data
An impressive result needs interpretable data and evaluation that does not hide errors. Follow an authorised table from its HTML structure to a chart and a simple classifier.
Your mission
In pairs, audit data and a simple model: extract a table from supplied local HTML, retain provenance, clean without inventing observations and evaluate a learned threshold on separate data. Integrate the AlphaGo analysis and submit A01 and A02 within the eleven sessions.

Read the explanation, study the diagram and try the activity in each section. You can choose another version at any time.
Your tools
Use Google Docs for written explanations and diagrams.net for diagrams. Save the editable file as well as the evidence requested in each task.
5.1. Provenance and data lifecycle
Learn · theory and practice
Data are captured, documented, stored, transformed and used for a purpose. They are then retained or deleted according to that purpose and usage conditions. Metadata describe origin, authorship, date, fields, units, licence or permission and transformations. An identifier distinguishes an observation but does not itself explain how it was obtained or what it represents. A context-free table may contain readable numbers yet remain impossible to interpret correctly.
The audit uses supplied, reusable teaching HTML stored locally, without collecting people’s data or extracting external pages. An observation code is enough to follow a row; adding classmates’ names introduces unnecessary information. The data dictionary defines every field, type, scale and permitted missing value. Traceability connects original, export, cleaned version, chart and model. Keeping everything indefinitely is not an automatic choice either: state which files enable reproduction and when unnecessary copies will be removed. This policy belongs to the design before training.
- Source
- Metadata
- Transformations and use
- Retention or deletion
Two teams receive the same row and copy it into different files. Values match, but one records source file, date and cleaning decision while the other retains only the chart. If the unit becomes uncertain, the first record supports returning to the source and checking it. Matching numbers does not mean preserving the same ability to review them.

- In Google Docs, create the dictionary and provenance sheet for lecturas_autorizadas.html with purpose, date, scale and usage conditions.
- In diagrams.net, follow a row from source to retention or deletion, identifying files and planned transformations.
What information does a chart lose without a link to its source file and unit?
5.2. Reading HTML structure
Learn · theory and practice
HTML organises content through tags. In a table, table delimits the whole structure, tr represents a row, th a header cell and td a data cell. Appearance alone does not identify this structure: styles can change its appearance without changing data, and different structures can look similar. The extractor needs to recognise the target table and check headers, column count and content correspondence. Finding a table completes only the first step because it may still be a different table from the intended one.
HTMLParser reports events as it encounters opening tags, text and closing tags. To turn them into a data table, the program retains state: whether it is inside the selected table, which row it is collecting and which cell is active. This context determines where each fragment belongs. A cell may contain several pieces of text, for example when another tag occurs inside it; these are joined before its contents are stored. Even when the result contains digits, it remains text. Locating the cell does not yet establish that all its contents have been preserved.
How each row is completed also affects extraction. If it is stored only when the next row begins, the last row can be lost because no further row opening follows. Checking closing events, counts and identifiers reveals that loss and supports comparison with the source. HTMLParser does not automatically validate the document’s complete correctness. This work uses a local file with a known structure: explaining that condition clarifies what the extractor checks and why it is not presented as a universal solution for every page.
- Table tag
- Active row
- Cell fragments
- Complete row
A cell contains a number and a word inside an emphasis tag. The parser may deliver text in several events. If the program keeps only the last fragment, extraction is incomplete even though the CSV contains a cell. Following opening, fragments and closing checks the accumulated content and separates cell count from data fidelity.
- Open the local HTML in a browser and its code in Thonny; locate table lecturas, headers and three rows including the last.
- In Google Docs, trace events for one cell and row and predict when each should be added to the extractor’s collection.
Why does matching column count not prove that content was extracted correctly?
5.3. Extracting with a contract and permission
Learn · theory and practice
Scraping extracts information from a representation such as HTML; an API provides a defined interface for exchanging data. The former depends on tags and structure; the latter uses a contract of fields, operations and responses. Neither automatically guarantees quality, permission or freedom from changes. A public page does not automatically permit every collection and reuse. This course processes only the supplied local file without automated requests to external sites.
CSV preserves rows and fields using separators, quoting and encoding that must be interpreted compatibly. Python’s csv library manages details that manually joining commas can break. The format neither defines meaning nor adds units: that information remains in the dictionary. The extractor checks the intended table, headers and columns before exporting. Then compare source and result, including problematic and final records. Opening CSV without errors only proves that a tool could interpret it, not that every field corresponds to the correct observation.
- Authorised source
- Structure or contract
- Extraction
- Verified CSV
An authorised field contains a description with a comma. An exporter simply joining text with commas without applying format rules can create an extra column. The representation introduces the fault even though the source content is correct. Writing through csv and reading back for verification preserves the field and detects discrepancies before charting or training.
- Run extraer_tabla.py in Thonny on the authorised local file and open the CSV in Google Sheets with the intended encoding and separator.
- In Google Docs, compare headers, count and records 1, 4 and last, and explain what would change with an API rather than HTML.
What permission covers the local file, and why does it not extend to every website?
5.4. Cleaning without inventing evidence
Learn · theory and practice
Cleaning prepares data for a purpose through justified, recorded decisions. Preserve the original and work on a copy. An exact duplicate of the same observation may be removed after checking origin; independent observations with equal values are not necessarily duplicates. A repeated identifier with different content requires investigation, not arbitrary deletion. A change log reconstructs inclusions, exclusions and conversions.
A missing value is not zero: replacing it invents an observation and changes averages or learning. If excluded from a calculation, the denominator must reflect available values. Check numeric format, range and unit separately; successful conversion does not guarantee domain membership. A Google Sheets chart needs title, axes, scale or unit and coherent data selection. A bar or point summarises a record but proves neither its origin nor causality. Compare the chart with the cleaned table and explain excluded rows so visualisation does not hide previous decisions.
- Preserved original
- Documented decision
- Cleaned table
- Interpretable chart
A fictional table has five observations, one without a reading. Averaging four available values describes something different from averaging five after adding zero. The second calculation changes the evidence before interpretation. The report must state how many values are used and how missingness is handled so another person can reproduce and discuss the decision.
- In Google Sheets, preserve the original and create a cleaned copy; review exact duplicate, missing value, types and scale, logging every decision in Google Docs.
- Build a chart with title, axes and scale or unit; check three points against the cleaned table and state exclusions and any average’s denominator.
Why might two rows with the same value need to be retained?
5.5. Learning a simple boundary
Learn · theory and practice
A classifier assigns a class from input data. This unit’s model uses a reading and a boundary: below the threshold it predicts aviso, otherwise normal. Learning selects that threshold using examples with known labels rather than writing each observation’s answer. Labels come from the dataset’s teaching criterion, not an automatically discovered truth about the classroom.
The program compares candidates between training values and counts matches with labels. It retains the selected candidate and applies the rule to new values without readjusting during prediction. If candidates tie, document the program’s policy; data leaving an example-free gap cannot establish a unique boundary. Equality depends on the operator and must be tested. This model makes each decision inspectable but explains neither physical causes nor all AI. The approved object alternative retains provenance, labels and independent testing; it does not automatically replace the local extraction required by the project.
- Labelled examples
- Candidate comparison
- Selected threshold
- New prediction
In a test different from the project, one class’s training readings are below 25 and the other’s above 55. Several intermediate boundaries can classify those examples correctly yet disagree on a later reading inside the gap. Good fit does not establish a unique natural rule: we need to know candidate selection and test new data.
AI: What is Machine Learning?
Watch in short sections. Connect one explanation with the diagram and try the example in this section. The written theory lets you complete the activity without playing the video.
The video keeps its original spoken language. Use the captions available in the player if they help.
- In Thonny, read and run modelo_umbral.py; locate candidates, label use, threshold selection and prediction without readjustment.
- In Google Docs, record training data, selected threshold, operator, tie policy and a boundary prediction before execution.
Which stage learns from labels, and which applies an already selected model?
5.6. Separating sets and counting errors
Learn · theory and practice
Training selects the threshold from known examples; evaluation checks how it works on observations that did not participate in that choice. Training and test data are therefore separated before fitting. Independence requires checking identifiers and provenance: different IDs can refer to copies of the same example or nearly identical captures. When that information appears in both sets, results can look better without establishing equivalent ability on new data. This is information leakage, which changes what the test allows us to conclude.
Independence also depends on how results are used. If we repeatedly inspect the test to choose changes, those examples already influence the design. The record must distinguish the set used for improvement from a new evaluation. In the latter, the matrix crosses reference class with prediction: a false alert predicts aviso when the reference is normal; an omission predicts normal when aviso was required. Separating these errors reveals which decisions the model gets wrong and allows their consequences to be considered in relation to use.
The percentage of correct predictions is obtained by dividing correct predictions by the total number of evaluated cases and expressing the ratio as a percentage; an explicit denominator is necessary. An overall figure can hide errors in an infrequent class. Per-class results, sample size and representativeness complete the interpretation: getting every case in a small sample right does not guarantee performance in other contexts. Conclusions must match the data and procedure actually used. This school exercise supports neither medical decisions nor important decisions about people.
- Separation by origin
- Fitting
- Reserved test
- Per-class errors
A fictional set has twelve tests: six alerts and six normal cases. The model detects five alerts and correctly classifies four normal cases. There are nine correct results out of twelve, one omission and two false alerts. The total summarises performance, but error types guide different questions. Before improvement, preserve this record and reserve new cases rather than presenting debugging as independent evaluation.
AI: Training Data & Bias
Watch in short sections. Connect one explanation with the diagram and try the example in this section. The written theory lets you complete the activity without playing the video.
The video keeps its original spoken language. Use the captions available in the player if they help.
- In Thonny and Google Docs, check IDs and provenance in entrenamiento.csv and prueba.csv and document possible copies despite different names.
- Build the matrix in Google Sheets with reference, prediction, counts and denominators; propose an improvement and reserve new tests before fitting it.
Why does renaming an example not make it a new test?
5.7. Checking a story about AI
Learn · theory and practice
AlphaGo combines networks guiding decisions and evaluating positions with search in a game with defined rules. The original research used expert games and learning through self-play. This procedure differs from our threshold practice: it supports comparing task, data, objective and evaluation without confusing mechanisms. Success at Go establishes neither general capability for every problem nor human intention or understanding.
The audiovisual block takes 3.5 of the eleven sessions: 0.25 preparation, 2.25 authorised viewing or a coherent teacher selection and 1 comparison and transfer. Before viewing, formulate a prediction and a question; during it, describe three observations without transcribing dialogue; afterwards, separate observation, interpretation and a checkable claim. A technical source can confirm a claim or leave it unresolved when evidence is insufficient. The written alternative addresses the same problem through sequence descriptions and guided reading, without requiring viewing outside class. Turn the conclusion into an A01 requirement and a testable application in A02.
- Observation
- Bounded claim
- Source and checking
- Testable requirement
A scene shows an unexpected move and someone concludes the system could solve any creative problem. The observation concerns one move; the conclusion expands task and context without equivalent testing. Checking asks which objective was evaluated and with what results. Our audit can adopt a precise rule: limit each claim to the dataset and procedure actually tested.
- In Google Docs, complete the before, during and after analysis of AlphaGo or its written alternative and check a claim against the linked original research.
- Formulate an evaluation requirement for A01 and a test for A02 showing your model’s generalisation limit.
What evidence supports moving from a scene to a performance claim?
5.8. An auditable pipeline
Learn · theory and practice
An audit connects stages to check how a result was obtained. A row must be traceable from HTML to CSV, cleaning, chart, assigned set, prediction and final retention decision. Each connection needs an appropriate test. A plausible chart may not reveal a lost last row; an error-free model run does not guarantee independent separation. Distinguish extraction integrity, dataset quality and classifier performance.
The laboratory uses extraer_tabla.py and modelo_umbral.py in Thonny with local files and preserved versions. A01 includes executed extraction, comparison of a row and initial evaluation with separate training and test data; it is not just a future plan. A02 extends comparison to records 1, 4 and last, documented cleaning, chart, matrix and verified improvement with new tests. Analyse a possible selection or coverage bias and explain which conclusions it limits. Each partner follows a datum, predicts a boundary and explains a change. Editable files and the log support reviewing causes without inventing data or claiming general capabilities.
- Authorised HTML
- Verified CSV
- Data and split
- Evaluated model
- Traceable conclusion
The chart looks correct, but CSV has one fewer row than HTML. Before interpreting the model, compare counts and identifiers to locate the loss. Correcting extraction can change cleaning, splitting and evaluation, so repeat affected stages. The audit preserves the chain of changes and avoids attributing to learning a problem that occurred before training.
- In Google Docs, audit one row and relate each file to source, changes, set, prediction and retention or deletion.
- In Thonny and Google Sheets, reproduce an extraction or cleaning incident in a copy and check its effect on charting and evaluation before repairing it.
Why does improving the model not automatically repair a row lost by extraction?
Your project and submissions
A01 · Design the solution
- In Google Docs, formulate question, purpose, provenance and dictionary; in diagrams.net, show one row’s capture, storage, cleaning, use and retention or deletion.
- Run extraction from reusable local HTML in Thonny; document table, tags, events, columns and comparison of cells, headers and last row with CSV.
- Plan cleaning and splitting by origin and IDs; execute an initial split, threshold training and test, record classes and predict exact-boundary behaviour.
- Integrate the checked AlphaGo or written-alternative conclusion as a testable requirement and explain success and what the sample cannot establish.
- Save CR3-S05_modelo_A01_Apellidos with completed microtests, sources, usage conditions, expected results and both partners’ individual explanations.
What to submit
- Dictionary, provenance, purpose and row trace with planned final destination.
- Authorised HTML, executed extractor, CSV and structure and content comparison.
- Initial split, training and test, boundary case, audiovisual conclusion and individual contributions.
A02 · Audit of data and a simple model
- In Thonny, extract and compare records 1, 4 and last, headers and count; preserve HTML, extractor and original CSV without overwriting.
- In Google Sheets and Google Docs, clean a copy with documented duplicate and missing value, check domain and chart title, axes and scale; state denominators.
- Verify splitting by IDs and origin, train the threshold and test separately; present reference/prediction matrix, correct results, false alerts and omissions by class.
- Analyse a bias, document an incident and improvement with new tests, and apply the AlphaGo-derived requirement; do not present a tuning set as fresh evaluation.
- Save CR3-S05_modelo_A02_Apellidos with editable files, dictionary, versions, sources and retention/deletion policy; each partner explains one row, a boundary and a modification.
What to submit
- Local HTML, extractor, original and cleaned CSV and change log.
- Chart, separate sets, model code, matrix with denominators and verified improvement.
- Row audit, bias and limitations, applied audiovisual conclusion, retention and individual explanation.
Before you submit
- Learner descriptors; these are not new official criteria.
- I can follow a row from HTML to result and justify every transformation.
- I can distinguish training, tuning using a test and evaluating with new data.
- I can interpret per-class errors, recognise bias and limit conclusions to the evidence.
Templates and files
Open the blank A01 or A02 template and make your own copy in Google Docs. Keep the editable file from your project platform as well.
These reusable templates help you organise your work. Follow the specific instructions and evidence list for this unit; remove fields that do not apply. The blank master is read-only. Keep your answers private and share them only as your teacher instructs.
A01 · Design the solution
Make your own copy in Google Docs · View the blank template
- Dictionary, provenance, purpose and row trace with planned final destination.
- Authorised HTML, executed extractor, CSV and structure and content comparison.
- Initial split, training and test, boundary case, audiovisual conclusion and individual contributions.
A02 · Audit of data and a simple model
Make your own copy in Google Docs · View the blank template
- Local HTML, extractor, original and cleaned CSV and change log.
- Chart, separate sets, model code, matrix with denominators and verified improvement.
- Row audit, bias and limitations, applied audiovisual conclusion, retention and individual explanation.
Classroom rubrics
The classroom assessment reference is preserved below in its original Spanish. Use the checklist above to prepare your work and ask your teacher about any descriptor you need to clarify.
Consultar la rúbrica de A01
Diseño y microprueba
CYR.3.4.1 Metadatos y ciclo de vida de los registros
Conocer la naturaleza de los distintos tipos de metadatos generados hoy en día, siendo capaces de entender su ciclo de vida, empleando a su vez un espíritu crítico y científico.
Evidencia. Diccionario y seguimiento de una fila desde origen hasta conservación y eliminación.
| Banda | Desempeño observable |
|---|---|
| 1–2,9 | Confunde valor e identificador o no puede reconstruir de dónde salió un registro. |
| 3–4,9 | Identifica metadatos, pero no relaciona generación, transformación, almacenamiento y uso. |
| 5–6,9 | Distingue valor, identificador, procedencia y fecha y sigue una fila por recogida, limpieza, almacenamiento, uso y eliminación prevista con una prueba de taller. |
| 7–8,9 | Compara original y dato transformado y justifica una conservación o eliminación según la finalidad. |
| 9–10,0 | Analiza qué se pierde al retirar un metadato y propone conservar trazabilidad sin recoger información innecesaria. |
CYR.3.4.2 Umbral aprendido y evaluación independiente
Comprender los principios básicos de funcionamiento de los agentes inteligentes y de las técnicas de aprendizaje automático, con objeto de aplicarlos para la resolución de situaciones mediante la Inteligencia Artificial.
Evidencia. Entrenamiento y prueba inicial del modelo con separación de registros y clases.
| Banda | Desempeño observable |
|---|---|
| 1–2,9 | No distingue regla ajustada y dato de prueba o afirma comprensión general por acertar ejemplos conocidos. |
| 3–4,9 | Entrena, pero mezcla conjuntos o no define el significado de las clases y los errores. |
| 5–6,9 | Explica cómo los ejemplos permiten ajustar el umbral, ejecuta entrenamiento y prueba separados y predice un caso de frontera. |
| 7–8,9 | Analiza resultados por clase y plantea una mejora sin reutilizar como examen final los casos usados para corregir. |
| 9–10,0 | Diseña una prueba de cambio de contexto y anticipa qué tipo de error sería relevante para la finalidad. |
CYR.3.4.3 Extracción HTML reproducible y límites del scraping
Comprender los principios de funcionamiento del Data Scraping.
Evidencia. Extractor local ejecutado, comparación de una fila y contrato de columnas y uso.
| Banda | Desempeño observable |
|---|---|
| 1–2,9 | Confunde extracción de HTML y API o no identifica las celdas de origen. |
| 3–4,9 | Extrae una fila, pero pierde la última o duplica registros y no contrasta el resultado. |
| 5–6,9 | Explica eventos y estructura HTML, ejecuta extracción local autorizada y contrasta celdas, cabeceras y última fila con el CSV generado. |
| 7–8,9 | Detecta una ausencia o duplicado y corrige la extracción conservando registro del cambio. |
| 9–10,0 | Prueba otra estructura preparada y justifica los cambios y límites técnicos y de uso sin hacer peticiones a sitios ajenos. |
Consultar la rúbrica de A02
Producto pruebas y mejora
CYR.3.4.1 Metadatos y ciclo de vida de los registros
Conocer la naturaleza de los distintos tipos de metadatos generados hoy en día, siendo capaces de entender su ciclo de vida, empleando a su vez un espíritu crítico y científico.
Evidencia. Auditoría con diccionario, original y limpio, procedencia y política de conservación.
| Banda | Desempeño observable |
|---|---|
| 1–2,9 | Los datos carecen de procedencia o presenta inferencias sin relación con el registro original. |
| 3–4,9 | Incluye diccionario, pero faltan transformaciones o destino de conservación y eliminación. |
| 5–6,9 | Explica metadatos y ciclo de vida, documenta cambios y conservación o eliminación y distingue dato observado e interpretación. |
| 7–8,9 | Contrasta un registro entre etapas y revisa una decisión que afectaba trazabilidad o minimización. |
| 9–10,0 | Evalúa una política alternativa de metadatos justificando utilidad, límites y consecuencias de su conservación o pérdida. |
CYR.3.4.2 Umbral aprendido y evaluación independiente
Comprender los principios básicos de funcionamiento de los agentes inteligentes y de las técnicas de aprendizaje automático, con objeto de aplicarlos para la resolución de situaciones mediante la Inteligencia Artificial.
Evidencia. Modelo, partición verificable, matriz de resultados y mejora contrastada.
| Banda | Desempeño observable |
|---|---|
| 1–2,9 | El resultado no procede del modelo entregado o la prueba reproduce entrenamiento sin reconocerlo. |
| 3–4,9 | Calcula acierto global, pero no distingue errores por clase o no explica el umbral. |
| 5–6,9 | Entrena y prueba el modelo, explica umbral e igualdad y presenta resultados por clase y límites de muestra. |
| 7–8,9 | Contrasta una mejora con prueba nueva y diferencia falsas alertas y omisiones según la finalidad. |
| 9–10,0 | Justifica uso o revisión del modelo en un contexto nuevo con evidencia, límites de independencia y consecuencias de sus errores. |
CYR.3.4.3 Extracción HTML reproducible y límites del scraping
Comprender los principios de funcionamiento del Data Scraping.
Evidencia. HTML local, extractor, CSV y pruebas de última fila duplicados y ausencias.
| Banda | Desempeño observable |
|---|---|
| 1–2,9 | El CSV no corresponde a la fuente o no distingue extraer y consumir una API. |
| 3–4,9 | Extrae datos, pero no valida cabeceras o conserva errores de cierre o duplicado sin explicación. |
| 5–6,9 | Extrae y contrasta datos del HTML local, explica parser y CSV y comprueba última fila, ausencias y duplicados respetando el uso autorizado. |
| 7–8,9 | Repara un fallo de estructura o cierre y repite recuento e identificadores sin sobrescribir el original. |
| 9–10,0 | Adapta el extractor a una variación preparada y explica por qué la solución no permite asumir cualquier estructura ni permiso de extracción. |
Videos, resources and sources
teachable machine
Watch in short sections. Connect one explanation with the diagram and try the example in this section. The written theory lets you complete the activity without playing the video.
The video keeps its original spoken language. Use the captions available in the player if they help.
Tutorial LibreOffice Calc – 30/34 Gráficos (II): Diferentes tipos de gráfico y su personalización.
This optional video uses LibreOffice Calc. The chart concepts also apply to Sheets, but the menus are different. Complete this unit’s tasks in Google Sheets.
Watch in short sections. Connect one explanation with the diagram and try the example in this section. The written theory lets you complete the activity without playing the video.
The video keeps its original spoken language. Use the captions available in the player if they help.
Keep learning
- Python: html.parser
- Python: csv
- Google: Datasets, dividing the original dataset
- Google: Accuracy, recall, precision and related metrics
- Google Research: Mastering the game of Go with deep neural networks and tree search
- AEPD: Guía de protección de datos por defecto
Editorial revision: October 2026.
