SurrogateModel#

class obsidian.surrogates.base.SurrogateModel(model_type: str = 'GP', seed: int | None = None, verbose: bool = False)[source]#

Bases: ABC

The model used for conducting optimization. Consumes data and produces a regressed representation of that system. Model can then be used to make predictions or evaluate uncertainty.

is_fit#

Flag for fitting (e.g. to prevent predicting from an unfit model).

Type:

bool

model_type#

The type of the model.

Type:

str

train_X#

The input data for the training data.

Type:

pd.DataFrame

train_Y#

The target data for the training data.

Type:

pd.Series

cat_dims#

The categorical dimensions of the data.

Type:

list

task_feature#

The task feature of the data.

Type:

str

X_order#

The order of the columns in the input data.

Type:

list

y_name#

The name of the target column.

Type:

str

seed#

Randomization seed for stochastic surrogate models.

Type:

int

verbose#

Flag for monitoring and debugging optimization

Type:

bool

__init__(model_type: str = 'GP', seed: int | None = None, verbose: bool = False)[source]#

Methods

__init__([model_type, seed, verbose])

fit(X, y)

Fit the surrogate model to data

load_state(obj_dict)

Load the model from a state dictionary

predict(X)

Predict outputs based on candidates X

save_state()

Save the model to a state dictionary

score(X, y)

Score the model based on the given test data

abstract fit(X: DataFrame, y: Series)[source]#

Fit the surrogate model to data

abstract classmethod load_state(obj_dict: dict)[source]#

Load the model from a state dictionary

abstract predict(X: DataFrame)[source]#

Predict outputs based on candidates X

abstract save_state()[source]#

Save the model to a state dictionary

abstract score(X: DataFrame, y: Series)[source]#

Score the model based on the given test data