Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Implementation:Sdv dev SDV PARSynthesizer Fit

From Leeroopedia
Knowledge Sources
Domains Time_Series, Machine_Learning
Last Updated 2026-02-14 00:00 GMT

Overview

Concrete tool for fitting the PAR sequential synthesizer on time-series data, provided by the SDV library.

Description

The PARSynthesizer._fit method (called internally by BaseSynthesizer.fit) separates context and sequential columns, fits the context model, assembles sequences, and trains the DeepEcho PARModel.

Usage

Call synthesizer.fit(data) on a PARSynthesizer. The fit method is inherited from BaseSynthesizer.

Code Reference

Source Location

  • Repository: SDV
  • File: sdv/sequential/par.py
  • Lines: L539-553 (_fit), L675-701 (fit via base.py)

Signature

def _fit(self, processed_data):
    """Fit this model to the data.

    Args:
        processed_data (pandas.DataFrame):
            DataFrame containing sequences, entity columns, and context columns.
    """

Import

from sdv.sequential import PARSynthesizer
# fit is called as: synthesizer.fit(data)

I/O Contract

Inputs

Name Type Required Description
data pd.DataFrame Yes Sequential data with sequence key and context columns

Outputs

Name Type Description
(mutates self) None Fits context model and PARModel; sets self._fitted = True

Usage Examples

from sdv.datasets.demo import download_demo
from sdv.sequential import PARSynthesizer

data, metadata = download_demo(modality='sequential', dataset_name='nasdaq100_2019')
synthesizer = PARSynthesizer(metadata, context_columns=['Sector'])
synthesizer.fit(data)

Related Pages

Implements Principle

Requires Environment

Page Connections

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