model.py
def evaluate_df(bl_train_rmse, lm_rmse, lars_rmse, lars_rmse_v, lm_sq_rmse, lm_sq_rmse_v, svr_rmse, glm_rmse, glm_rmse_v, glm_rmse_t):
    '''
    This function creates a dataframe with rmse as the evaluating metric for 
    the models we used. Columns are the datasets' rmse assessed for each model
    '''
    columns = ['train_rmse', 'validate_rmse', 'test_rmse']
    index = ['baseline', 'ols', 'lassolars', 'pf2_lr', 'SVM', 'GLM']
    data = [[bl_train_rmse, '-', '-'],
            [lm_rmse, '-', '-'],
            [lars_rmse, lars_rmse_v, '-'],
            [lm_sq_rmse, lm_sq_rmse_v, '-'], 
            [svr_rmse, '-', '-'],
            [glm_rmse, glm_rmse_v, glm_rmse_t]]
    print(f'Model beat baseline by {abs((glm_rmse_t - bl_train_rmse)/bl_train_rmse)*100:.2f}%')
    return pd.DataFrame(columns=columns, data=data, index=index).sort_values(by='train_rmse')

    This function creates a dataframe with rmse as the evaluating metric for 
    the models we used. Columns are the datasets' rmse assessed for each model
    
This function creates a dataframe with rmse as the evaluating metric for
the models we used. Columns are the datasets' rmse assessed for each model
This function creates a dataframe with rmse as the evaluating metric for the models we used . Columns are the datasets ' rmse assessed for each model
def evaluate_df(bl_train_rmse, lm_rmse, lars_rmse, lars_rmse_v, lm_sq_rmse, lm_sq_rmse_v, svr_rmse, glm_rmse, glm_rmse_v, glm_rmse_t):
    columns = ['train_rmse', 'validate_rmse', 'test_rmse']
    index = ['baseline', 'ols', 'lassolars', 'pf2_lr', 'SVM', 'GLM']
    data = [[bl_train_rmse, '-', '-'],
            [lm_rmse, '-', '-'],
            [lars_rmse, lars_rmse_v, '-'],
            [lm_sq_rmse, lm_sq_rmse_v, '-'], 
            [svr_rmse, '-', '-'],
            [glm_rmse, glm_rmse_v, glm_rmse_t]]
    print(f'Model beat baseline by {abs((glm_rmse_t - bl_train_rmse)/bl_train_rmse)*100:.2f}%')
    return pd.DataFrame(columns=columns, data=data, index=index).sort_values(by='train_rmse')
def evaluate_df ( bl_train_rmse , lm_rmse , lars_rmse , lars_rmse_v , lm_sq_rmse , lm_sq_rmse_v , svr_rmse , glm_rmse , glm_rmse_v , glm_rmse_t ) : columns = [ 'train_rmse' , 'validate_rmse' , 'test_rmse' ] index = [ 'baseline' , 'ols' , 'lassolars' , 'pf2_lr' , 'SVM' , 'GLM' ] data = [ [ bl_train_rmse , '-' , '-' ] , [ lm_rmse , '-' , '-' ] , [ lars_rmse , lars_rmse_v , '-' ] , [ lm_sq_rmse , lm_sq_rmse_v , '-' ] , [ svr_rmse , '-' , '-' ] , [ glm_rmse , glm_rmse_v , glm_rmse_t ] ] print ( f'Model beat baseline by {abs((glm_rmse_t - bl_train_rmse)/bl_train_rmse)*100:.2f}%' ) return pd . DataFrame ( columns = columns , data = data , index = index ) . sort_values ( by = 'train_rmse' )
This function creates a dataframe with rmse as the evaluating metric for
the models we used.
This function creates a dataframe with rmse as the evaluating metric for the models we used .
'''
    This function creates a dataframe with rmse as the evaluating metric for 
    the models we used. Columns are the datasets' rmse assessed for each model
    '''
bl_train_rmse
lm_rmse
lars_rmse
lars_rmse_v
lm_sq_rmse
lm_sq_rmse_v
svr_rmse
glm_rmse
glm_rmse_v
glm_rmse_t