Skip to content

constant

AlgorithmStateEnum

Bases: StrEnum

Enum for the state of the algorithm.

Used to keep track of the state of the algorithm during the streaming process in the EvaluatorStreamer.

Source code in src/recnexteval/evaluators/core/constant.py
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
class AlgorithmStateEnum(StrEnum):
    """Enum for the state of the algorithm.

    Used to keep track of the state of the algorithm during the streaming
    process in the `EvaluatorStreamer`.
    """

    NEW = "NEW"
    READY = "READY"
    RUNNING = "RUNNING"
    PREDICTED = "PREDICTED"
    COMPLETED = "COMPLETED"

NEW = 'NEW' class-attribute instance-attribute

READY = 'READY' class-attribute instance-attribute

RUNNING = 'RUNNING' class-attribute instance-attribute

PREDICTED = 'PREDICTED' class-attribute instance-attribute

COMPLETED = 'COMPLETED' class-attribute instance-attribute

MetricLevelEnum

Bases: StrEnum

Source code in src/recnexteval/evaluators/core/constant.py
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class MetricLevelEnum(StrEnum):
    MICRO = "micro"
    MACRO = "macro"
    WINDOW = "window"
    USER = "user"

    @classmethod
    def has_value(cls, value: str) -> bool:
        """Check valid value for MetricLevelEnum.

        Args:
            value: String value input.

        Returns:
            Whether the value is valid.
        """
        return value in MetricLevelEnum

MICRO = 'micro' class-attribute instance-attribute

MACRO = 'macro' class-attribute instance-attribute

WINDOW = 'window' class-attribute instance-attribute

USER = 'user' class-attribute instance-attribute

has_value(value) classmethod

Check valid value for MetricLevelEnum.

Parameters:

Name Type Description Default
value str

String value input.

required

Returns:

Type Description
bool

Whether the value is valid.

Source code in src/recnexteval/evaluators/core/constant.py
24
25
26
27
28
29
30
31
32
33
34
@classmethod
def has_value(cls, value: str) -> bool:
    """Check valid value for MetricLevelEnum.

    Args:
        value: String value input.

    Returns:
        Whether the value is valid.
    """
    return value in MetricLevelEnum