Prediction Functions
Functions to build and use predictive Deep Neural Networks to find plasma pedestal heights.
- predict.build_and_test_single(csv_name, input_cols, output_col, plot_col=None, learning_rate=None, epochs=None, batch_size=None, maxoutput=None)
Build and test a model predicting a single column of data from multiple input columns. Calculate the mean squared error of model predictions.
- Parameters
csv_name (string) – filename of csv.
input_cols (list) – list of column names (as strings) of engineering parameters to predict from.
output_col (string) – name of column you’d like to predict.
plot_col (string) – optional. Name of column you’d like to plot your predictions against, selected from the engineering parameters.
learning_rate (integer) – optional. Value from 0.1 - 0.0001 representing the learning rate of the Keras Adam optimizer. Documentation for the Adam optimizer can be found here: https://keras.io/api/optimizers/adam/.
epochs (integer) – optional. Number of epochs for training the DNN. Typical starting values may be 50 for a smaller dataset up to 500 for a large dataset. If not given, the function will use a default value of 50.
batch_size (integer) – optional. Batch size for training the DNN, either 8, 16, 32 or 64. Smaller batch sizes may give more accurate predictions but take more time. If not given, the function will use a default value of 8.
maxoutput (Boolean) – optional. Set equal to True to display a more detailed output, useful for debugging.
- Returns
pedestal height predictions. integer: mean squared error of these predictions. Tensorflow Model: trained DNN model.
- Return type
array
- predict.get_train_test_data(dataset)
Split a chosen dataset randomly into an 80/20 train-test split. Display Numpy shapes of train and test data.
- Parameters
dataset (string) – filename of csv.
- Returns
training data. array: test data.
- Return type
array
- predict.predict_single(model, filename, input_cols)
Predict pedestal heights using a trained DNN created with build_and_test_single.
- Parameters
model (Tensorflow Model) – trained DNN from build_and_test_single to predict a column with.
input_cols (array) – input columns to apply the trained model on.
- Returns
predicted pedestal heights.
- Return type
array