old_scripts/alt_learnme.py
def errors_and_scores(trainX, trainY, alg1_init, alg2_init, alg3_init, scores, CV, csv_name):
    """
    Saves csv's with each reactor parameter regression wrt scoring metric and 
    algorithm

    Parameters 
    ---------- 
    
    X : dataframe that includes all training data
    Y : series with labels for training data
    alg1_init : optimized learner 1
    alg2_init : optimized learner 2
    alg3_init : optimized learner 3
    scores : list of scoring types (from sckikit-learn)
    CV : cross-validation generator
    csv_name : string containing the train set, nuc subset, and parameter being 
               predicted for naming purposes

    Returns
    -------
    *scores.csv : csv file with scores for each CV fold
    
    """
    # Note: I'm trying to avoid loops here so the code is inelegant
    
    cv_scr = cross_validate(alg1_init, trainX, trainY, scoring=scores, cv=CV, return_train_score=False)
    df1 = pd.DataFrame(cv_scr)
    df1['Algorithm'] = 'dtree'
    
    cv_scr = cross_validate(alg2_init, trainX, trainY, scoring=scores, cv=CV, return_train_score=False)
    df2 = pd.DataFrame(cv_scr)
    df2['Algorithm'] = 'xtree'
    
    cv_scr = cross_validate(alg3_init, trainX, trainY, scoring=scores, cv=CV, return_train_score=False)
    df3 = pd.DataFrame(cv_scr)
    df3['Algorithm'] = 'bayes'
    
    cv_results = [df1, df2, df3]
    df = pd.concat(cv_results)
    df.to_csv(csv_name + '_scores.csv')
    
    return

    Saves csv's with each reactor parameter regression wrt scoring metric and 
    algorithm

    Parameters 
    ---------- 
    
    X : dataframe that includes all training data
    Y : series with labels for training data
    alg1_init : optimized learner 1
    alg2_init : optimized learner 2
    alg3_init : optimized learner 3
    scores : list of scoring types (from sckikit-learn)
    CV : cross-validation generator
    csv_name : string containing the train set, nuc subset, and parameter being 
               predicted for naming purposes

    Returns
    -------
    *scores.csv : csv file with scores for each CV fold
    
    
Saves csv's with each reactor parameter regression wrt scoring metric and
algorithm
Saves csv ' s with each reactor parameter regression wrt scoring metric and algorithm
def errors_and_scores(trainX, trainY, alg1_init, alg2_init, alg3_init, scores, CV, csv_name):
    cv_scr = cross_validate(alg1_init, trainX, trainY, scoring=scores, cv=CV, return_train_score=False)
    df1 = pd.DataFrame(cv_scr)
    df1['Algorithm'] = 'dtree'
    cv_scr = cross_validate(alg2_init, trainX, trainY, scoring=scores, cv=CV, return_train_score=False)
    df2 = pd.DataFrame(cv_scr)
    df2['Algorithm'] = 'xtree'
    cv_scr = cross_validate(alg3_init, trainX, trainY, scoring=scores, cv=CV, return_train_score=False)
    df3 = pd.DataFrame(cv_scr)
    df3['Algorithm'] = 'bayes'
    cv_results = [df1, df2, df3]
    df = pd.concat(cv_results)
    df.to_csv(csv_name + '_scores.csv')
    return
def errors_and_scores ( trainX , trainY , alg1_init , alg2_init , alg3_init , scores , CV , csv_name ) : cv_scr = cross_validate ( alg1_init , trainX , trainY , scoring = scores , cv = CV , return_train_score = False ) df1 = pd . DataFrame ( cv_scr ) df1 [ 'Algorithm' ] = 'dtree' cv_scr = cross_validate ( alg2_init , trainX , trainY , scoring = scores , cv = CV , return_train_score = False ) df2 = pd . DataFrame ( cv_scr ) df2 [ 'Algorithm' ] = 'xtree' cv_scr = cross_validate ( alg3_init , trainX , trainY , scoring = scores , cv = CV , return_train_score = False ) df3 = pd . DataFrame ( cv_scr ) df3 [ 'Algorithm' ] = 'bayes' cv_results = [ df1 , df2 , df3 ] df = pd . concat ( cv_results ) df . to_csv ( csv_name + '_scores.csv' ) return
Saves csv's with each reactor parameter regression wrt scoring metric and
algorithm
Saves csv ' s with each reactor parameter regression wrt scoring metric and algorithm
"""
    Saves csv's with each reactor parameter regression wrt scoring metric and 
    algorithm

    Parameters 
    ---------- 
    
    X : dataframe that includes all training data
    Y : series with labels for training data
    alg1_init : optimized learner 1
    alg2_init : optimized learner 2
    alg3_init : optimized learner 3
    scores : list of scoring types (from sckikit-learn)
    CV : cross-validation generator
    csv_name : string containing the train set, nuc subset, and parameter being 
               predicted for naming purposes

    Returns
    -------
    *scores.csv : csv file with scores for each CV fold
    
    """ # Note: I'm trying to avoid loops here so the code is inelegant
trainX
trainY
alg1_init
None
alg2_init
None
alg3_init
None
scores
None
CV
None
csv_name
predicted for naming purposes
predicted for naming purposes
X
None
Y
None
Returns
None
*scores.csv
None