@@ -77,39 +77,35 @@ def start_model_estimation(config, log_path, data_selection="none", plot=False):
77
77
"directory and models/__init__.py?" .format (model_class )
78
78
raise AttributeError (error_str )
79
79
80
- visual_dataframe_selector_config_dict = {
81
- "x_axis_col" : "timestamp" ,
82
- "sub_plt1_data" : ["q0" , "q1" , "q2" , "q3" ],
83
- "sub_plt2_data" : ["u0" , "u1" , "u2" , "u3" ],
84
- "sub_plt3_data" : []
85
- }
86
-
87
- if data_handler .estimate_forces == True :
88
- visual_dataframe_selector_config_dict ["sub_plt3_data" ].append ("fisher_information_force" )
89
-
90
- if data_handler .estimate_moments == True :
91
- visual_dataframe_selector_config_dict ["sub_plt3_data" ].append ("fisher_information_rot" )
92
-
93
80
model .load_dataframes (data_df )
94
81
model .prepare_regression_matrices ()
95
82
model .compute_fisher_information ()
96
83
97
84
# Interactive data selection
98
85
if data_selection == "interactive" :
99
86
from visual_dataframe_selector .data_selector import select_visual_data
100
- model .data_df = select_visual_data (model .data_df ,visual_dataframe_selector_config_dict )
101
- model .n_samples = model .data_df .shape [0 ]
102
- # Automatic data selection (WIP)
103
- elif data_selection == "auto" :
87
+ visual_dataframe_selector_config_dict = {
88
+ "x_axis_col" : "timestamp" ,
89
+ "sub_plt1_data" : ["q0" , "q1" , "q2" , "q3" ],
90
+ "sub_plt2_data" : ["u0" , "u1" , "u2" , "u3" ],
91
+ "sub_plt3_data" : []
92
+ }
93
+
94
+ if data_handler .estimate_forces == True :
95
+ visual_dataframe_selector_config_dict ["sub_plt3_data" ].append ("fisher_information_force" )
96
+
97
+ if data_handler .estimate_moments == True :
98
+ visual_dataframe_selector_config_dict ["sub_plt3_data" ].append ("fisher_information_rot" )
99
+
100
+ model .load_dataframes (select_visual_data (model .data_df ,visual_dataframe_selector_config_dict ))
101
+ elif data_selection == "auto" : # Automatic data selection (WIP)
104
102
from active_dataframe_selector .data_selector import ActiveDataSelector
105
103
# The goal is to identify automatically the most relevant parts of a log.
106
104
# Currently the draft is designed to choose the most informative 10% of the logs with regards to
107
105
# force and moment parameters. This threshold is currently not validated at all and the percentage
108
106
# can vary drastically from log to log.
109
-
110
107
data_selector = ActiveDataSelector (model .data_df )
111
- model .data_df = data_selector .select_dataframes (10 )
112
- model .n_samples = model .data_df .shape [0 ]
108
+ model .load_dataframes (data_selector .select_dataframes (10 ))
113
109
114
110
model .estimate_model ()
115
111
0 commit comments