automata4cps.tools¶
Various methods to transform data.
- automata4cps.tools.binary_ordinal_encode(column, order)¶
Encodes a pandas Series with binary ordinal encoding based on the specified order.
- Parameters:
column (pd.Series) – The column to encode.
order (list) – The ordered list of unique values in the column.
- Returns:
The binary ordinal encoded DataFrame for the given column.
- Return type:
pd.DataFrame
- automata4cps.tools.composite_f1_score(anom_labels, start_event_idx, true_anom_idx)¶
- automata4cps.tools.compute_purity(cluster_assignments, class_assignments)¶
- automata4cps.tools.create_events_from_signal_vectors(data, sig_names)¶
- automata4cps.tools.data_list_to_dataframe(element, data, signal_names, prefix=None, last_var=None)¶
- automata4cps.tools.dict_to_csv(d, name='csv.csv')¶
- automata4cps.tools.dict_to_df(d)¶
- automata4cps.tools.encode_nominal(x, columns=None, categories=None)¶
- automata4cps.tools.encode_nominal_list_df(dfs, columns=None, categories=None)¶
- automata4cps.tools.encode_ordinal(x, columns, order=None)¶
- automata4cps.tools.extend_derivative(signals, use_derivatives=(0, 1))¶
- automata4cps.tools.filter_na_and_constant(data)¶
- automata4cps.tools.filter_signals(data, sig_names)¶
- automata4cps.tools.flatten_dict(dict_of_lists)¶
- automata4cps.tools.flatten_dict_data(stateflow, reduce_keys_if_possible=True)¶
- automata4cps.tools.generate_random_walk(start_values, steps=100)¶
Generates a random walk process for multiple variables.
Parameters: - start_values (list): A list of starting values for each variable. - steps (int): Number of steps in the random walk.
Returns: - pd.DataFrame: DataFrame containing the random walk process for each variable.
- automata4cps.tools.get_binary_cols(df)¶
- automata4cps.tools.group_components(comp, *states)¶
- automata4cps.tools.group_data_on_discrete_state(data, state_column, reset_time=False, time_col=None)¶
- automata4cps.tools.melt_dataframe(df, timestamp=None)¶
- automata4cps.tools.remove_timestamps_without_change(data, sig_names=None)¶
Removes timestamps where no values changed in comparison to the previous timestamp.
- automata4cps.tools.signal_vector_to_event(previous_vec, sig_vec)¶
- automata4cps.tools.signal_vector_to_state(sig_vec)¶
- automata4cps.tools.split_data_on_signal_value(data, sig_name, new_value)¶
- automata4cps.tools.split_train_valid(time, data, other, split)¶
- automata4cps.tools.standardize(self, x, fit=False)¶
- automata4cps.tools.window(self, x)¶