Source code for scope_rl.ope.weight_value_learning.base
# Copyright (c) 2023, Haruka Kiyohara, Ren Kishimoto, HAKUHODO Technologies Inc., and Hanjuku-kaso Co., Ltd. All rights reserved.
# Licensed under the Apache 2.0 License.
"""Abstract base class for weight and value learning."""
from abc import ABCMeta, abstractmethod
from dataclasses import dataclass
[docs]@dataclass
class BaseWeightValueLearner(metaclass=ABCMeta):
"""Base class for weight/value learning.
Imported as: :class:`scope_rl.ope.weight_value_learning.BaseWeightValueLearner`
"""
[docs] @abstractmethod
def save(self):
"""Save models."""
raise NotImplementedError
[docs] @abstractmethod
def load(self):
"""Load models."""
raise NotImplementedError
[docs] @abstractmethod
def fit(self):
"""Fit function approximation models."""
raise NotImplementedError
[docs] @abstractmethod
def predict(self):
"""Predict weights/values for the given state/state-action pair."""
raise NotImplementedError