hookeai.utilities.prediction_metrics.get_feature_data¶
- get_feature_data(sample_results, feature_idx, is_ground_truth=False)[source]¶
Get sample prediction and ground-truth for given feature.
- Parameters:
sample_results (dict) – Sample prediction results. Features predictions (and ground-truth if available) are each stored as torch.Tensor(2d) of shape (sequence_length, n_features).
feature_idx (int) – Feature index.
is_ground_truth (bool, default=False) – If True, then output sample feature ground-truth.
- Returns:
feature_out (torch.Tensor) – Tensor of feature prediction stored as torch.Tensor(1d) of shape (sequence_length,).
target ({torch.Tensor, None}) – Tensor of feature ground-truth stored as torch.Tensor(1d) of shape (sequence_length,). Set to None if is_ground_truth=False.