tensorgraphanalyzer
tensorgraphanalyzer ¶
Module for tensorgraphanalyzer
Classes¶
TensorGraphAnalyzer ¶
Bases: ResultAnalyzer
Resultanalyzer for analyzing datapoints seperately. Results
from a previous applied TensorMetric are accessible in the following
TensorMetrics. For access the key
attribute is used in each tensormetric.
Initializes the TensorGraphAnalyzer
Source code in niceml/mlcomponents/resultanalyzers/tensors/tensorgraphanalyzer.py
Functions¶
__call__ ¶
Analyzes the dataset with the given metrics
Source code in niceml/mlcomponents/resultanalyzers/tensors/tensorgraphanalyzer.py
Functions¶
metrics_dict_to_mlflow_metrics_dict ¶
Converts a nested metrics dictionary to a flat dictionary suitable for MLflow logging.
Parameters:
-
metrics_dict
(dict
) –A dictionary containing metrics, possibly nested.
Returns:
-
dict
(dict
) –A flat dictionary suitable for logging metrics in MLflow.
Raises:
-
ValueError
–If a metric is not of type float, dict or list.
Example
Given the input metrics_dict: { 'accuracy': 0.85, 'precision': { 'class_0': 0.90, 'class_1': 0.78 }, 'loss': [0.5, 0.3, 0.2], 'confusion_matrix': [ [50, 5], [10, 80] ] }
The output mlflow_metrics_dict will be: { 'accuracy': 0.85, 'precision_class_0': 0.90, 'precision_class_1': 0.78, 'loss_0': 0.5, 'loss_1': 0.3, 'loss_2': 0.2, 'confusion_matrix_0_0': 50.0, 'confusion_matrix_0_1': 5.0, 'confusion_matrix_1_0': 10.0, 'confusion_matrix_1_1': 80.0 }