# dh = DataHandler()
    dh.merge_csvs_on_first_time_overlap(master,
                                        slave,
                                        out_path=None,
                                        merge_column=None,
                                        master_columns=['bx', 'by', 'bz'],
                                        slave_columns=['tx', 'ty', 'tz'],
                                        rearrange_columns_to=None,
                                        save=False,
                                        left_index=True,
                                        right_index=True)

    dh.add_columns_based_on_csv(label,
                                columns_name=["label"],
                                join_type="inner")

    if idx == 0:
        merged_df = dh.get_dataframe_iterator()
        continue

    merged_old_shape = merged_df.shape
    # vertically stack the dataframes aka add the rows from dataframe2 as rows to the dataframe1
    merged_df = dh_stacker.vertical_stack_dataframes(
        merged_df, dh.get_dataframe_iterator(), set_as_current_df=False)

    print("shape merged df: ", merged_df.shape, "should be ",
          dh.get_dataframe_iterator().shape, "  more than old  ",
          merged_old_shape)

print("Final merge form: ", merged_df.shape)
示例#2
0
        '3': [['2018-04-24', '14:08:01', '15:08:00']]
    })

###################################### remove rows that does not have label ###########################

df1 = dh1.get_dataframe_iterator()
df2 = dh2.get_dataframe_iterator()

print(df1.shape, df2.shape)
df1.dropna(subset=['label'], inplace=True)
df2.dropna(subset=['label'], inplace=True)
print(df1.shape, df2.shape)

############################## THEN COMBINE INTO ONE BIG TRAINING SET  AKA VERTICAL STACKING #############

dataframe = dh1.vertical_stack_dataframes(df1, df2, set_as_current_df=False)
# dataframe = dh1.vertical_stack_dataframes(dataframe, df3, set_as_current_df=False)
print("DATAFRAME\n", dataframe.head(5), dataframe.shape)

############################## THEN WE MUST EXTRACT FEATURES N LABELS ######################################

pipeObj = Pipeline()
back_feat_train, thigh_feat_train, label_train = pipeObj.get_features_and_labels_as_np_array(
    dataframe)

############################## THEN WE MUST TRAIN THE CLASSIFIER ######################################

RFC = models.get("RFC", {})

##############
# MODEL ARGUMENTS