Skip to main content

types

Classes concerning data types.

Classes

CategoricalRecord

class CategoricalRecord(    feature_name: str,    dtype: Union[Dtype, np.dtype, type[np.generic]],    encoder: Optional[_ExtendableLabelEncoder] = None,    description: Optional[str] = None,):

Stores information for a categorical feature in the schema.

Arguments

  • encoder: An encoder for the different categories. Defaults to None. feature_name (str): name of the feature

Ancestors

  • bitfount.data.types._SemanticTypeRecord

Variables

  • semantic_type : SemanticType - Property for the relevant SemanticType for the class.

    Returns: The categorical SemanticType.

Static methods


add_record_to_schema

def add_record_to_schema(schema: TableSchema, **constructor_arguments: Any)> None:

Create a categorical record and add it to the schema features.

Arguments

  • schema: A TableSchema object.
  • ****constructor_arguments**: Additional arguments to pass to the schema class.

ContinuousRecord

class ContinuousRecord(    feature_name: str,    dtype: Union[Dtype, np.dtype, type[np.generic]],    description: Optional[str] = None,):

Stores information for a continuous feature in the schema.

Ancestors

  • bitfount.data.types._SemanticTypeRecord

Variables

  • semantic_type : SemanticType - Property for the relevant SemanticType for the class.

    Returns: The continuous SemanticType.

Static methods


add_record_to_schema

def add_record_to_schema(schema: TableSchema, **constructor_arguments: Any)> None:

Create a continuous record and add it to schema features.

Arguments

  • schema: A TableSchema object.
  • ****constructor_arguments**: Additional arguments to pass to the schema class.

DataPathModifiers

class DataPathModifiers(*args, **kwargs):

TypedDict class for path modifiers.

NotRequired indicates that the keys don't all need to be present. But the keys that are present need to be one of the ones listed below.

Arguments

  • suffix: The suffix to be used for modifying a path.
  • prefix: The prefix to be used for modifying a path.

Ancestors

  • builtins.dict

Variables

  • static prefix : typing_extensions.NotRequired[str]
  • static suffix : typing_extensions.NotRequired[str]

DataSplit

class DataSplit(value, names=None, *, module=None, qualname=None, type=None, start=1):

Enum corresponding to the available data splits.

Ancestors

Variables

  • static TEST
  • static TRAIN
  • static VALIDATION

DatasourceType

class DatasourceType(    value, names=None, *, module=None, qualname=None, type=None, start=1,):

Bitfount Datasource types.

Ancestors

Variables

  • static CSVSource
  • static DICOMSource

ImageRecord

class ImageRecord(    feature_name: str,    dtype: Union[Dtype, np.dtype, type[np.generic]],    dimensions: Optional[Counter] = None,    modes: Optional[Counter] = None,    formats: Optional[Counter] = None,    description: Optional[str] = None,):

Stores information for an image feature in the schema.

Arguments

  • dimensions: The dimensions of the different images in the column. Defaults to None.
  • modes: The modes of the different images in the column. Defaults to None.
  • formats: The formats of the different images in the column. Defaults to None.
  • ****kwargs**: Additional arguments to pass to the parent class.

Ancestors

  • bitfount.data.types._SemanticTypeRecord

Variables

  • semantic_type : SemanticType - Property for the relevant SemanticType for the class.

    Returns: The image SemanticType.

Static methods


add_record_to_schema

def add_record_to_schema(schema: TableSchema, **constructor_arguments: Any)> None:

Create an image record and add it to schema features.

Arguments

  • schema: A TableSchema object.
  • ****constructor_arguments**: Additional arguments to pass to the schema class.

SemanticType

class SemanticType(value, names=None, *, module=None, qualname=None, type=None, start=1):

Simple wrapper for some basic data types.

Ancestors

Variables

  • static CATEGORICAL
  • static CONTINUOUS
  • static IMAGE
  • static TEXT

StrDictField

class StrDictField(    *,    load_default: typing.Any = <marshmallow.missing>,    missing: typing.Any = <marshmallow.missing>,    dump_default: typing.Any = <marshmallow.missing>,    default: typing.Any = <marshmallow.missing>,    data_key: str | None = None,    attribute: str | None = None,    validate: None | typing.Callable[[typing.Any], typing.Any] | typing.Iterable[typing.Callable[[typing.Any], typing.Any]] = None,    required: bool = False,    allow_none: bool | None = None,    load_only: bool = False,    dump_only: bool = False,    error_messages: dict[str, str] | None = None,    metadata: typing.Mapping[str, typing.Any] | None = None,    **additional_metadata,):

Field that can be str or dict.

Ancestors

TextRecord

class TextRecord(    feature_name: str,    dtype: Union[Dtype, np.dtype, type[np.generic]],    description: Optional[str] = None,):

Stores information for a text feature in the schema.

Ancestors

  • bitfount.data.types._SemanticTypeRecord

Variables

  • semantic_type : SemanticType - Property for the relevant SemanticType for the class.

    Returns: The text SemanticType.

Static methods


add_record_to_schema

def add_record_to_schema(schema: TableSchema, **constructor_arguments: Any)> None:

Create a text record and add it to schema features.

Arguments

  • schema: A TableSchema object.
  • ****constructor_arguments**: Additional arguments to pass to the schema class.