def evaluate_classifier(model, df, test_persons, measurement_cost, test_sequence='Mix', prior=[(1 / class_set) for i in range(class_set)], render_seq=False):
    df['prediction'] = (- 6666)
    for test_person in test_persons:
        training_df = df.loc[(df['person'] != test_person)]
        test_df = df.loc[((df['person'] == test_person) & (df['sequence_type'] == test_sequence))].copy()
        transition_matrix = estimate_transition_matrix(training_df.loc[(training_df['sequence_type'] == 'Mix')])
        model.fit(training_df)
        for (j, file) in enumerate(test_df.file_index.unique()):
            print(f'File {j}/{len(test_df.file_index.unique())}')
            seq_df = test_df.loc[(test_df['file_index'] == file)].copy()
            seq_df = predict_sequence(model, seq_df, transition_matrix, measurement_cost)
            if render_seq:
                render.render_classification_sequence(seq_df)
            df.loc[(seq_df.index, 'belief')] = seq_df['belief']
            df.loc[(seq_df.index, 'prediction')] = seq_df['prediction']
            df.loc[(seq_df.index, 'Selected')] = seq_df['Selected']
    return df
def evaluate_classifier(model, df, test_persons, measurement_cost, test_sequence='Mix', prior=[(1 / class_set) for i in range(class_set)], render_seq=False):
    df['prediction'] = (- 6666)
    for test_person in test_persons:
        training_df = df.loc[(df['person'] != test_person)]
        test_df = df.loc[((df['person'] == test_person) & (df['sequence_type'] == test_sequence))].copy()
        transition_matrix = estimate_transition_matrix(training_df.loc[(training_df['sequence_type'] == 'Mix')])
        model.fit(training_df)
        for (j, file) in enumerate(test_df.file_index.unique()):
            print(f'File {j}/{len(test_df.file_index.unique())}')
            seq_df = test_df.loc[(test_df['file_index'] == file)].copy()
            seq_df = predict_sequence(model, seq_df, transition_matrix, measurement_cost)
            if render_seq:
                render.render_classification_sequence(seq_df)
            df.loc[(seq_df.index, 'belief')] = seq_df['belief']
            df.loc[(seq_df.index, 'prediction')] = seq_df['prediction']
            df.loc[(seq_df.index, 'Selected')] = seq_df['Selected']
    return df