def validate_model_configuration(classifier_model_name, classifier_model_config, regressor_model_name, regressor_model_config, config_index, train_scaled_input, train_labels, train_scaled_output, val_scaled_input, val_labels, val_scaled_output, classifier_metric_list, regressor_metric_list):
    '\n    Train a single machine learning model configuration to predict each microphysical tendency.\n\n    Args:\n        classifier_model_name:\n        classifier_model_config:\n        regressor_model_name:\n        regressor_model_config:\n        config_index:\n        train_scaled_input:\n        train_labels:\n        train_scaled_output:\n        val_scaled_input:\n        val_labels:\n        val_scaled_output:\n        classifier_metric_list:\n        regressor_metric_list:\n\n    Returns:\n\n    '
    from mlmicrophysics.models import DenseNeuralNetwork, DenseGAN
    import keras.backend as K
    metrics = {'mse': mean_squared_error, 'mae': mean_absolute_error, 'r2': r2_score, 'hellinger': hellinger_distance, 'acc': accuracy_score, 'hss': heidke_skill_score, 'pss': peirce_skill_score}
    sess = K.tf.Session(config=K.tf.ConfigProto(intra_op_parallelism_threads=1, inter_op_parallelism_threads=1))
    K.set_session(sess)
    with sess.as_default():
        model_classes = {'RandomForestRegressor': RandomForestRegressor, 'RandomForestClassifier': RandomForestClassifier, 'DenseNeuralNetwork': DenseNeuralNetwork, 'DenseGAN': DenseGAN}
        classifier_models = {}
        regressor_models = {}
        output_label_preds = pd.DataFrame(0, index=val_labels.index, columns=val_labels.columns, dtype=np.int32)
        output_preds = pd.DataFrame(0, index=val_scaled_output.index, columns=val_scaled_output.columns, dtype=np.float32)
        output_regressor_preds = pd.DataFrame(0, index=val_scaled_output.index, columns=val_scaled_output.columns, dtype=np.float32)
        output_metric_columns = []
        for output_col in train_scaled_output.columns:
            for metric in classifier_metric_list:
                output_metric_columns.append(((output_col + '_') + metric))
            for metric in regressor_metric_list:
                output_metric_columns.append(((output_col + '_') + metric))
            unique_labels = np.unique(train_labels[output_col])
            for unique_label in unique_labels:
                for metric in regressor_metric_list:
                    output_metric_columns.append(f'{output_col}_{unique_label}_{metric}')
        output_metrics = pd.Series(index=output_metric_columns, name=config_index, dtype=np.float32)
        for output_col in train_scaled_output.columns:
            print(output_col)
            unique_labels = np.unique(train_labels[output_col])
            if (unique_labels.size > 1):
                if (classifier_model_name in ['DenseNeuralNetwork', 'DenseGAN']):
                    classifier_models[output_col] = model_classes[classifier_model_name](outputs=unique_labels.size, classifier=True, **classifier_model_config)
                else:
                    classifier_models[output_col] = model_classes[classifier_model_name](**classifier_model_config)
                classifier_models[output_col].fit(train_scaled_input, train_labels[output_col])
                output_label_preds.loc[:, output_col] = classifier_models[output_col].predict(val_scaled_input)
                for metric in classifier_metric_list:
                    output_metrics[((output_col + '_') + metric)] = metrics[metric](val_labels[output_col].values, output_label_preds[output_col].values)
            else:
                output_label_preds.loc[:, output_col] = unique_labels[0]
            regressor_models[output_col] = {}
            for label in unique_labels:
                if (label != 0):
                    if (regressor_model_name in ['DenseNeuralNetwork', 'DenseGAN']):
                        regressor_models[output_col][label] = model_classes[regressor_model_name](classifier=False, **regressor_model_config)
                    else:
                        regressor_models[output_col][label] = model_classes[regressor_model_name](**regressor_model_config)
                    regressor_models[output_col][label].fit(train_scaled_input.loc[(train_labels[output_col] == label)], train_scaled_output.loc[((train_labels[output_col] == label), output_col)])
                    if (np.count_nonzero((output_label_preds[output_col] == label)) > 0):
                        output_preds.loc[((output_label_preds[output_col] == label), output_col)] = regressor_models[output_col][label].predict(val_scaled_input.loc[(output_label_preds[output_col] == label)])
                    output_regressor_preds.loc[((val_labels[output_col] == label), output_col)] = regressor_models[output_col][label].predict(val_scaled_input.loc[(val_labels[output_col] == label)])
                    for metric in regressor_metric_list:
                        output_metrics[f'{output_col}_{label}_{metric}'] = metrics[metric](val_scaled_output.loc[((val_labels[output_col] == label), output_col)].values, output_regressor_preds.loc[((val_labels[output_col] == label), output_col)].values)
            for metric in regressor_metric_list:
                output_metrics[((output_col + '_') + metric)] = metrics[metric](val_scaled_output[output_col].values, output_preds[output_col].values)
    return output_metrics
Train a single machine learning model configuration to predict each microphysical tendency.

Args:
    classifier_model_name:
    classifier_model_config:
    regressor_model_name:
    regressor_model_config:
    config_index:
    train_scaled_input:
    train_labels:
    train_scaled_output:
    val_scaled_input:
    val_labels:
    val_scaled_output:
    classifier_metric_list:
    regressor_metric_list:

Returns:
def validate_model_configuration(classifier_model_name, classifier_model_config, regressor_model_name, regressor_model_config, config_index, train_scaled_input, train_labels, train_scaled_output, val_scaled_input, val_labels, val_scaled_output, classifier_metric_list, regressor_metric_list):
    '\n    Train a single machine learning model configuration to predict each microphysical tendency.\n\n    Args:\n        classifier_model_name:\n        classifier_model_config:\n        regressor_model_name:\n        regressor_model_config:\n        config_index:\n        train_scaled_input:\n        train_labels:\n        train_scaled_output:\n        val_scaled_input:\n        val_labels:\n        val_scaled_output:\n        classifier_metric_list:\n        regressor_metric_list:\n\n    Returns:\n\n    '
    from mlmicrophysics.models import DenseNeuralNetwork, DenseGAN
    import keras.backend as K
    metrics = {'mse': mean_squared_error, 'mae': mean_absolute_error, 'r2': r2_score, 'hellinger': hellinger_distance, 'acc': accuracy_score, 'hss': heidke_skill_score, 'pss': peirce_skill_score}
    sess = K.tf.Session(config=K.tf.ConfigProto(intra_op_parallelism_threads=1, inter_op_parallelism_threads=1))
    K.set_session(sess)
    with sess.as_default():
        model_classes = {'RandomForestRegressor': RandomForestRegressor, 'RandomForestClassifier': RandomForestClassifier, 'DenseNeuralNetwork': DenseNeuralNetwork, 'DenseGAN': DenseGAN}
        classifier_models = {}
        regressor_models = {}
        output_label_preds = pd.DataFrame(0, index=val_labels.index, columns=val_labels.columns, dtype=np.int32)
        output_preds = pd.DataFrame(0, index=val_scaled_output.index, columns=val_scaled_output.columns, dtype=np.float32)
        output_regressor_preds = pd.DataFrame(0, index=val_scaled_output.index, columns=val_scaled_output.columns, dtype=np.float32)
        output_metric_columns = []
        for output_col in train_scaled_output.columns:
            for metric in classifier_metric_list:
                output_metric_columns.append(((output_col + '_') + metric))
            for metric in regressor_metric_list:
                output_metric_columns.append(((output_col + '_') + metric))
            unique_labels = np.unique(train_labels[output_col])
            for unique_label in unique_labels:
                for metric in regressor_metric_list:
                    output_metric_columns.append(f'{output_col}_{unique_label}_{metric}')
        output_metrics = pd.Series(index=output_metric_columns, name=config_index, dtype=np.float32)
        for output_col in train_scaled_output.columns:
            print(output_col)
            unique_labels = np.unique(train_labels[output_col])
            if (unique_labels.size > 1):
                if (classifier_model_name in ['DenseNeuralNetwork', 'DenseGAN']):
                    classifier_models[output_col] = model_classes[classifier_model_name](outputs=unique_labels.size, classifier=True, **classifier_model_config)
                else:
                    classifier_models[output_col] = model_classes[classifier_model_name](**classifier_model_config)
                classifier_models[output_col].fit(train_scaled_input, train_labels[output_col])
                output_label_preds.loc[:, output_col] = classifier_models[output_col].predict(val_scaled_input)
                for metric in classifier_metric_list:
                    output_metrics[((output_col + '_') + metric)] = metrics[metric](val_labels[output_col].values, output_label_preds[output_col].values)
            else:
                output_label_preds.loc[:, output_col] = unique_labels[0]
            regressor_models[output_col] = {}
            for label in unique_labels:
                if (label != 0):
                    if (regressor_model_name in ['DenseNeuralNetwork', 'DenseGAN']):
                        regressor_models[output_col][label] = model_classes[regressor_model_name](classifier=False, **regressor_model_config)
                    else:
                        regressor_models[output_col][label] = model_classes[regressor_model_name](**regressor_model_config)
                    regressor_models[output_col][label].fit(train_scaled_input.loc[(train_labels[output_col] == label)], train_scaled_output.loc[((train_labels[output_col] == label), output_col)])
                    if (np.count_nonzero((output_label_preds[output_col] == label)) > 0):
                        output_preds.loc[((output_label_preds[output_col] == label), output_col)] = regressor_models[output_col][label].predict(val_scaled_input.loc[(output_label_preds[output_col] == label)])
                    output_regressor_preds.loc[((val_labels[output_col] == label), output_col)] = regressor_models[output_col][label].predict(val_scaled_input.loc[(val_labels[output_col] == label)])
                    for metric in regressor_metric_list:
                        output_metrics[f'{output_col}_{label}_{metric}'] = metrics[metric](val_scaled_output.loc[((val_labels[output_col] == label), output_col)].values, output_regressor_preds.loc[((val_labels[output_col] == label), output_col)].values)
            for metric in regressor_metric_list:
                output_metrics[((output_col + '_') + metric)] = metrics[metric](val_scaled_output[output_col].values, output_preds[output_col].values)
    return output_metrics