Utils package¶
This package includes some usefull fucntions that are used for logging and formatting the artifacts generated by different executions.
log function¶
- deep_nilmtk.utils.log.log_results(experiment, api_res)[source]¶
This function logs the final results of the testing in the correspanding experiment for each disaggregator
- Parameters
experiment (dict) -- dict of the experiment in nilmtk format
api_res (nilmtk-api result) -- results of the execution as provided by nilmtk
- deep_nilmtk.utils.log.save_results(api_results_f1, time, experiment_name, path='../results')[source]¶
This function persists teh output of the predictions in a pickel file
- Parameters
api_results_f1 -- Execution results as returned by the NILMtk-API
time -- execution time
experiment_name (str) -- Name of the experiment
path (str, optional) -- Path to the results folder, defaults to '../results'
results function¶
- deep_nilmtk.utils.results.filter_prediction(data, w=10, q=50)[source]¶
Filters the predictions
param data: The input data power data. :type data: np.array :param sequence_length: The length of sequence, defaults to 10 :type sequence_length: int, optional :param p: The percentile. Defaults to 50. :type p: int, optional :return: array of values for correponding percentile :rtype: np.array
setup function¶
- deep_nilmtk.utils.setup.setup(experiment, experiment_name, results_path='./output/results', mlflow_repo='./output/mlruns/')[source]¶
Runs NILM experiments as defined with a NILMt-API
- Parameters
experiment (dict) -- Experiment definition
experiment_name (str) -- The name of the current experiment
results_path (str, optional) -- The path to the resulst folder, defaults to '../results'
mlflow_repo (str, optional) -- The path to the Mlflow folder, defaults to '../mlflow'