mirror of
https://github.com/velocitatem/PHANTOM.git
synced 2026-05-31 16:43:36 +00:00
feature: introducing pricing predictors (pricers)
This commit is contained in:
28
experiments/procesing/pricers/base.py
Normal file
28
experiments/procesing/pricers/base.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from abc import ABC, abstractmethod
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
|
||||
|
||||
class PricingFunction(ABC):
|
||||
"""
|
||||
Abstract base for pricing functions.
|
||||
Defines the mapping f: StateSpace -> prices
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def fit(self, historical_data: pd.DataFrame):
|
||||
"""Train/calibrate the pricing function on historical data"""
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def predict(self, state_space) -> np.ndarray:
|
||||
"""
|
||||
Generate prices given current state space.
|
||||
|
||||
Args:
|
||||
state_space: StateSpace object containing demand, prices, session features
|
||||
|
||||
Returns:
|
||||
prices: price vector P_{t+1} in R^n
|
||||
"""
|
||||
pass
|
||||
Reference in New Issue
Block a user