old_scripts/basicML.py
def main():
    """
    Takes all origen files and compiles them into the appropriate dataframes for 
    training and testing sets. Then splits those dataframes into the appropriate 
    X and Ys for prediction of reactor type, fuel enrichment, and burnup. 

    The training set is varied by number of features included in trainX to
    create a learning curve.

    """
    
    pkl_train = 'trainXY_2nov.pkl'
    pkl_test = 'testXY_2nov.pkl'
    print("scrips\n")
    #print("Did you check your training and testing data paths?\n")    
    # Training Datasets
    #trainpath = "../origen/origen-data/training/9may2017/csv/"
    #trainpath = "../origen-data/training/2nov2017/csv/"
    #trainpath = "../origen/origen-data/training/2nov2017/csv/"
    #train_files = glob.glob(os.path.join(trainpath, "*.csv"))
    #trainXY = dataframeXY(train_files, train_label)
    #trainXY.reset_index(inplace = True)
    #pickle.dump(trainXY, open(pkl_train, 'wb'))
    
    # Get set of top 200 nucs from training set
    # The filter_nuc func repeats stuff from top_nucs but it is needed because
    # the nuc_set needs to be determined from the training set for the test set
    # and the training set is filtered within each loop
    trainXY = pd.read_pickle(pkl_train)
    top_n = 200
    nuc_set = top_nucs(trainXY, top_n)
    trainX, trainYr, trainYe, trainYb = splitXY(trainXY)
    trainX = filter_nucs(trainX, nuc_set, top_n)
    ######################################################
    #trainX = scale(trainX) WILL DO SCALING AFTER DATA MANIP
    ######################################################
    train_set = LearnSet(nuc_concs = trainX, burnup = trainYb)
    
    # Testing Dataset (for now)
    #testpath = "../origen/origen-data/testing/10may2017_2/csv/"
    #testpath = "../origen-data/testing/2nov2017/csv/"
    #testpath = "../origen/origen-data/testing/2nov2017/csv/"
    #test_files = glob.glob(os.path.join(testpath, "*.csv"))
    #testXY = dataframeXY(test_files, test_label)
    #testXY.reset_index(inplace = True)
    #pickle.dump(testXY, open(pkl_test, 'wb'))
    testXY = pd.read_pickle(pkl_test)
    testX, testYr, testYe, testYb = splitXY(testXY)
    testX = filter_nucs(testX, nuc_set, top_n)
    ######################################################
    #testX = scale(testX) WILL DO SCALING AFTER DATA MANIP
    ######################################################
    test_set = LearnSet(nuc_concs = testX, burnup = testYb)
    
    #random_error(train_set, test_set)
    #auto_train_and_predict(train_set) 
    manual_train_and_predict(train_set, test_set) 
    
    print("All csv files are saved in this directory!\n")

    return

    Takes all origen files and compiles them into the appropriate dataframes for 
    training and testing sets. Then splits those dataframes into the appropriate 
    X and Ys for prediction of reactor type, fuel enrichment, and burnup. 

    The training set is varied by number of features included in trainX to
    create a learning curve.

    
Takes all origen files and compiles them into the appropriate dataframes for
training and testing sets. Then splits those dataframes into the appropriate
X and Ys for prediction of reactor type, fuel enrichment, and burnup.

The training set is varied by number of features included in trainX to
create a learning curve.
Takes all origen files and compiles them into the appropriate dataframes for training and testing sets . Then splits those dataframes into the appropriate X and Ys for prediction of reactor type fuel enrichment and burnup . The training set is varied by number of features included in trainX to create a learning curve .
def main():
    pkl_train = 'trainXY_2nov.pkl'
    pkl_test = 'testXY_2nov.pkl'
    print("scrips\n")
    trainXY = pd.read_pickle(pkl_train)
    top_n = 200
    nuc_set = top_nucs(trainXY, top_n)
    trainX, trainYr, trainYe, trainYb = splitXY(trainXY)
    trainX = filter_nucs(trainX, nuc_set, top_n)
    train_set = LearnSet(nuc_concs = trainX, burnup = trainYb)
    testXY = pd.read_pickle(pkl_test)
    testX, testYr, testYe, testYb = splitXY(testXY)
    testX = filter_nucs(testX, nuc_set, top_n)
    test_set = LearnSet(nuc_concs = testX, burnup = testYb)
    manual_train_and_predict(train_set, test_set) 
    print("All csv files are saved in this directory!\n")
    return
def main ( ) : pkl_train = 'trainXY_2nov.pkl' pkl_test = 'testXY_2nov.pkl' print ( "scrips\n" ) trainXY = pd . read_pickle ( pkl_train ) top_n = 200 nuc_set = top_nucs ( trainXY , top_n ) trainX , trainYr , trainYe , trainYb = splitXY ( trainXY ) trainX = filter_nucs ( trainX , nuc_set , top_n ) train_set = LearnSet ( nuc_concs = trainX , burnup = trainYb ) testXY = pd . read_pickle ( pkl_test ) testX , testYr , testYe , testYb = splitXY ( testXY ) testX = filter_nucs ( testX , nuc_set , top_n ) test_set = LearnSet ( nuc_concs = testX , burnup = testYb ) manual_train_and_predict ( train_set , test_set ) print ( "All csv files are saved in this directory!\n" ) return
Takes all origen files and compiles them into the appropriate dataframes for
training and testing sets.
Takes all origen files and compiles them into the appropriate dataframes for training and testing sets .
"""
    Takes all origen files and compiles them into the appropriate dataframes for 
    training and testing sets. Then splits those dataframes into the appropriate 
    X and Ys for prediction of reactor type, fuel enrichment, and burnup. 

    The training set is varied by number of features included in trainX to
    create a learning curve.

    """ #print("Did you check your training and testing data paths?\n")     # Training Datasets #trainpath = "../origen/origen-data/training/9may2017/csv/" #trainpath = "../origen-data/training/2nov2017/csv/" #trainpath = "../origen/origen-data/training/2nov2017/csv/" #train_files = glob.glob(os.path.join(trainpath, "*.csv")) #trainXY = dataframeXY(train_files, train_label) #trainXY.reset_index(inplace = True) #pickle.dump(trainXY, open(pkl_train, 'wb')) # Get set of top 200 nucs from training set # The filter_nuc func repeats stuff from top_nucs but it is needed because # the nuc_set needs to be determined from the training set for the test set # and the training set is filtered within each loop ###################################################### #trainX = scale(trainX) WILL DO SCALING AFTER DATA MANIP ###################################################### # Testing Dataset (for now) #testpath = "../origen/origen-data/testing/10may2017_2/csv/" #testpath = "../origen-data/testing/2nov2017/csv/" #testpath = "../origen/origen-data/testing/2nov2017/csv/" #test_files = glob.glob(os.path.join(testpath, "*.csv")) #testXY = dataframeXY(test_files, test_label) #testXY.reset_index(inplace = True) #pickle.dump(testXY, open(pkl_test, 'wb')) ###################################################### #testX = scale(testX) WILL DO SCALING AFTER DATA MANIP ###################################################### #random_error(train_set, test_set) #auto_train_and_predict(train_set) 