Optimize multi objectives - Pool
- PyALAF.multi_optimize_pool.run_batch_learning_multi(models, aggregation_function, regression_models, acquisition_function='ideal', pool=None, batch_size=1, noise=0.1, initial_samples=2, active_learning_steps=10, lim_features=[-1, 1], feature_scaler='min_max', alpha=0, random_state=None, return_samples=False, initialization='random', test_set=None, poly_degree=3, custom_acfn_input={}, fictive_noise_level=0, calculate_test_metrics=True, single_update=False, verbose=False, **kwargs)[source]
Perform batch-mode Active Learning for a discrete parameter space. The algorithm picks automatically initial data points from a given pool of discrete possible data points for evaluation using either a random approach or the model-free GSx method.
- Parameters:
model (Model class) – Model to generate true data.
regression_model (sklearn model, str, optional) – scikit-learn regression model.
acquissition_function (str, optional) – Acquisition function. The default is ‘ideal’.
pool (nd_array, None, optional) – Array containing pool of data. All data is sampled from that pool. Data which is not sampled so far is used for calculating test metrics when test_set is None. The default is ‘None’.
batch_size (int, optional) – Batch size for Active Learning. The model is updated only with true data when a batch is completed. The default value is 1.
noise (float, optional) – Noise in observation. The default is 0.1.
initial_samples (int, optional) – Number of initial samples to draw from the pool. The default is 2.
active_learning_steps (int, optional) – Number of active learning steps to perform. The default is 10.
lim_features (list, optional) – Boundaries for model evaluation. Only used when pool=None. The default is [-1,1].
alpha (float) – Hyperparameter for acquisition function. The default is 0.
random_state (int, optional) – Set random state. The default is None.
return_samples (bool, optional) – Whether to return the samples drawn so far. The default is False.
initialization (str, optional) – Initialization method for generating initial data. Choose from ‘random’ and ‘GSx’. ‘random’ uses Latin Hypercube sampling to generate the initial data points. ‘GSx’ draws randomly the first data point and then uses the model-free GSx method to sample the other initial data points. The default value is ‘random’.
test_set (nd_array, optional) – Array containing explicit data points for testindata_model. If it is ‘None’ all unsampled data points in the pool will be used for testing. The default value is ‘None’.
calculate_test_metrics (bool, optional) – Can be used for testing Active Learning algorithms for known models. Test metrics are calculated automatically. If ‘False’ no test metrics are calculated and the AL runs in deployement mode.
single_update (bool, optional) – Whether to stop the Active Learning after the first iteration. The default value is False.
custom_acfn_input (dict) – Dictionary that contains which information is used by a custom acquisition function.
- Returns:
results (pd_DataFrame) – Pandas DataFrame containing the columns: ‘m’, ‘mean_mse_test’, ‘max_observation’. Data is stored for each active learning step, where ‘m’ gives the number of data used for training, ‘mean_mse_test’ the MSE of the test set and ‘max_observation’ the maximum value observed so far.
sample_x (nd_array, optional) – Array that contains the sampled data points (in terms of their features). Only returned when return_samples is True.