Back to Feed
Agents / Benchmarks & Evals

Automated Feature Engineering for Heart Failure

Original: Tracing the Heart: An Evidence-Linked Pipeline for Heart-Failure Feature Engineering

Listen to the summary

Uses a voice available on your device

Audio options
On this page 5 sections
Related concepts 2 concepts

Key Takeaways

  • The pipeline processes nine EHR source tables into a single, deduplicated patient-level row with 132 structured columns.
  • The approach significantly improved classification performance, with HFrEF accuracy rising from 0.776 to 0.896 and HFpEF accuracy from 0.752 to 0.809.
  • An LLM-based audit of the generated features scored 81.5% in a construct-validity assessment.
  • The system uses XGBoost classifiers for downstream binary phenotyping tasks.

Summary & Methodology Analysis

The pipeline utilizes a multi-agent system to automate feature engineering from clinical data. It consolidates nine disparate EHR tables into a unified schema, ensuring each of the 500 patients is represented by exactly one row containing 132 structured columns. The workflow includes a cleaning stage, deduplication using event keys, and temporal aggregation of data before generating composite features based on a versioned clinical rubric. The system incorporates an LLM auditor, specifically Qwen 2.5-1.5B-Instruct, which audits candidate rows to enforce structural integrity and rubric compliance. This step allows for controlled updates to whitelisted fields, ensuring that generated features remain consistent and traceable. Performance is evaluated using Claude Opus 4.8 as an independent background agent to assess the methodology.

Interactive System Flowchart

Click diagram to expand and zoom

Illustrative Implementation

A short sketch of the paper's core idea, not the authors' own code.

# Illustrative sketch (not from the paper)
import pandas as pd, torch

def pipeline(source_tables, target_features):
    # 1. Achievability
    unsupported = [f for f in target_features if f not in source_tables]
    # 2‑4. Standardize, deduplicate, aggregate per table
    summaries = []
    for name, df in source_tables.items():
        df = df.applymap(lambda x: None if pd.isna(x) or str(x).strip().lower() in ('', 'nan') else str(x).strip())
        df.columns = [c.upper() for c in df.columns]
        df = df.drop_duplicates(subset=['PATIENT_ID', 'EVENT_ID'])
        agg = df.groupby('PATIENT_ID').agg(event_cnt=('EVENT_ID', 'count'), first_ts=('TIMESTAMP', 'min'), last_ts=('TIMESTAMP', 'max')).reset_index()
        summaries.append(agg)
    # 5. Merge summaries
    from functools import reduce
    patient_df = reduce(lambda l, r: pd.merge(l, r, on='PATIENT_ID', how='outer'), summaries)
    # 6. Scoring rubric
    patient_df['COMPOSITE'] = patient_df['event_cnt'] * 0.1
    patient_df['EVIDENCE'] = 'rubric_v1'
    # 7. LLM audit (placeholder)
    patient_df['COMPOSITE'] = torch.tensor(patient_df['COMPOSITE'].values, dtype=torch.float32)
    # 8. Integrity check
    assert patient_df['COMPOSITE'].ge(0).all()
    return patient_df, unsupported

Cross-Examination & FAQs

A deeper dive clarifying mechanics, constraints, and baseline evaluations.

Q1. What is the core contribution of this work?

The authors created a pipeline that automates the transformation of fragmented EHR data into evidence-backed, structured features for heart failure phenotyping.

Q2. Does this improve classification performance?

Yes, it increased accuracy for HFrEF classification from 0.776 to 0.896 and for HFpEF from 0.752 to 0.809.

Q3. How did the researchers validate the quality of the features?

They used an LLM-based rubric assessment that measured evidence support and methodological soundness, achieving an overall normalized score of 81.5%.

Q4. What models are used in the pipeline?

The system utilizes Qwen 2.5-1.5B-Instruct for auditing candidate rows and Claude Opus 4.8 for evaluating the methodology, with XGBoost classifiers used for the final phenotyping tasks.

Q5. How was the dataset constructed?

The study used 500 dummy heart-failure patient records assembled from nine EHR source tables.

Q6. What are the primary limitations of this study?

The evaluation was restricted to a single-institution cohort of 500 patients, lacked external clinical validation, and did not assess prospective clinical outcomes or patient impacts.

Q7. Are the results comparable to general disease detection?

No, the classification was performed against phenotype-unknown patients rather than non-HF controls, meaning the results reflect phenotype characterization within an existing heart failure cohort.

Q8. Does the pipeline handle all clinical language equally?

No, the extraction of comorbidity and behavioral features relies on regular-expression matching, which may miss institution-specific or atypical language.

Q9. Was the entire cohort reviewed by clinicians?

No, clinician review was limited to the extraction rubric and representative outputs rather than the full cohort.

Flag an issue

What is wrong with this summary?

What is wrong?