plaid.utils.init_with_tabular ============================= .. py:module:: plaid.utils.init_with_tabular .. autoapi-nested-parse:: Utility functions to initialize a Dataset with tabular data. Functions --------- .. autoapisummary:: plaid.utils.init_with_tabular.initialize_dataset_with_tabular_data Module Contents --------------- .. py:function:: initialize_dataset_with_tabular_data(tabular_data: dict[str, numpy.ndarray]) -> plaid.Dataset Initialize a Dataset with tabular data. This function takes a dictionary of tabular data where keys represent scalar names, and values are numpy arrays of the same length. It creates a Dataset and adds samples to it based on the provided tabular data. :param tabular_data: A dictionary of scalar names and corresponding numpy arrays. :type tabular_data: dict[str,np.ndarray] :returns: A Dataset initialized with the tabular data. :rtype: Dataset :raises AssertionError: If the lengths of the numpy arrays in tabular data are not identical. .. rubric:: Example .. code-block:: python import numpy as np from plaid.utils.init import initialize_dataset_with_tabular_data tabular_data = {'feature1': np.array([1, 2, 3]), 'feature2': np.array([4, 5, 6])} dataset = initialize_dataset_with_tabular_data(tabular_data)