예제 #1
0
def get_mf_pca_df(rows=5):
    """
    function get_mf_pca_df(rows=5) shows some results
    that were predicted for matrix+pca features by all methods
    """
    mf_pca_df = load_dataframe('matrix_pca_df')
    return mf_pca_df[:rows]
예제 #2
0
def get_haars_df(rows=5):
    """
    function get_haars_df(rows=5) shows some results
    that were predicted for haars features by all methods
    """
    haars_df = load_dataframe('haars_df')
    return haars_df[:rows]
예제 #3
0
def get_haars_net_df(rows=5, exp_num=1):
    """
    function get_haars_net_df(rows=5, exp_num=1) shows some results
    that were predicted for haars features by neural networks at
    first or second experiment
    """
    haars_net_df = load_dataframe('haars_net_df' + '_exp_num_' + str(exp_num))
    return haars_net_df[:rows]
예제 #4
0
def calc_accuracy():
    """
    function calc_accuracy() calculate accuracy
    and returns dataframe with results
    """
    col_list = COL_LIST
    col_list.append('voting (cols [1-5) )')

    haars_df = load_dataframe('haars_df')
    matrix_df = load_dataframe('matrix_df')
    matrix_pca_df = load_dataframe('matrix_pca_df')

    accuracy_df = pd.DataFrame(FEATURES_LIST, index=['1', '2', '3'], columns=['features'])

    for i, cols in enumerate(col_list):
        accuracy_df[cols] = [accuracy_score(haars_df['y_test'], haars_df[cols]),
                             accuracy_score(matrix_df['y_test'], matrix_df[cols]),
                             accuracy_score(matrix_pca_df['y_test'], matrix_pca_df[cols])]
    return accuracy_df[:]
예제 #5
0
def show_wrong_classified_obj():
    """
    function show_wrong_classified_obj() shows some examples
    ml-models gave false positive or false negative detections
    """
    indexes = np.arange(1, 96, 32)
    col_list = COL_LIST
    col_list.append('voting (cols [1-5) )')
    x_test = load_sample('x_test')

    fig = plt.figure(figsize=(8, 60))
    ax = []
    plt.rcParams.update({'font.size': 6})
    np.random.seed(RANDOM_SEED)

    plotting(load_dataframe('haars_df'), 'hf', indexes[0],
             col_list, fig, ax,  x_test)
    plotting(load_dataframe('matrix_df'), 'mf', indexes[1],
             col_list, fig, ax,  x_test)
    plotting(load_dataframe('matrix_pca_df'), 'mf_pca', indexes[2],
             col_list, fig, ax,  x_test)

    plt.show()
예제 #6
0
def get_time_df():
    """
    function get_time_df() returns dataframe with time
    """
    time_part1_df = load_dataframe('time_df_part1')
    return time_part1_df[:]
예제 #7
0
def get_net_time_df(exp_num=1):
    """
    function get_net_time_df(exp_num=1) returns dataframe with time
    """
    net_time_df = load_dataframe('net_time_df' + '_exp_num_' + str(exp_num))
    return net_time_df[:]