Reader

class lightautoml.reader.base.Reader(task, *args, **kwargs)[source]

Bases: object

Abstract class for analyzing input data and creating inner LAMLDataset from raw data. Takes data in different formats as input, drop obviously useless features, estimates avaliable size and returns dataset.

__init__(task, *args, **kwargs)[source]
Parameters
  • task (Task) – Task object

  • *args – Not used.

  • *kwargs – Not used.

property roles

Roles dict.

Return type

Dict[str, ~RoleType]

property dropped_features

List of dropped features.

Return type

List[str]

property used_features

List of used features.

Return type

List[str]

property used_array_attrs

Dict of used array attributes.

Return type

Dict[str, str]

fit_read(train_data, features_names=None, roles=None, **kwargs)[source]

Abstract function to get dataset with initial feature selection.

read(data, features_names, **kwargs)[source]

Abstract function to add validation columns.

upd_used_features(add=None, remove=None)[source]

Updates the list of used features.

Parameters
classmethod from_reader(reader, **kwargs)[source]

Create reader for new data type from existed.

Note - for now only Pandas reader exists, made for future plans.

Parameters
  • reader (Reader) – Source reader.

  • **kwargs – Ignored as in the class itself.

Return type

Reader

Returns

New reader.

cols_by_type(col_type)[source]

Get roles names by it’s type.

Parameters

col_type (str) – Column type, for example ‘Text’.

Return type

List[str]

Returns

Array with column names.