Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Sdv dev SDV FixedCombinations Init

From Leeroopedia
Revision as of 13:49, 16 February 2026 by Admin (talk | contribs) (Auto-imported from implementations/Sdv_dev_SDV_FixedCombinations_Init.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains Data_Quality, Constraint_Satisfaction
Last Updated 2026-02-14 00:00 GMT

Overview

Concrete tool for enforcing fixed value combinations across columns in synthetic data, provided by the SDV library.

Description

The FixedCombinations constraint ensures only value tuples seen during training appear in synthetic output. It requires at least two columns and works with categorical or boolean columns.

Usage

Create a FixedCombinations instance with the list of column names and add it to a synthesizer.

Code Reference

Source Location

  • Repository: SDV
  • File: sdv/cag/fixed_combinations.py
  • Lines: L21-56

Signature

class FixedCombinations(BaseConstraint):
    def __init__(self, column_names, table_name=None):
        """
        Args:
            column_names (list[str]): Columns that must maintain fixed combinations.
                Must contain at least two columns.
            table_name (str or None): Target table (multi-table). Defaults to None.
        """

Import

from sdv.cag import FixedCombinations

I/O Contract

Inputs

Name Type Required Description
column_names list[str] Yes List of columns (minimum 2) with fixed valid combinations
table_name str or None No Target table for multi-table data

Outputs

Name Type Description
instance FixedCombinations Constraint object ready to add to a synthesizer

Usage Examples

from sdv.cag import FixedCombinations

constraint = FixedCombinations(column_names=['country', 'city'])

synthesizer.add_constraints([constraint])
synthesizer.fit(data)
synthetic_data = synthesizer.sample(num_rows=1000)

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment