jijzepttools.blackbox_optimization.surrogate_model.bfmo_surrogate_model#
Classes#
Parameters for the Bayesian Factorization Machine surrogate model. |
|
Bayesian Factorization Machine (BFM) surrogate model. |
Module Contents#
- class BFMParams#
Bases:
jijzepttools.blackbox_optimization.surrogate_model.interface.SurrogateModelParams
Parameters for the Bayesian Factorization Machine surrogate model.
init_stdev, alpha0, beta0, gamma_0, mu_0, reg_0の詳細は以下を参照 参考: tohtsky/myFM
- latent_dim#
Dimension of latent factors.
- Type:
int, default=5
- tune#
Number of burn-in sweeps for Gibbs sampling.
- Type:
int, default=100
- draws#
Number of samples to average after burn-in.
- Type:
int, default=10
- init_stdev#
FMのパラメータ初期値の標準偏差
- Type:
float
- alpha0, beta0
alpha, lambda_w, lambda_vの事前ガンマ分布の形状を決定するパラメータ
- Type:
float
- gamma_0#
パラメータの正規事前分布の平均mu_w, mu_vが従うハイパー事前分布(正規分布)の精度
- Type:
float
- mu_0#
パラメータの正規事前分布の平均mu_w, mu_vが従うハイパー事前分布(正規分布)の平均
- Type:
float
- reg_0#
バイアス項 w0が従う正規事前分布の精度
- Type:
float
- latent_dim: int = 5#
- tune: int = 100#
- draws: int = 10#
- init_stdev: float = 0.1#
- alpha_0: float = 1.0#
- beta_0: float = 1.0#
- gamma_0: float = 1.0#
- mu_0: float = 0.0#
- reg_0: float = 1.0#
- class BFMSurrogateModel(params: BFMParams | None = None, random_seed: int = 42)#
Bases:
jijzepttools.blackbox_optimization.surrogate_model.interface.SurrogateModel
Bayesian Factorization Machine (BFM) surrogate model.
This model wraps the BFM implementation and provides the SurrogateModel interface. It’s effective for problems where interactions between variables are important.
- Parameters:
params (BFMParams, optional) – Parameters for the model. If None, default parameters are used.
- params = None#
- bfm_regressor#
- fit(x: numpy.ndarray, y: numpy.ndarray) None #
Fit the BFM model to the data using Gibbs sampling.
- Parameters:
x (np.ndarray, shape (n_samples, n_features)) – Input features.
y (np.ndarray, shape (n_samples,)) – Target values.
- predict(x: numpy.ndarray) numpy.ndarray #
Predict target values using the fitted BFM model.
- surrogate_to_ommx_objective(decision_variables: list[ommx.v1.DecisionVariable])#
Create an OMMX expression from the fitted BFM model.
- Parameters:
decision_variables (list[ommx.v1.DecisionVariable]) – Decision variables from the OMMX instance.