### Example: Install Specific SDV Bundles Source: https://docs.sdv.dev/sdv/-enterprise/installation/instructions An example demonstrating how to install multiple SDV bundles, `bundle-cag` and `bundle-xsynthesizers`, from the private PyPI index. ```bash pip install -U bundle-cag bundle-xsynthesizers --index-url https://pypi.datacebo.com ``` -------------------------------- ### Install SDV Bundles Source: https://docs.sdv.dev/sdv/-enterprise/installation/instructions Installs specified SDV bundles from the private PyPI index. Replace `` with the actual bundle names you have purchased, separated by spaces. ```bash pip install -U --index-url https://pypi.datacebo.com ``` -------------------------------- ### HSASynthesizer.get_parameters Method and Example Output Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/multi-table-data/modeling/synthesizers/hsasynthesizer Documents the `get_parameters` method of the HSASynthesizer, which retrieves all configured and default parameters for the multi-table synthesizer. It includes the method signature, a Python usage example, and a sample of the expected dictionary output. ```APIDOC HSASynthesizer.get_parameters() -> dict (No parameters) Output: A dictionary with the table names and parameters for each table. ``` ```python synthesizer.get_parameters() ``` ```json { "locales": ["en_US", "fr_CA"], "...": "..." } ``` -------------------------------- ### Install Full SDV Enterprise Suite Source: https://docs.sdv.dev/sdv/-enterprise/installation/instructions Installs the complete SDV Enterprise software suite, including all available bundles, from the private PyPI index. This command is used if your pricing plan includes the full software. ```bash pip install -U sdv-enterprise-full --index-url https://pypi.datacebo.com ``` -------------------------------- ### Install SDV using pip Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/installation Installs the SDV 1.0 release candidate using the pip package manager. This method is suitable for Python environments. ```Shell pip install sdv ``` -------------------------------- ### Example Output of get_parameters Method Source: https://docs.sdv.dev/sdv/single-table-data/modeling/synthesizers/gaussiancopulasynthesizer Presents an example of the dictionary structure returned by the `get_parameters()` method, detailing various configuration settings of the synthesizer. ```python { 'enforce_min_max_values': True, 'enforce_rounding': False 'default_distribution': 'beta', 'numerical_distributions': { 'amenities_fee': 'beta', 'checkin_date': 'uniform' }, ... } ``` -------------------------------- ### Example Output of get_parameters() Source: https://docs.sdv.dev/sdv/single-table-data/modeling/synthesizers/bootstrapsynthesizer Shows an example dictionary returned by the `get_parameters()` method, detailing the synthesizer's configuration with its parameter names and their corresponding values. ```python { 'num_rows_bootstrap': 1000, 'bootstrap_noise_amt': 1.5, 'data_synthesizer': 'GaussianCopulaSynthesizer', 'enforce_min_max_bounds': True, 'synthesize_missing_values': False } ``` -------------------------------- ### Verify SDV Enterprise Installation with Python Source: https://docs.sdv.dev/sdv/-enterprise/installation/instructions Execute these Python commands to import the `sdv` library and print the installed enterprise version. A successful output confirms that SDV Enterprise has been correctly set up. ```python # run these commands in Python import sdv print(sdv.version.enterprise) ``` -------------------------------- ### Authentication Prompt for SDV Installation Source: https://docs.sdv.dev/sdv/-enterprise/installation/instructions Shows the expected prompt for username (your email) and password (your license key) that appears during installation from the private PyPI index. ```text User for pypi.datacebo.com: Password: ``` -------------------------------- ### Get Available SDV Multi-Table Demo Datasets Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/multi-table-data/data-preparation/loading-data Example of how to use `sdv.datasets.demo.get_available_demos` to list multi-table datasets from the SDV's public dataset repository. ```python from sdv.datasets.demo import get_available_demos get_available_demos(modality='multi_table') ``` ```text dataset_name size_MB num_tables Accidents_v1 172.3 3 airbnb-simplified 371.5 2 Atherosclerosis_v1 2.9 4 ... ... ... ``` -------------------------------- ### Install SDV Enterprise from Local Folder Source: https://docs.sdv.dev/sdv/-enterprise/installation/instructions Installs or upgrades `sdv-enterprise` from packages previously downloaded into `sdv_folder`, bypassing the PyPI index. This is used when you've downloaded the software separately. ```bash pip install -U sdv-enterprise --no-index --find-links sdv_folder ``` -------------------------------- ### Example SSL Certificate Error Message Source: https://docs.sdv.dev/sdv/-enterprise/installation/troubleshooting An example of the error message encountered when a firewall blocks access to the SDV Enterprise PyPI server due to SSL certificate issues, indicating a problem confirming the SSL certificate. ```Shell Could not fetch URL https://pypi.datacebo.com/sdv-enterprise/: There was a problem confirming the ssl certificate ``` -------------------------------- ### Customizing PARSynthesizer Initialization with Optional Parameters Source: https://docs.sdv.dev/sdv/sequential-data/modeling/parsynthesizer This example illustrates how to initialize the `PARSynthesizer` by passing optional parameters in addition to the required metadata. It shows how to configure behaviors like enforcing minimum/maximum values, rounding, and specifying context columns to guide the synthesis process. ```python synthesizer = PARSynthesizer( metadata, # required enforce_min_max_values=True, enforce_rounding=False, context_columns=['Address', 'Smoker'] ) ``` -------------------------------- ### Install Full SDV Enterprise with AI Connectors Database Dependencies Source: https://docs.sdv.dev/sdv/-enterprise/installation/instructions Installs the full SDV Enterprise suite, including AI Connectors, with specified optional database dependencies like Spanner and MSSQL. ```bash pip install -U sdv-enterprise-full[db-spanner,db-mssql] --index-url https://pypi.datacebo.com ``` -------------------------------- ### Install SDV Community Python SDK Source: https://docs.sdv.dev/sdv/explore This snippet provides the command to install the SDV Community library using pip, the standard package installer for Python. It's the first step to setting up SDV for synthetic data generation. ```bash pip install sdv ``` -------------------------------- ### Verify SDV Enterprise Installation Source: https://docs.sdv.dev/sdv/-enterprise/installation/instructions Python commands to import the `sdv` library and print the version of SDV Enterprise, confirming a successful installation. Run these commands in a Python interpreter. ```python # run these commands in Python import sdv print(sdv.version.enterprise) ``` -------------------------------- ### Install SDV using conda Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/installation Installs the SDV 1.0 release candidate using the conda package manager. This command specifies additional channels (pytorch and conda-forge) to resolve dependencies. ```Shell conda install -c pytorch -c conda-forge sdv ``` -------------------------------- ### Example Output of get_parameters() Call Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/single-table-data/modeling/synthesizers/ctgansynthesizer Illustrative example of the dictionary returned by the `synthesizer.get_parameters()` method, showing some of the configuration parameters and their current values. ```Python { 'enforce_rounding': False, 'epochs': 500, 'verbose': True, ... } ``` -------------------------------- ### Example: Get Constraints from SDV Synthesizer Source: https://docs.sdv.dev/sdv/concepts/constraint-augmented-generation-cag/constraints-api Illustrates how to call the `get_constraints` method on a synthesizer instance to retrieve the list of applied constraints. ```python synthesizer.get_constraints() ``` -------------------------------- ### Create Directory for SDV Download Source: https://docs.sdv.dev/sdv/-enterprise/installation/instructions Creates a new directory named `sdv_folder` to store the downloaded SDV packages. This is the first step for downloading and installing separately. ```bash mkdir sdv_folder ``` -------------------------------- ### Example: Get IndependentSynthesizer Parameters Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/multi-table-data/modeling/synthesizers/independentsynthesizer Shows how to call `get_parameters` to retrieve the overall synthesizer configuration, such as locales. ```python synthesizer.get_parameters() ``` ```python { 'locales': ['en_US', 'fr_CA'], ... } ``` -------------------------------- ### Download SDV Enterprise Packages Source: https://docs.sdv.dev/sdv/-enterprise/installation/instructions Downloads the `sdv-enterprise` package (or other specified software/bundles like `bundle-cag` or `sdv-enterprise-full`) into the `sdv_folder` without installing it, using the private PyPI index. ```bash pip download sdv-enterprise --index-url https://pypi.datacebo.com --only-binary=:all: --dest sdv_folder ``` -------------------------------- ### Download SDV Enterprise for Specific Python Version and Platform Source: https://docs.sdv.dev/sdv/-enterprise/installation/instructions This example `pip download` command demonstrates how to download the SDV Enterprise package for a specific Python version (3.9) and macOS platform (M1/M2 chips). It includes necessary flags like `--index-url` for the package source, `--only-binary=:all:` to ensure binary download, and `--dest` for the output directory. ```Bash pip download sdv-enterprise --index-url https://pypi.datacebo.com --only-binary=:all: --dest sdv_folder --python-version 39 --platform macosx_14_0_arm64 ``` -------------------------------- ### Python: Get Available SDV Demo Datasets Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/single-table-data/data-preparation/loading-data Example of how to use the `get_available_demos` method to list single-table demo datasets available in the SDV library's public repository. This requires an active internet connection. ```Python from sdv.datasets.demo import get_available_demos get_available_demos(modality='single_table') ``` -------------------------------- ### Install AI Connectors with Database Dependencies Source: https://docs.sdv.dev/sdv/-enterprise/installation/instructions Installs the `bundle-ai-connectors` bundle, specifying optional database dependencies like Spanner and MSSQL. This is required for AI Connectors to connect to specific databases. ```bash pip install -U bundle-ai-connectors[db-spanner,db-mssql] --index-url https://pypi.datacebo.com ``` -------------------------------- ### Install XSynthesizers Bundle Source: https://docs.sdv.dev/sdv/reference/explore-sdv/xsynthesizers-bundle Installs the XSynthesizers bundle using pip from the specified private PyPI index. This command requires SDV Enterprise credentials for authentication. ```Shell % pip install -U bundle-xsynthesizers --index-url https://pypi.datacebo.com ``` -------------------------------- ### Install or Upgrade SDV Enterprise via pip Source: https://docs.sdv.dev/sdv/-enterprise/installation/instructions This command uses pip to download and install the latest version of SDV Enterprise from DataCebo's private PyPI index. The `-U` flag ensures that existing installations are upgraded. ```bash pip install -U sdv-enterprise --index-url https://pypi.datacebo.com ``` -------------------------------- ### Install XSynthesizers Bundle Source: https://docs.sdv.dev/sdv/explore/sdv-bundles/xsynthesizers This command installs the XSynthesizers bundle using pip. It requires SDV Enterprise credentials for authentication. ```Python % pip install -U bundle-xsynthesizers --index-url https://pypi.datacebo.com ``` -------------------------------- ### Install SDV Community Python SDK Source: https://docs.sdv.dev/sdv/explore/sdv-community This command installs the SDV Community Python SDK using pip, the recommended package installer for Python. It ensures all necessary dependencies are downloaded and configured. ```bash pip install sdv ``` -------------------------------- ### Example Output: Available SDV Demo Datasets Source: https://docs.sdv.dev/sdv/sequential-data/data-preparation/loading-data This snippet provides an example of the tabular output returned by the `get_available_demos` function. It illustrates the structure of the pandas DataFrame, showing columns for dataset name, size in MB, and number of tables for various demo datasets. ```text dataset_name size_MB num_tables ArticularyWordRecognition 8.8 1 AtrialFibrillation 0.627 1 BasicMotions 0.741 1 ... ... ... ``` -------------------------------- ### Example Output of TVAESynthesizer get_parameters() Source: https://docs.sdv.dev/sdv/single-table-data/modeling/synthesizers/tvaesynthesizer Provides an example of the dictionary structure returned by the get_parameters() method, showing some of the key-value pairs representing the synthesizer's configuration, indicating that the returned parameters are a copy. ```Python { 'enforce_rounding': False, 'epochs': 500, ... } ``` -------------------------------- ### Install XSynthesizers Bundle Source: https://docs.sdv.dev/sdv/reference/explore-sdv/xsynthesis-bundle This command installs the XSynthesizers bundle using pip, specifying a custom index URL. It requires SDV Enterprise credentials for authentication. ```Shell % pip install -U bundle-xsynthesizers --index-url https://pypi.datacebo.com ``` -------------------------------- ### Example Output of HMASynthesizer `get_parameters` Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/multi-table-data/modeling/synthesizers/hmasynthesizer An example of the dictionary structure returned by the `get_parameters` method, showing some of the global parameters like `locales`. ```JSON { "locales": ["en_US", "fr_CA"], "..." } ``` -------------------------------- ### Verify SDV Community Python Installation Source: https://docs.sdv.dev/sdv/explore After installation, this Python code snippet verifies that the SDV library is correctly installed by importing it and printing its community version number. This confirms the environment is ready for use. ```python import sdv print(sdv.version.community) ``` -------------------------------- ### Example Output of HMASynthesizer `get_table_parameters` Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/multi-table-data/modeling/synthesizers/hmasynthesizer An example of the dictionary structure returned by the `get_table_parameters` method, showing table-specific synthesizer details and parameters. ```JSON { "synthesizer_name": "GaussianCopulaSynthesizer", "synthesizer_parameters": { "default_distribution": "beta", "..." } } ``` -------------------------------- ### Example Output of IndependentSynthesizer.get_parameters Source: https://docs.sdv.dev/sdv/multi-table-data/modeling/synthesizers/independentsynthesizer Illustrates the typical dictionary structure returned by `get_parameters`, showing global synthesizer settings like 'locales'. ```json { "locales": ["en_US", "fr_CA"], "..." } ``` -------------------------------- ### Verify SDV Installation Version Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/installation Checks the installed version of the SDV library. This Python code snippet imports the sdv module and prints its public version attribute to confirm successful installation. ```Python import sdv print(sdv.version.public) ``` -------------------------------- ### Example: Get Synthesizer Metadata Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/multi-table-data/modeling/synthesizers/independentsynthesizer Shows how to retrieve the `MultiTableMetadata` object used by the `IndependentSynthesizer`. ```python metadata = synthesizer.get_metadata() ``` -------------------------------- ### Initialize and Sample with Fast ML Preset Synthesizer Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/single-table-data/modeling/synthesizers/fast-ml-preset Demonstrates the basic workflow for using the `SingleTablePreset` with the 'FAST_ML' preset: importing the class, initializing the synthesizer with metadata, fitting it to real data, and then sampling synthetic data. ```Python from sdv.lite import SingleTablePreset synthesizer = SingleTablePreset(metadata, name='FAST_ML') synthesizer.fit(data) synthetic_data = synthesizer.sample(num_rows=10) ``` -------------------------------- ### Basic HSASynthesizer Workflow Source: https://docs.sdv.dev/sdv/multi-table-data/modeling/synthesizers/hsasynthesizer Demonstrates the fundamental steps to use `HSASynthesizer`: import, initialization with metadata, fitting to real data, and sampling synthetic data. This provides a complete end-to-end example. ```python from sdv.multi_table import HSASynthesizer synthesizer = HSASynthesizer(metadata) synthesizer.fit(data) synthetic_data = synthesizer.sample() ``` -------------------------------- ### Example Output of get_parameters() Method Source: https://docs.sdv.dev/sdv/single-table-data/modeling/synthesizers/xgcsynthesizer Illustrative Python dictionary showing the typical structure and content returned by the `get_parameters()` method, including various synthesizer configuration values. ```python { 'enforce_min_max_values': True, 'enforce_rounding': False, 'default_distribution': 'beta', 'numerical_distributions': { 'amenities_fee': 'beta', 'checkin_date': 'scipy.stats.dweibull' }, ... } ``` -------------------------------- ### Example: Get Parameters for a Specific Table Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/multi-table-data/modeling/synthesizers/independentsynthesizer Demonstrates how to use `get_table_parameters` to retrieve the configuration for a table named 'users'. ```python synthesizer.get_table_parameters(table_name='users') ``` ```python { 'synthesizer_name': 'GaussianCopulaSynthesizer', 'synthesizer_parameters': { 'default_distribution': 'beta', ... } } ``` -------------------------------- ### Basic GaussianCopulaSynthesizer Usage Source: https://docs.sdv.dev/sdv/single-table-data/modeling/synthesizers/gaussiancopulasynthesizer Demonstrates the fundamental steps to initialize the `GaussianCopulaSynthesizer`, fit it to real data, and then sample synthetic data. ```python from sdv.single_table import GaussianCopulaSynthesizer synthesizer = GaussianCopulaSynthesizer(metadata) synthesizer.fit(data) synthetic_data = synthesizer.sample(num_rows=10) ``` -------------------------------- ### Initialize and Use HSASynthesizer Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/multi-table-data/modeling/synthesizers/hsasynthesizer Demonstrates the basic workflow for initializing the HSASynthesizer with metadata, fitting it to real data, and sampling synthetic data. ```python from sdv.multi_table import HSASynthesizer synthesizer = HSASynthesizer(metadata) synthesizer.fit(data) synthetic_data = synthesizer.sample() ``` -------------------------------- ### Example Output for get_available_demos Source: https://docs.sdv.dev/sdv/single-table-data/data-preparation/loading-data This snippet shows a typical output structure from the `get_available_demos` function, illustrating the columns `dataset_name`, `size_MB`, and `num_tables` for various demo datasets. ```text dataset_name size_MB num_tables adult 3.6 1 alarm 4.6 1 census 141.2 1 ... ... ... ``` -------------------------------- ### Example: Get Unknown Column Names for a Table Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/multi-table-data/data-preparation/multi-table-metadata-api Illustrates how to use `get_column_names` to find all columns in the 'products' table that are currently classified with an 'unknown' sdtype. ```python metadata.get_column_names(table_name='products', sdtype='unknown') ``` -------------------------------- ### Example: Get Modified Metadata from SDV Synthesizer Source: https://docs.sdv.dev/sdv/concepts/constraint-augmented-generation-cag/constraints-api Shows how to retrieve the modified metadata from a synthesizer instance using the `get_metadata` method, specifically requesting the 'modified' version. ```python modified_metadata = synthesizer.get_metadata(version='modified') ``` -------------------------------- ### Example of Getting Assigned Transformers in SDV Source: https://docs.sdv.dev/sdv/single-table-data/modeling/customizations/preprocessing Illustrates how to call the `get_transformers` method on a synthesizer object to retrieve a dictionary detailing the RDT transformers assigned to each column for preprocessing and post-processing. ```Python synthesizer.get_transformers() ``` -------------------------------- ### Example Output of get_parameters Method Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/single-table-data/modeling/synthesizers/gaussiancopulasynthesizer Shows a sample dictionary structure returned by the `get_parameters` method, detailing the synthesizer's configuration. ```python { 'enforce_min_max_values': True, 'enforce_rounding': False 'default_distribution': 'beta', 'numerical_distributions': { 'amenities_fee': 'beta', 'checkin_date': 'uniform' }, ... } ``` -------------------------------- ### GaussianCopulaSynthesizer Constructor Parameter Reference Source: https://docs.sdv.dev/sdv/single-table-data/modeling/synthesizers/gaussiancopulasynthesizer Detailed documentation for the parameters available when initializing the `GaussianCopulaSynthesizer`. ```APIDOC GaussianCopulaSynthesizer( metadata: Metadata, # required enforce_min_max_values: bool = True Control whether synthetic data adheres to real data's min/max boundaries. True (default): Synthetic data values are within real data ranges. False: Synthetic data values may be outside real data ranges. enforce_rounding: bool = True Control whether synthetic data has the same number of decimal digits as real data. True (default): Synthetic data is rounded to observed decimal digits. False: Synthetic data may contain more decimal digits. locales: list[str] = ['en_US'] A list of locale strings for PII columns. ['en_US'] (default): Generates US-based English PII values. : Creates data from the specified list of locales (e.g., ['en_US', 'fr_CA']). numerical_distributions: dict[str, str] = None Set the distribution shape for specific numerical columns. None (default): Uses the default distribution for the column. : Applies the given distribution to each column name. Valid distributions: 'norm', 'beta', 'truncnorm', 'uniform', 'gamma', 'gaussian_kde'. default_distribution: str = 'beta' Set the default distribution shape for all columns. 'beta' (default): Models the column as a beta distribution. : Models the column as the given distribution. Valid distributions: 'norm', 'beta', 'truncnorm', 'uniform', 'gamma', 'gaussian_kde'. Note: 'gaussian_kde' increases training time. ) ``` -------------------------------- ### Initialize and Use BootstrapSynthesizer Source: https://docs.sdv.dev/sdv/single-table-data/modeling/synthesizers/bootstrapsynthesizer Demonstrates the basic steps to initialize BootstrapSynthesizer, fit it to real data, and then sample synthetic data from the trained synthesizer. ```python from sdv.single_table import BootstrapSynthesizer synthesizer = BootstrapSynthesizer(metadata) synthesizer.fit(data) synthetic_data = synthesizer.sample(num_rows=10) ``` -------------------------------- ### Get Table Parameters for Synthesizer in Python Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/multi-table-data/modeling/synthesizers/hsasynthesizer Accesses all parameters used by a table synthesizer, including user-provided and default ones. This function requires the table name as input and returns a dictionary of parameter names and values. ```Python synthesizer.get_table_parameters(table_name='users') ``` ```Python Output { 'synthesizer_name': 'GaussianCopulaSynthesizer', 'synthesizer_parameters': { 'default_distribution': 'beta', ... } } ``` -------------------------------- ### Initialize and Use GaussianCopulaSynthesizer Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/single-table-data/modeling/synthesizers/gaussiancopulasynthesizer Demonstrates the basic steps to initialize, fit, and sample synthetic data using the GaussianCopulaSynthesizer from the SDV library. ```python from sdv.single_table import GaussianCopulaSynthesizer synthesizer = GaussianCopulaSynthesizer(metadata) synthesizer.fit(data) synthetic_data = synthesizer.sample(num_rows=10) ``` -------------------------------- ### HSASynthesizer.set_table_parameters Method and Usage Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/multi-table-data/modeling/synthesizers/hsasynthesizer Documents the `set_table_parameters` method of the HSASynthesizer, allowing configuration of individual tables within the multi-table model. It includes the method signature, parameter details, and a Python example demonstrating its usage to specify a single table synthesizer and its parameters. ```APIDOC HSASynthesizer.set_table_parameters( table_name: str, table_synthesizer: str = 'GaussianCopulaSynthesizer', table_parameters: dict ) -> None table_name: A string describing the name of the table (required) table_synthesizer: The single table synthesizer to use for modeling the table (default: 'GaussianCopulaSynthesizer', options: 'GaussianCopulaSynthesizer', 'CTGANSynthesizer', 'TVAESynthesizer', 'CopulaGANSynthesizer') table_parameters: A dictionary mapping the name of the parameter (string) to the value of the parameter (various). These parameters are different for each synthesizer. ``` ```python synthesizer.set_table_parameters( table_name='guests', table_synthesizer='GaussianCopulaSynthesizer', table_parameters={ 'enforce_min_max_values': True, 'default_distribution': 'truncnorm', 'numerical_distributions': { 'checkin_date': 'uniform', 'amenities_fee': 'beta' } } ) ``` -------------------------------- ### Force Plotly Charts to Render Inline in SDV Source: https://docs.sdv.dev/sdv/support/troubleshooting/sdv-usage This snippet provides examples of how to explicitly set the Plotly renderer when displaying figures, which can resolve issues where charts do not render inline in environments like VSCode or JupyterLab. This ensures charts are displayed directly within the IDE rather than being saved as external files. ```python fig.show('vscode') ``` ```python fig.show('jupyterlab') ``` -------------------------------- ### Initialize and Use XGCSynthesizer for Basic Synthetic Data Generation Source: https://docs.sdv.dev/sdv/single-table-data/modeling/synthesizers/xgcsynthesizer This snippet demonstrates the basic workflow of using the XGCSynthesizer. It imports the synthesizer class, initializes an instance with metadata, fits the model to real data, and then samples synthetic data. ```python from sdv.single_table import XGCSynthesizer synthesizer = XGCSynthesizer(metadata) synthesizer.fit(data) synthetic_data = synthesizer.sample(num_rows=10) ``` -------------------------------- ### Check SDV Version Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/reference/support-and-troubleshooting/support-for-installation This Python snippet checks the installed version of the SDV library. It helps diagnose installation or usage problems by verifying if the latest version is properly installed. If the code produces an error or an old version number, it indicates an installation issue. ```Python import sdv print(sdv.__version__) ``` -------------------------------- ### Define Datetime Sdtype for SDV with Format Source: https://docs.sdv.dev/sdv/concepts/metadata/sdtypes Example JSON configuration for a column identified as a datetime sdtype. This type represents points in time and requires a 'datetime_format' property, defined by Python's strftime module, to guide synthetic data generation within the same overall range and distribution. ```JSON { "start_date": { "sdtype": "datetime", "datetime_format": "%Y-%m-%d" } } ``` -------------------------------- ### Check Installed SDV Version Source: https://docs.sdv.dev/sdv/support/troubleshooting/installation This Python code snippet imports the `sdv` library and prints its `__version__` attribute. It is used to verify if the SDV library is correctly installed and if the installed version matches the latest release, which is a key step in debugging `ModuleNotFoundError` or `AttributeError`. ```python import sdv print(sdv.__version__) ``` -------------------------------- ### XGCSynthesizer Class Constructor API Reference Source: https://docs.sdv.dev/sdv/single-table-data/modeling/synthesizers/xgcsynthesizer API documentation for the `XGCSynthesizer` class constructor, detailing its required and optional parameters for customization during instantiation. ```APIDOC XGCSynthesizer( metadata: Metadata, enforce_min_max_values: bool = False, enforce_rounding: bool = False, numerical_distributions: dict = None, default_distribution: str = 'norm' ) metadata: A required Metadata object containing the table schema. enforce_min_max_values: Whether to enforce min/max values from the real data during sampling. Defaults to False. enforce_rounding: Whether to round numerical values in the synthetic data to their original precision. Defaults to False. numerical_distributions: A dictionary mapping column names to their desired numerical distribution (e.g., 'beta', 'scipy.stats.dweibull'). default_distribution: The default distribution to use for numerical columns not explicitly specified in `numerical_distributions`. Defaults to 'norm'. ``` -------------------------------- ### Initialize and Sample with DayZSynthesizer Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/single-table-data/modeling/synthesizers/dayzsynthesizer This snippet demonstrates the basic initialization of the `DayZSynthesizer` with a metadata object and how to sample synthetic data from it. It showcases the fundamental usage for generating synthetic data from scratch without requiring real data. ```python from sdv.single_table import DayZSynthesizer synthesizer = DayZSynthesizer(metadata) synthetic_data = synthesizer.sample(num_rows=10) ``` -------------------------------- ### Authenticate During SDV Enterprise Installation Source: https://docs.sdv.dev/sdv/-enterprise/installation/instructions During the pip installation process, you will be prompted to provide your DataCebo email as the username and your license key as the password to authenticate with the private package index. ```bash User for pypi.datacebo.com: Password: ``` -------------------------------- ### Basic Usage of CopulaGANSynthesizer Source: https://docs.sdv.dev/sdv/single-table-data/modeling/synthesizers/copulagansynthesizer This code demonstrates the fundamental steps to use the `CopulaGANSynthesizer`. It covers importing the class, initializing an instance with metadata, fitting the synthesizer to your real dataset, and finally sampling synthetic data. ```python from sdv.single_table import CopulaGANSynthesizer synthesizer = CopulaGANSynthesizer(metadata) synthesizer.fit(data) synthetic_data = synthesizer.sample(num_rows=10) ``` -------------------------------- ### Example Output for get_available_demos (Text) Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/sequential-data/data-preparation/loading-data Illustrates the structure of the pandas DataFrame returned by `get_available_demos`, showing columns for dataset name, size, and number of tables. ```Output dataset_name size_MB num_tables ArticularyWordRecognition 8.8 1 AtrialFibrillation 0.627 1 BasicMotions 0.741 1 ... ... ... ``` -------------------------------- ### Initialize and Sample with DayZSynthesizer Source: https://docs.sdv.dev/sdv/multi-table-data/modeling/synthesizers/dayzsynthesizer This snippet demonstrates the basic usage of the `DayZSynthesizer` to create a synthesizer instance using provided metadata and then sample synthetic data for a specified number of rows. It highlights the core functionality of generating synthetic data from scratch. ```Python from sdv.multi_table import DayZSynthesizer synthesizer = DayZSynthesizer(metadata) synthetic_data = synthesizer.sample(num_rows=1000) ``` -------------------------------- ### APIDOC: sdv.datasets.demo.download_demo Method Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/sequential-data/data-preparation/loading-data Documents the `download_demo` method for downloading specific SDV demo datasets. It outlines the required and optional parameters and describes the `(data, metadata)` tuple returned. ```APIDOC download_demo( modality: str, # Required: 'sequential' to access sequential demo data dataset_name: str, # Required: Name of the demo dataset (from get_available_demos) output_folder_name: str = None # Optional: Folder to save data and metadata; defaults to None ) Returns: tuple (data, metadata) - data: pandas.DataFrame containing the demo data - metadata: SingleTableMetadata object describing the data ``` -------------------------------- ### Authentication Prompt for SDV Download Source: https://docs.sdv.dev/sdv/-enterprise/installation/instructions Shows the expected prompt for username (your email) and password (your license key) that appears during package download from the private PyPI index. ```text User for pypi.datacebo.com: Password: ``` -------------------------------- ### Add Trusted Host Flags for Pip Installation Source: https://docs.sdv.dev/sdv/-enterprise/installation/troubleshooting These flags are used to explicitly approve trusted hosts for pip when a firewall is blocking access to the SDV Enterprise package server. They should be appended to the pip install command. ```Shell --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.datacebo.com ``` -------------------------------- ### Install SDV CAG Bundle Source: https://docs.sdv.dev/sdv/explore/sdv-bundles/cag This command installs the Constraint Augmented Generation (CAG) bundle, which provides advanced data generation capabilities for SDV Enterprise users. It requires valid SDV Enterprise credentials for successful installation. ```Shell % pip install -U bundle-cag --index-url https://pypi.datacebo.com ``` -------------------------------- ### Install SDV Enterprise with Trusted Hosts Source: https://docs.sdv.dev/sdv/-enterprise/installation/troubleshooting A complete pip command to install SDV Enterprise, including flags to bypass potential firewall issues by explicitly trusting the necessary package hosts. This ensures the package can be downloaded successfully. ```Python pip install -U sdv-enterprise --no-index --index-url https://pypi.datacebo.com --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.datacebo.com ``` -------------------------------- ### Basic IndependentSynthesizer Workflow Source: https://docs.sdv.dev/sdv/multi-table-data/modeling/synthesizers/independentsynthesizer Demonstrates the fundamental steps for using the IndependentSynthesizer: importing the class, initializing it with metadata, fitting the synthesizer to your multi-table data, and then sampling synthetic data. ```python from sdv.multi_table import IndependentSynthesizer synthesizer = IndependentSynthesizer(metadata) synthesizer.fit(data) synthetic_data = synthesizer.sample() ``` -------------------------------- ### Install SDV Python Library Source: https://docs.sdv.dev/sdv/index This snippet provides the command to install the SDV (Synthetic Data Vault) Python library using pip, the standard package installer for Python. This step is necessary to use SDV's functionalities for synthetic data generation. ```bash pip install sdv ``` -------------------------------- ### Example Output of HSASynthesizer.get_parameters Source: https://docs.sdv.dev/sdv/multi-table-data/modeling/synthesizers/hsasynthesizer Illustrates a typical dictionary output from the `get_parameters` method. It shows how the synthesizer's overall configuration, including parameters like `locales`, is presented in a Python dictionary format. ```python { 'locales': ['en_US', 'fr_CA'], ... } ``` -------------------------------- ### Install CAG Bundle Source: https://docs.sdv.dev/sdv/reference/explore-sdv/cag-bundle This command installs the Constraint Augmented Generation (CAG) bundle using pip. It specifies a custom index URL for the package, indicating that it's likely a private or enterprise-specific package. Users will be prompted for their SDV Enterprise credentials during the installation process. ```bash % pip install -U bundle-cag --index-url https://pypi.datacebo.com ``` -------------------------------- ### Initialize DayZSynthesizer and Sample Data Source: https://docs.sdv.dev/sdv/single-table-data/modeling/synthesizers/dayzsynthesizer This snippet demonstrates how to import the DayZSynthesizer class, initialize an instance of it by passing a metadata object, and then use the sample method to generate a specified number of synthetic data rows. ```python from sdv.single_table import DayZSynthesizer synthesizer = DayZSynthesizer(metadata) synthetic_data = synthesizer.sample(num_rows=10) ``` -------------------------------- ### Download Specific SDV Demo Dataset (Python) Source: https://docs.sdv.dev/sdv/~/changes/T3ZD1DOoRUEqkmrAGBZp/sequential-data/data-preparation/loading-data Shows how to download a specific sequential demo dataset using `sdv.datasets.demo.download_demo`. It demonstrates passing `modality`, `dataset_name`, and an optional `output_folder_name` to save the data locally, returning the data and metadata. ```Python from sdv.datasets.demo import download_demo data, metadata = download_demo( modality='sequential', dataset_name='ArticularyWordRecognition', output_folder_name='sdv_demo_datasets/word_data/' ) ``` -------------------------------- ### Python Script to Verify System Environment Details Source: https://docs.sdv.dev/sdv/-enterprise/installation This Python script gathers and prints comprehensive details about the current operating system, Python installation, and pip version. It helps users verify if their environment meets the technical requirements for SDV Enterprise and provides additional information useful for troubleshooting. The output includes OS type, version, architecture, Python version, system bit, and pip version, similar to the example provided in the documentation. ```Python import pip import platform import sys import subprocess import sysconfig import re os_version = platform.version() os_system = platform.system() linux_distro = None is_linux = sys.platform == 'linux' if sys.platform == 'darwin': os_version = subprocess.check_output(['sw_vers', '-productVersion']).strip().decode('utf-8') os_system = 'macOS' if is_linux: os_version = platform.release() linux_distro = subprocess.run("cat /etc/*-release", shell=True, capture_output=True, text=True) linux_distro = linux_distro.stdout.strip() distro_name_match = re.search(r'PRETTY_NAME="(.*)"', linux_distro) if distro_name_match: linux_distro = distro_name_match.group(1) is_64bits = sys.maxsize > 2**32 bit = "64-bit" if is_64bits else "32-bit" if platform.system().lower() == "windows": arch = sysconfig.get_platform() else: arch = subprocess.check_output(['uname', '-m'], text=True).strip().lower() print(f'Operating System: {os_system}') if is_linux: os_system += ' Kernel' print(f'{os_system} Version: {os_version}') if is_linux: print(f'Linux Distribution: {linux_distro}') print(f'Architecture: {arch}') print(f'Python Version: {platform.python_version()}') print(f'System Bit: {bit}') print(f'pip Version: {pip.__version__}') print(f'\nAdditional Information For Troubleshooting') platform_tag = sysconfig.get_platform() platform_tag = platform_tag.replace('-', '_').replace('.', '_') print(f'Processor: {platform.processor()}') print(f'Platform Tag: {platform_tag}') ``` -------------------------------- ### GaussianCopulaSynthesizer.get_parameters Method Source: https://docs.sdv.dev/sdv/single-table-data/modeling/synthesizers/gaussiancopulasynthesizer Documentation for the `get_parameters` method, which retrieves the synthesizer's current configuration. ```APIDOC get_parameters() Parameters: None Output: A dictionary with the parameter names and their values. Note: The returned parameters are a copy; changing them will not affect the synthesizer. ```