Active Learning Module#
The active learning module contains components for intelligent data point selection.
Active learning module for electromagnetic field optimization.
This module implements active learning strategies to efficiently select the most informative data points for training electromagnetic field prediction models.
- class EMFieldML.ActiveLearning.ActiveLearning.ActiveLearning#
Bases:
objectActive learning strategies for electromagnetic field model optimization.
This class implements methods to select the most informative data points for training, improving model performance with minimal data.
- static pre_deviation(input_path_y_data: Path, input_path_model: Path, x_train_data: numpy.ndarray, test_data_list: list[int], point_index: int)#
Calculate deviation for active learning point selection.
Identify and select test data samples that show a large variance with respect to the current model’s predictions.
- Parameters:
input_path_y_data – Path to training target data
input_path_model – Path to trained model file
x_train_data – Training input features
test_data_list – List of test data indices
point_index – Index of prediction point
- Returns:
Average and maximum deviation values
Note
This function corresponds to 5 steps in Figure 5a of the paper.
- static active_learning(X_test_list, predict_point_list)#
Perform active learning process.
Active learning iteratively selects instances from the test set that have high prediction uncertainty for the current model. These difficult cases are then used to retrain the model. This active learning approach enables the efficient creation of a robust model, particularly in scenarios where generating a large and diverse training dataset is difficult.
- Parameters:
X_test_list – List of test data points
predict_point_list – List of points to predict
- Returns:
List of selected data points for training
Note
This function corresponds to Figure 5a in the paper.
- static uncertainly_sampling()#
Perform uncertainty sampling for active learning.
Iteratively selects data points with high prediction uncertainty, runs simulations for these points, and updates the training dataset.
Note
This function corresponds to step 6 in Figure 5a of the paper.
Module for deciding 6 points in active learning.
- class EMFieldML.ActiveLearning.Decide6points.Decide6points#
Bases:
objectClass for deciding 6 points in active learning process.
- static get_pattern(i: int, j: int, k: int) int#
Divide the entire space into 27 blocks. i corresponds to x, j corresponds to y, and k corresponds to z. The if statements are complex to account for overlapping regions.
- static make_pattern_list() None#
Assign each point to a block one by one. Exclude those that overlap with the ferrite shield.