learn/optimize_hyperparameters.py
def parse_args(args):
    """
    Command-line argument parsing

    Parameters
    ----------
    args : system arguments entered on command line

    Returns
    -------
    args : parsed arguments

    """

    parser = argparse.ArgumentParser(description='Performs hyperparameter optimization for various machine learning algorithms.')
    
    parser.add_argument('rxtr_param', choices=['reactor', 'cooling', 'enrichment', 'burnup'], 
                        metavar='prediction-param', 
                        help='which reactor parameter is to be predicted [reactor, cooling, enrichment, burnup]')
    parser.add_argument('alg', choices=['knn', 'dtree', 'svm'], 
                        metavar='aglortithm', 
                        help='which algorithm to optimize [knn, dtree, svm]')
    parser.add_argument('db_desc', metavar='db-description', 
                        help='decsription of the database, e.g., d1_short')
    parser.add_argument('tset_frac', metavar='trainset-fraction', type=float,
                        help='fraction of training set to use in algorithms')
    parser.add_argument('cv', metavar='cv-folds', type=int,
                        help='number of cross validation folds')
    parser.add_argument('train_db', metavar='reactor-db', 
                        help='file path to a training set')

    return parser.parse_args(args)

    Command-line argument parsing

    Parameters
    ----------
    args : system arguments entered on command line

    Returns
    -------
    args : parsed arguments

    
Command-line argument parsing
Parameters

args : system arguments entered on command line

Returns

args : parsed arguments
Command - line argument parsing Parameters args : system arguments entered on command line Returns args : parsed arguments
def parse_args(args):
    parser = argparse.ArgumentParser(description='Performs hyperparameter optimization for various machine learning algorithms.')
    parser.add_argument('rxtr_param', choices=['reactor', 'cooling', 'enrichment', 'burnup'], 
                        metavar='prediction-param', 
                        help='which reactor parameter is to be predicted [reactor, cooling, enrichment, burnup]')
    parser.add_argument('alg', choices=['knn', 'dtree', 'svm'], 
                        metavar='aglortithm', 
                        help='which algorithm to optimize [knn, dtree, svm]')
    parser.add_argument('db_desc', metavar='db-description', 
                        help='decsription of the database, e.g., d1_short')
    parser.add_argument('tset_frac', metavar='trainset-fraction', type=float,
                        help='fraction of training set to use in algorithms')
    parser.add_argument('cv', metavar='cv-folds', type=int,
                        help='number of cross validation folds')
    parser.add_argument('train_db', metavar='reactor-db', 
                        help='file path to a training set')
    return parser.parse_args(args)
def parse_args ( args ) : parser = argparse . ArgumentParser ( description = 'Performs hyperparameter optimization for various machine learning algorithms.' ) parser . add_argument ( 'rxtr_param' , choices = [ 'reactor' , 'cooling' , 'enrichment' , 'burnup' ] , metavar = 'prediction-param' , help = 'which reactor parameter is to be predicted [reactor, cooling, enrichment, burnup]' ) parser . add_argument ( 'alg' , choices = [ 'knn' , 'dtree' , 'svm' ] , metavar = 'aglortithm' , help = 'which algorithm to optimize [knn, dtree, svm]' ) parser . add_argument ( 'db_desc' , metavar = 'db-description' , help = 'decsription of the database, e.g., d1_short' ) parser . add_argument ( 'tset_frac' , metavar = 'trainset-fraction' , type = float , help = 'fraction of training set to use in algorithms' ) parser . add_argument ( 'cv' , metavar = 'cv-folds' , type = int , help = 'number of cross validation folds' ) parser . add_argument ( 'train_db' , metavar = 'reactor-db' , help = 'file path to a training set' ) return parser . parse_args ( args )
Command-line argument parsing
Parameters
Command - line argument parsing Parameters
"""
    Command-line argument parsing

    Parameters
    ----------
    args : system arguments entered on command line

    Returns
    -------
    args : parsed arguments

    """
args