Abstract
In the field of Automated Machine Learning (AutoML), feature engineering remains a significant challenge due to the "semantic blindness" of statistical methods. This paper introduces Semantic Feature Discovery (SFD), a system that leverages domain knowledge from knowledge graphs and existing code repositories to automate the creation of interpretable, domain-specific features. By mapping data columns to high-level concepts and extracting mathematical "recipes" from millions of lines of code, SFD provides data scientists with intuitive feature recommendations that improve both model accuracy and explainability.
Introduction
Feature engineering—the process of creating new variables from raw data—is often the critical factor in model performance. While AutoML has successfully automated algorithm selection and hyperparameter tuning, it typically relies on brute-force statistical transformations. These methods often fail to capture domain-specific relationships (e.g., calculating "velocity" from "distance" and "time") and produce "black box" features that lack human-readable meaning. Semantic Feature Discovery (SFD) addresses these limitations by mining the collective wisdom of the data science community to provide AutoML with a "brain" for domain knowledge.
Methodology
The SFD system operates through two primary phases: semantic mapping and formula extraction.
Column-to-Concept Mapping
To understand the data, SFD employs two mapping strategies:
- The $C^2$ Mapper: Uses a Maximum Likelihood approach to compare column values against external knowledge bases like Wikidata and DBpedia.
- NLP-based Mapping: Analyzes column headers using synonym solvers and TF-IDF to distinguish between ambiguous terms (e.g., "Apple" as a fruit vs. a corporation).
Code Mining and Formula Extraction
Once concepts are identified, SFD searches for mathematical relationships by mining millions of Python programs. It utilizes static analysis of pandas operations, dynamic analysis with mock objects to trace execution, and NLP (using a fine-tuned RoBERTa model) to extract formulas from Jupyter Notebook text cells and LaTeX.
Key Insights
A core innovation of SFD is the shift from correlation-based discovery to concept-based discovery. By linking local data to global knowledge graphs, the system can infer missing information, such as tagging a "Country" column with "Population" data from Wikidata. Furthermore, SFD functions as a "Human-in-the-Loop" recommender system. It visualizes discovered relationships in a semantic graph, allowing users to interactively select and apply suggested features.
Results
The efficacy of SFD was demonstrated using a public COVID-19 dataset. The system successfully identified latent concepts like "Population" and "Infection Rate" even when not explicitly named in the headers. Notably, SFD suggested advanced epidemiological models for disease spread, providing a level of domain expertise typically requiring human specialists.
These features significantly improved model interpretability, as the resulting variables (e.g., "Confirmed cases per region") are inherently meaningful to stakeholders.
Limitations and Future Work
Despite its successes, SFD faces challenges in fully automating the execution of complex, fragmented code snippets. Additionally, automated formula extraction from natural language can occasionally introduce syntactic errors. Future research will focus on enhancing semantic understanding to reduce human intervention and improving the robustness of the NLP pipeline for formula retrieval.
Summary updated