# coding: utf-8

"""
    Mixpeek API

    This is the Mixpeek API, providing access to various endpoints for data processing and retrieval.

    The version of the OpenAPI document: 1.3.0
    Contact: info@mixpeek.com
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self


class LearningAlgorithm(str, Enum):
    """
    Algorithms for learning feature fusion weights from feedback.  ┌─────────────────────────────────────────────────────────────────────────────┐ │ ALGORITHM COMPARISON                                                         │ ├───────────────────┬─────────────────────────────────────────────────────────┤ │ Algorithm         │ Description                                             │ ├───────────────────┼─────────────────────────────────────────────────────────┤ │ thompson_sampling │ Beta-Bernoulli bandit, natural exploration, no tuning  │ │ epsilon_greedy    │ (Future) Simple ε-greedy exploration                   │ │ ucb               │ (Future) Upper Confidence Bound with guarantees        │ └───────────────────┴─────────────────────────────────────────────────────────┘  THOMPSON_SAMPLING (Recommended):     - Beta-Bernoulli bandit with probabilistic exploration     - Works immediately with uniform priors (α=1, β=1)     - No hyperparameter tuning required     - Natural exploration/exploitation balance via sampling     - Converges to optimal weights as feedback accumulates     - Best for: Binary feedback (click/no-click), most use cases  How it works:     1. Each feature has Beta(α, β) distribution     2. Sample weight from each distribution before search     3. Apply sampled weights to fusion     4. On positive feedback (click): increment α for strong features     5. On no feedback: increment β for features in shown docs     6. Distribution shifts toward effective features over time
    """

    """
    allowed enum values
    """
    THOMPSON_SAMPLING = 'thompson_sampling'
    EPSILON_GREEDY = 'epsilon_greedy'
    UCB = 'ucb'

    @classmethod
    def from_json(cls, json_str: str) -> Self:
        """Create an instance of LearningAlgorithm from a JSON string"""
        return cls(json.loads(json_str))


