n_last
logger = logging.getLogger(__name__) module-attribute ¶
NLastInteractionSplitter ¶
Bases: Splitter
Splits the n most recent interactions of a user into the second return value, and earlier interactions into the first.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n | int | Number of most recent actions to assign to the second return value. | required |
n_seq_data | int | Number of last interactions to provide as unlabeled data for model to make prediction. Defaults to 1. | 1 |
Raises:
| Type | Description |
|---|---|
ValueError | If n is less than 1, as this would cause the ground truth data to be empty. |
Source code in src/streamsight/settings/splitters/n_last.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
n = n instance-attribute ¶
n_seq_data = n_seq_data instance-attribute ¶
name property ¶
Return the class name of the splitter.
Returns:
| Type | Description |
|---|---|
str | The splitter class name. |
identifier property ¶
Return a string identifier including the splitter's parameters.
The identifier includes the class name and a comma-separated list of attribute name/value pairs from self.__dict__.
Returns:
| Type | Description |
|---|---|
str | Identifier string like |
split(data) ¶
Source code in src/streamsight/settings/splitters/n_last.py
33 34 35 36 37 38 39 | |