Пример #1
0
def evaluate(model, df, target_label='Decision', task='test'):
    """
	Parameters:
		model (built chefboost model): you should pass the return of fit function
		df (pandas data frame): data frame you would like to evaluate
		task (string): optionally you can pass this train, validation or test
	"""

    #--------------------------

    if target_label != 'Decision':
        df = df.rename(columns={target_label: 'Decision'})

    #if target is not the last column
    if df.columns[-1] != 'Decision':
        new_column_order = df.columns.drop('Decision').tolist() + ['Decision']
        print(new_column_order)
        df = df[new_column_order]

    #--------------------------

    functions.bulk_prediction(df, model)

    enableAdaboost = model["config"]["enableAdaboost"]

    if enableAdaboost == True:
        df['Decision'] = df['Decision'].astype(str)
        df['Prediction'] = df['Prediction'].astype(str)

    eval.evaluate(df, task=task)
Пример #2
0
def evaluate(model, df, task = 'test'):
		
	functions.bulk_prediction(df, model)
	
	enableAdaboost = model["config"]["enableAdaboost"]
	
	if enableAdaboost == True:
		df['Decision'] = df['Decision'].astype(str)
		df['Prediction'] = df['Prediction'].astype(str)
	
	eval.evaluate(df, task = task)
Пример #3
0
def evaluate(model, df, task='test'):
    """
	Parameters:
		model (built chefboost model): you should pass the return of fit function
		df (pandas data frame): data frame you would like to evaluate
		task (string): optionally you can pass this train, validation or test
	"""

    functions.bulk_prediction(df, model)

    enableAdaboost = model["config"]["enableAdaboost"]

    if enableAdaboost == True:
        df['Decision'] = df['Decision'].astype(str)
        df['Prediction'] = df['Prediction'].astype(str)

    eval.evaluate(df, task=task)