Skip to main content

types

Classes concerning data types.

Classes​

CategoricalRecord​

class CategoricalRecord(    feature_name: str,    dtype: Dtype | np.dtype | type[np.generic],    encoder: _ExtendableLabelEncoder | None = None,    description: str | None = 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

Variables​

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

    Returns: The categorical SemanticType.

Static methods​


add_new_encodings_to_schema​

def add_new_encodings_to_schema(    schema: BitfountSchema, **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.

add_record_to_schema​

def add_record_to_schema(schema: BitfountSchema, **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: Dtype | np.dtype | type[np.generic],    description: str | None = None,):

Stores information for a continuous feature in the schema.

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: BitfountSchema, **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.

DataFormat​

class DataFormat(*args, **kwds):

Output format for data from dataloaders.

Variables​

  • static NUMPY_ARRAY
  • static TORCH_TENSOR

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.

Variables​

  • static prefix : str
  • static suffix : str

DataSourceType​

class DataSourceType(*args, **kwds):

Available datasource names from bitfount.data.datasources.

Ancestors​

Variables​

  • static CSVSource
  • static DICOMOphthalmologySource
  • static DICOMSource
  • static HeidelbergE2ESource
  • static HeidelbergSource
  • static ImageSource
  • static InterMineSource
  • static NIFTISource
  • static NullSource
  • static OMOPSource
  • static TopconSource

DataSplit​

class DataSplit(*args, **kwds):

Enum corresponding to the available data splits.

Ancestors​

Variables​

  • static TEST
  • static TRAIN
  • static VALIDATION

ImageRecord​

class ImageRecord(    feature_name: str,    dtype: Dtype | np.dtype | type[np.generic],    dimensions: Counter | None = None,    modes: Counter | None = None,    formats: Counter | None = None,    description: str | None = 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.

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: BitfountSchema, **constructor_arguments: Any) ‑> None:

Create an image record and add it to schema features.

Arguments

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

SemanticType​

class SemanticType(*args, **kwds):

Simple wrapper for some basic data types.

Ancestors​

Variables​

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

StrDictFieldSchemaReqs​

class StrDictFieldSchemaReqs(    *,    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: types.Validator | typing.Iterable[types.Validator] | None = 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 a specific string or a dict mapping those strings to data sources.

Variables​

  • static allowed_strings : list[str]

TextRecord​

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

Stores information for a text feature in the schema.

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: BitfountSchema, **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.