Download task_024/instruction.md from Lego-X/UXInteract: direct link, hf CLI and curl.
- Browser
- Download file 2.4 kB
-
https://huggingface.co/datasets/Lego-X/UXInteract/resolve/main/task_024/instruction.md
- Command line
-
hf download hf://datasets/Lego-X/UXInteract/task_024/instruction.md
-
curl -L -o instruction.md https://huggingface.co/datasets/Lego-X/UXInteract/resolve/main/task_024/instruction.md
Titanic data cleaning and survival report
Create a root solve.py that reads the current titanic.csv, creates titanic_clean.csv and report.html in the same directory, and runs offline. Compute results from the input each time; do not hard-code the bundled records or outputs.
Cleaned data
- Resolve missing age and deck values by reasonable imputation or dropping rows missing one of these fields. Keep all complete rows and do not alter observed ages, decks or other original fields. Filled ages should be finite and within the observed age range. Keep a nonempty dataset with no missing age or deck.
- Keep the original category labels for
embarkedandclassand addembarked_codeandclass_codeas nonnegative integers. Within each field, use one distinct, consistent code per category. Pandas is optional; CSV does not carry category dtypes. - Add boolean
is_alone, true exactly whensibsp + parch == 0.
Report
Summarize cleaning and the final row count. Compute survivors, total and survival rate separately for each sex category and each class category from the final cleaned CSV. In <table id="survival-rates">, display the category, counts and rate for each group. For each data row provide data-group (sex or class), data-category (original label), data-survived, data-total and data-rate (fraction from 0 to 1).
Include a visible <svg id="survival-chart"> bar chart. Use exactly one <rect> per category with numeric width and height and matching data-group, data-category and data-rate; reserve rectangles in this SVG for the bars. Scale the bar width or height proportionally to the rate on a shared zero-origin scale. Display rates with sufficient precision, such as three fractional decimals or one decimal place for percentages. Print readable cleaning and report progress, for example, [1/3] Cleaning age and deck or percentage progress with named stages.
Acceptance Checklist
- Running the script on the current or changed input preserves complete records and unchanged source fields, resolves missing age/deck, and computes reproducible codes and
is_alone. - The visible table and chart reflect the cleaned output, for every sex and class category. Visible counts and rates agree with metadata and bar lengths.
- Both outputs are regenerated and the script visibly reports cleaning and reporting progress.