old_scripts/learnme_linear.py
def validation_curves(X, rY, cY, eY, bY, nuc_subset):
    """
    
    Given training data, this script runs some ML algorithms
    (currently, this is 2 linear models with 2 error metrics) 
    for each prediction category: reactor type, cooling time, enrichment, 
    and burnup. Learning curves are also generated; comment out if unecessary

    Parameters 
    ---------- 
    
    X : dataframe that includes all training data
    *Y : series with labels for training data

    Returns
    -------
    reactor*.csv : accuracy for l1 & l2 norms
    cooling*.csv : negative error for l1 & l2 norms
    enrichment*.csv : negative error for l1 & l2 norms
    burnup*.csv : negative error for l1 & l2 norms

    """    

    #####################
    ## Learning Curves ##
    #####################
    alpha = 0.1
    rxtr_lc  = lc_classification(X, rY, alpha, cv_folds)
    cool_lc= lc_regression(X, cY, alpha, cv_folds)
    enr_lc = lc_regression(X, eY, alpha, cv_folds)
    burn_lc = lc_regression(X, bY, alpha, cv_folds)
    r_lc = 'lc_' + 'reactor' + nucs_tracked + train_src + '.csv'
    c_lc = 'lc_' + 'cooling' + nucs_tracked + train_src + '.csv'
    e_lc = 'lc_' + 'enrichment' + nucs_tracked + train_src + '.csv'
    b_lc = 'lc_' + 'burnup' + nucs_tracked + train_src + '.csv'
    idx_lc = TRAINSET_SIZES
    pd.DataFrame(rxtr_lc, columns=cols, index=idx_lc).to_csv(r_lc)
    pd.DataFrame(cool_lc, columns=cols, index=idx_lc).to_csv(c_lc)
    pd.DataFrame(enr_lc, columns=cols, index=idx_lc).to_csv(e_lc)
    pd.DataFrame(burn_lc, columns=cols, index=idx_lc).to_csv(b_lc)
    
    #######################
    ## Validation Curves ##
    #######################
    alist = (0.001, 0.005, 0.01, 0.02, 0.04, 0.06, 0.08, 0.1, 0.2, 0.4, 0.6, 
             0.8, 1, 1.3, 1.7, 2, 5, 10, 50, 100
             )
    rxtr_vc = classification(X, rY, alist, cv_folds)
    cool_vc = regression(X, cY, alist, cv_folds)
    enr_vc = regression(X, eY, alist, cv_folds)
    burn_vc = regression(X, bY, alist, cv_folds)

    idx_vc = alist
    r_vc = 'vc_' + 'reactor' + nucs_tracked + train_src + '.csv'
    c_vc = 'vc_' + 'cooling' + nucs_tracked + train_src + '.csv'
    e_vc = 'vc_' + 'enrichment' + nucs_tracked + train_src + '.csv'
    b_vc = 'vc_' + 'burnup' + nucs_tracked + train_src + '.csv'
    pd.DataFrame(rxtr_vc, columns=cols, index=idx_vc).to_csv(r_vc)
    pd.DataFrame(cool_vc, columns=cols, index=idx_vc).to_csv(c_vc)
    pd.DataFrame(enr_vc, columns=cols, index=idx_vc).to_csv(e_vc)
    pd.DataFrame(burn_vc, columns=cols, index=idx_vc).to_csv(b_vc)
    
    return

    
    Given training data, this script runs some ML algorithms
    (currently, this is 2 linear models with 2 error metrics) 
    for each prediction category: reactor type, cooling time, enrichment, 
    and burnup. Learning curves are also generated; comment out if unecessary

    Parameters 
    ---------- 
    
    X : dataframe that includes all training data
    *Y : series with labels for training data

    Returns
    -------
    reactor*.csv : accuracy for l1 & l2 norms
    cooling*.csv : negative error for l1 & l2 norms
    enrichment*.csv : negative error for l1 & l2 norms
    burnup*.csv : negative error for l1 & l2 norms

    
Given training data, this script runs some ML algorithms
(currently, this is 2 linear models with 2 error metrics)
for each prediction category: reactor type, cooling time, enrichment,
and burnup. Learning curves are also generated; comment out if unecessary
Given training data this script runs some ML algorithms ( currently this is 2 linear models with 2 error metrics ) for each prediction category : reactor type cooling time enrichment and burnup . Learning curves are also generated ; comment out if unecessary
def validation_curves(X, rY, cY, eY, bY, nuc_subset):
    alpha = 0.1
    rxtr_lc  = lc_classification(X, rY, alpha, cv_folds)
    cool_lc= lc_regression(X, cY, alpha, cv_folds)
    enr_lc = lc_regression(X, eY, alpha, cv_folds)
    burn_lc = lc_regression(X, bY, alpha, cv_folds)
    r_lc = 'lc_' + 'reactor' + nucs_tracked + train_src + '.csv'
    c_lc = 'lc_' + 'cooling' + nucs_tracked + train_src + '.csv'
    e_lc = 'lc_' + 'enrichment' + nucs_tracked + train_src + '.csv'
    b_lc = 'lc_' + 'burnup' + nucs_tracked + train_src + '.csv'
    idx_lc = TRAINSET_SIZES
    pd.DataFrame(rxtr_lc, columns=cols, index=idx_lc).to_csv(r_lc)
    pd.DataFrame(cool_lc, columns=cols, index=idx_lc).to_csv(c_lc)
    pd.DataFrame(enr_lc, columns=cols, index=idx_lc).to_csv(e_lc)
    pd.DataFrame(burn_lc, columns=cols, index=idx_lc).to_csv(b_lc)
    ##
    ##
    alist = (0.001, 0.005, 0.01, 0.02, 0.04, 0.06, 0.08, 0.1, 0.2, 0.4, 0.6, 
             0.8, 1, 1.3, 1.7, 2, 5, 10, 50, 100
             )
    rxtr_vc = classification(X, rY, alist, cv_folds)
    cool_vc = regression(X, cY, alist, cv_folds)
    enr_vc = regression(X, eY, alist, cv_folds)
    burn_vc = regression(X, bY, alist, cv_folds)
    idx_vc = alist
    r_vc = 'vc_' + 'reactor' + nucs_tracked + train_src + '.csv'
    c_vc = 'vc_' + 'cooling' + nucs_tracked + train_src + '.csv'
    e_vc = 'vc_' + 'enrichment' + nucs_tracked + train_src + '.csv'
    b_vc = 'vc_' + 'burnup' + nucs_tracked + train_src + '.csv'
    pd.DataFrame(rxtr_vc, columns=cols, index=idx_vc).to_csv(r_vc)
    pd.DataFrame(cool_vc, columns=cols, index=idx_vc).to_csv(c_vc)
    pd.DataFrame(enr_vc, columns=cols, index=idx_vc).to_csv(e_vc)
    pd.DataFrame(burn_vc, columns=cols, index=idx_vc).to_csv(b_vc)
    return
def validation_curves ( X , rY , cY , eY , bY , nuc_subset ) : alpha = 0.1 rxtr_lc = lc_classification ( X , rY , alpha , cv_folds ) cool_lc = lc_regression ( X , cY , alpha , cv_folds ) enr_lc = lc_regression ( X , eY , alpha , cv_folds ) burn_lc = lc_regression ( X , bY , alpha , cv_folds ) r_lc = 'lc_' + 'reactor' + nucs_tracked + train_src + '.csv' c_lc = 'lc_' + 'cooling' + nucs_tracked + train_src + '.csv' e_lc = 'lc_' + 'enrichment' + nucs_tracked + train_src + '.csv' b_lc = 'lc_' + 'burnup' + nucs_tracked + train_src + '.csv' idx_lc = TRAINSET_SIZES pd . DataFrame ( rxtr_lc , columns = cols , index = idx_lc ) . to_csv ( r_lc ) pd . DataFrame ( cool_lc , columns = cols , index = idx_lc ) . to_csv ( c_lc ) pd . DataFrame ( enr_lc , columns = cols , index = idx_lc ) . to_csv ( e_lc ) pd . DataFrame ( burn_lc , columns = cols , index = idx_lc ) . to_csv ( b_lc ) alist = ( 0.001 , 0.005 , 0.01 , 0.02 , 0.04 , 0.06 , 0.08 , 0.1 , 0.2 , 0.4 , 0.6 , 0.8 , 1 , 1.3 , 1.7 , 2 , 5 , 10 , 50 , 100 ) rxtr_vc = classification ( X , rY , alist , cv_folds ) cool_vc = regression ( X , cY , alist , cv_folds ) enr_vc = regression ( X , eY , alist , cv_folds ) burn_vc = regression ( X , bY , alist , cv_folds ) idx_vc = alist r_vc = 'vc_' + 'reactor' + nucs_tracked + train_src + '.csv' c_vc = 'vc_' + 'cooling' + nucs_tracked + train_src + '.csv' e_vc = 'vc_' + 'enrichment' + nucs_tracked + train_src + '.csv' b_vc = 'vc_' + 'burnup' + nucs_tracked + train_src + '.csv' pd . DataFrame ( rxtr_vc , columns = cols , index = idx_vc ) . to_csv ( r_vc ) pd . DataFrame ( cool_vc , columns = cols , index = idx_vc ) . to_csv ( c_vc ) pd . DataFrame ( enr_vc , columns = cols , index = idx_vc ) . to_csv ( e_vc ) pd . DataFrame ( burn_vc , columns = cols , index = idx_vc ) . to_csv ( b_vc ) return
Given training data, this script runs some ML algorithms
(currently, this is 2 linear models with 2 error metrics)
for each prediction category: reactor type, cooling time, enrichment,
and burnup.
Given training data this script runs some ML algorithms ( currently this is 2 linear models with 2 error metrics ) for each prediction category : reactor type cooling time enrichment and burnup .
"""
    
    Given training data, this script runs some ML algorithms
    (currently, this is 2 linear models with 2 error metrics) 
    for each prediction category: reactor type, cooling time, enrichment, 
    and burnup. Learning curves are also generated; comment out if unecessary

    Parameters 
    ---------- 
    
    X : dataframe that includes all training data
    *Y : series with labels for training data

    Returns
    -------
    reactor*.csv : accuracy for l1 & l2 norms
    cooling*.csv : negative error for l1 & l2 norms
    enrichment*.csv : negative error for l1 & l2 norms
    burnup*.csv : negative error for l1 & l2 norms

    """ ##################### ## Learning Curves ## ##################### ####################### ## Validation Curves ## #######################
X
None
rY
cY
eY
bY
nuc_subset
*Y
None
Returns
None
reactor*.csv
None
cooling*.csv
None
enrichment*.csv
None
burnup*.csv
None