Features#
lit.sdk.data.features
#
This module provides functions for loading and retrieving features.
Feature = Callable[[adapter.BaseAdapter, int | None, dict | None], NDArray]
module-attribute
#
Represents a callable feature, which takes an Adapter, data index, optional params, and returns feature outputs.
add_feature(team, name, script_name, parameters={}, group=None)
#
Gets the saved feature script.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
team
|
str
|
The name of the team which owns the features. |
required |
name
|
str
|
The name of the new feature. |
required |
script_name
|
str
|
The name of the feature script. |
required |
parameters
|
dict
|
The input parameters for the feature. |
{}
|
Returns:
| Type | Description |
|---|---|
Feature
|
A feature. |
get_feature_script(team, script_name)
#
Gets the saved feature script.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
team
|
str
|
The name of the team which owns the features. |
required |
script_name
|
str
|
The name of the feature script. |
required |
Returns:
| Type | Description |
|---|---|
Feature
|
A feature. |
get_saved_features(team)
#
Gets the list of saved features and their configurations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
team
|
str
|
The name of the team which owns the features. |
required |
Returns:
| Type | Description |
|---|---|
list[dict]
|
A list of feature configurations. |
load_features(team, features)
#
Gets a list of feature functions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
team
|
str
|
The name of the team which owns the features. |
required |
features
|
list[str]
|
The names of the features to load. |
required |
Returns:
| Type | Description |
|---|---|
list[Feature]
|
A list of loaded feature functions. |
Examples: