pyMAISE API Reference

pyMAISE offers ML generation and evaluation using five processes:

  1. settings,

  2. data sets,

  3. preprocessing,

  4. hyperparameter tuning,

  5. postprocessing.

These processes allow you to define models of interest, tune them to your or one of the data sets within pMAISE, and assess their performance. Use this page for further information on a specific function or class. Feel free to click on the functions or classes to see their docstrings outlining arguments, outputs, and use.

Settings

Every pyMAISE script begins with defining some global settings used throughout the package. This is done through the pyMAISE.init() function, where you can define the pyMAISE.ProblemType, level of output from pyMAISE, the number of hyperparameter configurations saved for each model, and more.

Functions

pyMAISE.init

Initialize pyMAISE global settings.

Classes

pyMAISE.ProblemType

Enum to define the problem type.

Data Sets

pyMAISE includes several benchmark data sets used in the benchmark notebooks, which also serve as example notebooks when using pyMAISE. These data sets derive from several nuclear engineering applications and originate from literature. For information on the data sets past what is given here and in the function’s documentation, refer to the data references.

Each of these load functions exits under the pyMAISE.datasets module. To import the MIT reactor data, for example, we can do the following:

from pyMAISE.datasets import load_MITR

From pyMAISE, we cannot directly access the data set load functions.

Functions

pyMAISE.datasets.load_MITR

Load MIT reactor data.

pyMAISE.datasets.load_xs

Load reactor physics data.

pyMAISE.datasets.load_fp

Load fuel performance data.

pyMAISE.datasets.load_heat

Load the heat conduction data.

pyMAISE.datasets.load_BWR

Load BWR Micro Core data.

pyMAISE.datasets.load_HTGR

Load HTGR Micro Reactor data.

pyMAISE.datasets.load_rea

Load NEACRP C1 rod ejection accident (REA) data.

pyMAISE.datasets.load_chf

Load Critical Heat Flux (CHF) synthetic data.

pyMAISE.datasets.load_loca

Load loss of coolant accident (LOCA) time series data.

pyMAISE.datasets.load_anomaly

Load time series electronic signal data from Mendeley provided by [RPW+23, RPW+22].

Preprocessing

Using one of the provided data sets or your own, you can utilize the preprocessing module to read data from a CSV file, split it into training and testing data, and scale it. This module also offers methods specific to classification problems, such as one hot encoding. You can use pyMAISE.preprocessing.SplitSequence to create rolling windows of your time series data and create a correlation matrix.

Like the data sets, the pyMAISE.preprocessing module functions cannot be accessed from pyMAISE. So we import functions using:

from pyMAISE.preprocessing import train_test_split, scale_data

Warning

For multiclass classification problems, the output must be one hot-encoded for neural network models.

Functions

pyMAISE.preprocessing.read_csv

Read comma-separated values (csv) file into xarray.DataArray.

pyMAISE.preprocessing.train_test_split

Split data into training and testing data sets.

pyMAISE.preprocessing.scale_data

Scale training and testing data using the scaler provided.

pyMAISE.preprocessing.one_hot_encode

One hot encode multiclass classification data.

pyMAISE.preprocessing.correlation_matrix

Create a correlation matrix for a data set.

Classes

pyMAISE.preprocessing.SplitSequence

Split sequence function for rolling windows of time series data.

Tuning

The pyMAISE.Tuner allows you to specify models for hyperparameter tuning and the tuning method you’d like to use. Additionally, the class offers the pyMAISE.Tuner.convergence_plot() method for plotting the tuning methods results.

Classes

pyMAISE.Tuner

Hyperparameter tuning object.

Hyperparameters

When initializing a neural network model, you can use these classes so pyMAISE knows which hyperparameters you would like to tune.

Classes

pyMAISE.Int

Define an integer hyperparameter.

pyMAISE.Float

Define an floating point hyperparameter.

pyMAISE.Choice

Define choice hyperparameter.

pyMAISE.Boolean

Define a boolean hyperparameter.

pyMAISE.Fixed

Define fixed hyperparameter.

Postprocessing

Following the tuning of the specified models. You can use the pyMAISE.PostProcessor to access the performance of your models. This offers the ability to fit the models with different hyperparameters such as more epochs and access their performance metrics on both training and testing data. There are additional getters and visualization tools for in-depth evaluation.

Classes

pyMAISE.PostProcessor

Assess the performance of the top-performing models.