Inferensys

Glossary

Feature Engineering

Feature engineering is the process of creating new input features or transforming existing ones from raw data to improve the performance of machine learning models.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
ENTITY RESOLUTION

What is Feature Engineering?

Feature engineering is the foundational data preparation process for entity resolution, transforming raw attributes into informative signals that enable accurate matching.

Feature engineering is the process of creating new input variables (features) or transforming existing ones from raw data to improve the performance of a machine learning model. In entity resolution, this involves extracting and refining attributes—like names, addresses, and dates—into formats that highlight similarities and differences between records. Effective features are the primary determinant of a model's ability to distinguish between distinct entities and correctly link duplicates, making this a critical, domain-specific task for data scientists and engineers.

The process includes techniques such as normalization (standardizing formats), parsing (splitting composite fields), encoding (creating categorical or phonetic representations), and deriving similarity metrics (like Jaccard or Levenshtein scores). For probabilistic matching models like the Fellegi-Sunter model, the quality of these engineered features directly dictates the accuracy of calculated match weights. Ultimately, feature engineering bridges raw, messy data and the algorithmic models designed to find connections within it.

ENTITY RESOLUTION

Core Feature Engineering Techniques

Feature engineering is the systematic process of creating, selecting, and transforming raw data attributes into informative signals that improve the accuracy and efficiency of entity resolution models.

01

Similarity Features

These are the foundational numeric measures that quantify the likeness between two candidate records. They are the direct inputs to matching models.

  • String Similarity: Metrics like Levenshtein distance, Jaccard similarity (for token sets), and cosine similarity (for text embeddings) compare names, addresses, and other text fields.
  • Numeric Similarity: Measures like absolute difference or relative difference for dates (e.g., birth dates), amounts, or IDs.
  • Categorical Similarity: Exact match, partial match, or hierarchical match for fields like product categories or industry codes.
02

Derived & Contextual Features

Creating new attributes from raw data provides stronger, more abstract signals for disambiguation.

  • Phonetic Encoding: Converting strings to codes based on pronunciation (e.g., Soundex, Metaphone) enables matching of 'Jon' and 'John'.
  • Temporal Features: Calculating age from birth date, duration between events, or extracting day-of-week from timestamps.
  • Geospatial Features: Computing the haversine distance between addresses or mapping to administrative regions (city, state).
  • Composite Features: Creating features from the interaction of others, like a flag for 'name matches but cities are >100 miles apart'.
03

Blocking Keys

Not a model feature per se, but a critical pre-computation. Blocking keys are hashes or signatures created to place potentially matching records into the same candidate set, drastically reducing pairwise comparisons.

  • Purpose: Transform high-dimensional comparison problem into manageable sub-problems.
  • Common Techniques: Using the first N letters of a name, a phonetic code, or a geographic hash. Locality-Sensitive Hashing (LSH) is an advanced method for creating keys that preserve similarity.
  • Trade-off: Overly restrictive keys miss true matches (low recall); overly permissive keys create bloated candidate sets (low efficiency).
04

Graph-Based Features

When resolving entities within a network or knowledge graph, features can be extracted from the relational structure.

  • Neighborhood Features: Attributes of connected entities, such as 'the average transaction amount of connected accounts'.
  • Path Features: The existence or length of a path between two candidate entities in a pre-existing graph.
  • Community Features: Whether two records belong to the same detected cluster or community within a larger network. These features help resolve entities using collective relationships, not just attribute similarity.
05

Feature Selection & Importance

After creating a broad set of candidate features, identifying the most informative ones is crucial for model performance and interpretability.

  • Methods: Techniques like correlation analysis, recursive feature elimination, or using built-in importance scores from tree-based models (e.g., Gini importance from Random Forest).
  • Goal: Remove redundant or noisy features to reduce overfitting, speed up training, and simplify the model.
  • Outcome: A pared-down set of features that provides the highest predictive power for distinguishing matches from non-matches.
06

Handling Missing & Noisy Data

Real-world data is imperfect. Engineering features robust to missing values and errors is a core challenge.

  • Imputation Strategies: For missing values, use global statistics (mean/mode), model-based imputation, or a dedicated 'missing' indicator flag.
  • Noise-Tolerant Similarity: Using fuzzy matching techniques or similarity metrics that are less sensitive to minor typos and variations.
  • Validation: Creating features that signal data quality, such as 'number of null fields in record' or 'format conformity score', which can be used to weight the confidence of other features.
DATA PREPARATION

Feature Engineering for Entity Resolution

Feature engineering for entity resolution is the process of creating and selecting measurable properties (features) from raw data to enable a machine learning or rule-based system to accurately determine if two records refer to the same real-world entity.

Feature engineering transforms raw, heterogeneous data into structured, comparable signals for matching algorithms. It involves creating similarity features (e.g., Jaccard for names, Levenshtein for addresses), categorical encodings, and derived attributes (like phonetic codes from Soundex) that capture the essence of an entity beyond superficial string differences. The goal is to produce a feature vector for each record pair that a model can use to classify matches from non-matches.

Effective features must be discriminative, separating true matches from look-alikes, and robust to noise like typos and formatting variations. Techniques include normalization (standardizing formats), tokenization, and creating composite features from multiple fields. The quality of these engineered features directly dictates the upper performance limit of the downstream probabilistic matching model or machine learning classifier used for resolution.

ENTITY RESOLUTION

Practical Feature Engineering Examples

Feature engineering transforms raw data into informative signals that help machine learning models distinguish between unique entities and match records correctly. These examples illustrate common transformations for structured and unstructured data.

01

String Normalization & Cleaning

Raw text data is often inconsistent. This foundational step creates a uniform baseline for comparison.

Key operations include:

  • Lowercasing: Converting 'Apple Inc.', 'APPLE INC.', and 'apple inc.' to 'apple inc.'.
  • Whitespace & Punctuation Removal: Stripping extra spaces and standardizing delimiters.
  • Stop Word Removal: Removing common words like 'the', 'inc.', or 'llc' if they don't aid discrimination.
  • Unicode Normalization: Ensuring characters like 'café' and 'café' are represented identically (NFD or NFC form).

Example: The strings 'St. Jude Children's Hospital', 'St Jude Childrens Hospital', and 'Saint Jude Children’s Hospital' are normalized to a comparable form before similarity calculation.

02

Phonetic Encoding for Name Matching

Algorithms convert words into codes based on pronunciation to match names that sound alike but are spelled differently, handling common transcription errors.

Common Algorithms:

  • Soundex: A classic algorithm that groups consonants. 'Robert' and 'Rupert' both encode to 'R163'.
  • Metaphone & Double Metaphone: More advanced English phonetic algorithms. 'Smith', 'Smyth', and 'Schmidt' may map to the same code ('SM0' or 'XMT').
  • NYSIIS: The New York State Identification and Intelligence System, often used for governmental records.

Use Case: Linking customer records where 'Katherine' may be entered as 'Catherine', 'Kathryn', or 'Cathryn'. Phonetic features provide a robust signal beyond edit distance.

03

Temporal Feature Extraction

Dates and timestamps are rich sources of features but must be decomposed into comparable, meaningful components.

Extracted features often include:

  • Absolute Differences: Days between 'date_of_birth' fields.
  • Cyclical Encoding: Transforming dates into sine/cosine waves to capture periodicity (e.g., day-of-week, month). This ensures December and January are close in vector space.
  • Age Calculation: Deriving age from a birth date relative to a reference date (e.g., transaction date).
  • Event Intervals: Time between 'account_created' and 'first_purchase' dates.

Example: For patient record linkage, the absolute difference in date_of_birth is a strong negative signal, while similarity in cyclical 'day_of_week_of_first_visit' might be a weak positive signal.

04

Categorical Embeddings & Frequency Encoding

Categorical variables like 'job_title' or 'product_category' require transformation into numerical features a model can use.

Common Techniques:

  • One-Hot Encoding: Creating binary columns for each category. Can become high-dimensional for variables with many values.
  • Target Encoding: Replacing a category with the average value of the target variable (e.g., match probability) for that category. Risks data leakage; must be calculated carefully.
  • Frequency Encoding: Replacing a category with its frequency of occurrence in the dataset. Common categories get a high value.
  • Learned Embeddings: Using a model to learn a dense, low-dimensional vector representation for each category during training.

Use Case: Encoding 'company_industry' (e.g., 'Technology', 'Finance', 'Healthcare') into a feature that captures semantic similarity.

05

Composite Similarity Scores

Individual attribute similarities (names, addresses) are combined into a single, powerful feature vector for a classifier.

Process:

  1. Calculate a base similarity score for each attribute pair (e.g., Jaccard for name tokens, Levenshtein for street number).
  2. Apply non-linear transformations like scaling or sigmoid functions to normalize scores.
  3. Create interaction features by multiplying or averaging scores (e.g., name_similarity * address_similarity).
  4. Derive aggregate statistics like max(similarity_scores) or number_of_scores_above_threshold.

Example Feature Vector for a Pair of Customer Records: [name_jaccard=0.8, addr_levenshtein_norm=0.2, email_exact_match=1.0, (name_jaccard * email_match)=0.8, max_similarity=1.0]

06

Graph-Derived Features

When resolving entities within a larger network, features from the graph structure itself provide critical context.

Extracted Features Include:

  • Neighborhood Overlap: Jaccard similarity of the sets of nodes connected to two candidate entities.
  • Degree Centrality: The number of connections each node has. High-degree entities (e.g., a common company name) may require stronger evidence for a match.
  • Path-Based Features: The existence or length of a shortest path between two records in a pre-existing graph.
  • Community Assignment: Whether two records belong to the same detected cluster or community in the graph.

Use Case: In academic publication deduplication, two author records are more likely to be the same person if they co-author with a highly overlapping set of other researchers (neighborhood overlap).

FEATURE ENGINEERING

Frequently Asked Questions

Feature engineering is the foundational process of creating, selecting, and transforming raw data into informative inputs for machine learning models. In the context of entity resolution, it is critical for teaching algorithms to distinguish between similar but distinct entities.

Feature engineering is the process of using domain knowledge to create new input variables (features) or transform existing ones from raw data to improve the performance, interpretability, and efficiency of machine learning models. It is a crucial step in the data preprocessing pipeline that directly influences a model's ability to learn patterns. For entity resolution, this involves crafting features that capture the nuanced similarities and differences between records, such as string distances, phonetic codes, or contextual embeddings, which the model uses to decide if two records refer to the same real-world entity.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.