old_scripts/info_reduc.py
def random_error(train, test):
    """
    Given training and testing data, this script runs some ML algorithms
    to predict burnup in the face of reduced information

    Parameters 
    ---------- 
    
    train : group of dataframes that include training instances and the labels
    test : group of dataframes that has the testing instances and the labels

    Returns
    -------
    burnup : tuple of different error metrics for training, testing, and cross validation 
             errors for all three algorithms

    """
    
    mape_cols = ['TrainNegPercent', 'TestNegPercent', 'CVNegPercent']
    rmse_cols = ['TrainNegRMSErr', 'TestNegRMSErr', 'CVNegRMSErr']
    mae_cols = ['TrainNegMAErr', 'TestNegMAErr', 'CVNegMAErr']

    trainX = train.nuc_concs
    trainY = train.burnup
    testX = test.nuc_concs
    testY = test.burnup
    
    #err_percent = np.arange(0, 9.25, 0.25)
    err_percent = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 
                   1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.25, 2.5, 
                   2.75, 3, 3.25, 3.5, 3.75, 4, 4.25, 4.5, 4.75, 5, 5.5, 6, 
                   6.5, 7, 7.5, 8, 8.5, 9]
    for alg in (nn, rr, svr):
        map_err = []
        rms_err = []
        ma_err = []
        for err in err_percent:
            trainX = add_error(err, trainX)
            # *_err format for each err type is [train, test, cv]
            mape, rmse, mae = pred_errs(trainX, trainY, testX, testY,  alg)
            map_err.append(mape)
            rms_err.append(rmse)
            ma_err.append(mae)
        mape = pd.DataFrame(map_err, columns=mape_cols, index=err_percent)
        rmse = pd.DataFrame(rms_err, columns=rmse_cols, index=err_percent)
        mae = pd.DataFrame(ma_err, columns=mae_cols, index=err_percent)
        errors = pd.concat([mape, rmse, mae], axis=1)
        if alg == nn:
            errors.to_csv('nn_inforeduc.csv')
        elif alg == rr:
            errors.to_csv('rr_inforeduc.csv')
        else:
            errors.to_csv('svr_inforeduc_defaults.csv')
    
    return

    Given training and testing data, this script runs some ML algorithms
    to predict burnup in the face of reduced information

    Parameters 
    ---------- 
    
    train : group of dataframes that include training instances and the labels
    test : group of dataframes that has the testing instances and the labels

    Returns
    -------
    burnup : tuple of different error metrics for training, testing, and cross validation 
             errors for all three algorithms

    
Given training and testing data, this script runs some ML algorithms
to predict burnup in the face of reduced information
Given training and testing data this script runs some ML algorithms to predict burnup in the face of reduced information
def random_error(train, test):
    mape_cols = ['TrainNegPercent', 'TestNegPercent', 'CVNegPercent']
    rmse_cols = ['TrainNegRMSErr', 'TestNegRMSErr', 'CVNegRMSErr']
    mae_cols = ['TrainNegMAErr', 'TestNegMAErr', 'CVNegMAErr']
    trainX = train.nuc_concs
    trainY = train.burnup
    testX = test.nuc_concs
    testY = test.burnup
    err_percent = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.1, 
                   1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.25, 2.5, 
                   2.75, 3, 3.25, 3.5, 3.75, 4, 4.25, 4.5, 4.75, 5, 5.5, 6, 
                   6.5, 7, 7.5, 8, 8.5, 9]
    for alg in (nn, rr, svr):
        map_err = []
        rms_err = []
        ma_err = []
        for err in err_percent:
            trainX = add_error(err, trainX)
            mape, rmse, mae = pred_errs(trainX, trainY, testX, testY,  alg)
            map_err.append(mape)
            rms_err.append(rmse)
            ma_err.append(mae)
        mape = pd.DataFrame(map_err, columns=mape_cols, index=err_percent)
        rmse = pd.DataFrame(rms_err, columns=rmse_cols, index=err_percent)
        mae = pd.DataFrame(ma_err, columns=mae_cols, index=err_percent)
        errors = pd.concat([mape, rmse, mae], axis=1)
        if alg == nn:
            errors.to_csv('nn_inforeduc.csv')
        elif alg == rr:
            errors.to_csv('rr_inforeduc.csv')
        else:
            errors.to_csv('svr_inforeduc_defaults.csv')
    return
def random_error ( train , test ) : mape_cols = [ 'TrainNegPercent' , 'TestNegPercent' , 'CVNegPercent' ] rmse_cols = [ 'TrainNegRMSErr' , 'TestNegRMSErr' , 'CVNegRMSErr' ] mae_cols = [ 'TrainNegMAErr' , 'TestNegMAErr' , 'CVNegMAErr' ] trainX = train . nuc_concs trainY = train . burnup testX = test . nuc_concs testY = test . burnup err_percent = [ 0 , 0.1 , 0.2 , 0.3 , 0.4 , 0.5 , 0.6 , 0.7 , 0.8 , 0.9 , 1 , 1.1 , 1.2 , 1.3 , 1.4 , 1.5 , 1.6 , 1.7 , 1.8 , 1.9 , 2.0 , 2.25 , 2.5 , 2.75 , 3 , 3.25 , 3.5 , 3.75 , 4 , 4.25 , 4.5 , 4.75 , 5 , 5.5 , 6 , 6.5 , 7 , 7.5 , 8 , 8.5 , 9 ] for alg in ( nn , rr , svr ) : map_err = [ ] rms_err = [ ] ma_err = [ ] for err in err_percent : trainX = add_error ( err , trainX ) mape , rmse , mae = pred_errs ( trainX , trainY , testX , testY , alg ) map_err . append ( mape ) rms_err . append ( rmse ) ma_err . append ( mae ) mape = pd . DataFrame ( map_err , columns = mape_cols , index = err_percent ) rmse = pd . DataFrame ( rms_err , columns = rmse_cols , index = err_percent ) mae = pd . DataFrame ( ma_err , columns = mae_cols , index = err_percent ) errors = pd . concat ( [ mape , rmse , mae ] , axis = 1 ) if alg == nn : errors . to_csv ( 'nn_inforeduc.csv' ) elif alg == rr : errors . to_csv ( 'rr_inforeduc.csv' ) else : errors . to_csv ( 'svr_inforeduc_defaults.csv' ) return
Given training and testing data, this script runs some ML algorithms
to predict burnup in the face of reduced information
Given training and testing data this script runs some ML algorithms to predict burnup in the face of reduced information
"""
    Given training and testing data, this script runs some ML algorithms
    to predict burnup in the face of reduced information

    Parameters 
    ---------- 
    
    train : group of dataframes that include training instances and the labels
    test : group of dataframes that has the testing instances and the labels

    Returns
    -------
    burnup : tuple of different error metrics for training, testing, and cross validation 
             errors for all three algorithms

    """ #err_percent = np.arange(0, 9.25, 0.25) # *_err format for each err type is [train, test, cv]
train
None
test
None
Returns
None
burnup
errors for all three algorithms
errors for all three algorithms