Prediction#
Predictions store the result of a prediction (i.e., returned by the predict method of a predictor). They store values (with uncertainty) at different future times. These are used to store states, inputs, outputs, perfomance metrics, and event states with uncertainty at savepoints.
Two types of predictions are distributed with this package: Prediction and UnweightedSamplesPrediction, described below. UnweightedSamplesPrediction extends Prediction to allow some operations specific to cases where each prediction is represented by an UnweightedSamples object (e.g., accessing SimResult for a single sample).
- class progpy.predictors.Prediction(times: list, data: list)#
Class for the result of a prediction. Is returned by the predict method of a predictor.
- Parameters
times (list[float]) – Times for each data point where times[n] corresponds to data[n]
data (list[UncertainData]) – Data points for each time in times
- property mean: List[dict]#
Estimate of the mean value of the prediction at each time
- Returns
Mean value of the prediction at each time where mean[n] corresponds to the mean value of the prediction at time times[n].
The mean value at each time is a dictionary.
e.g., [{‘state1’: 1.2, ‘state2’: 1.3, …}, …]
- Return type
Example
mean_value = data.mean
- monotonicity() Dict[str, float] #
Calculate monotonicty for a single prediction. Given a single prediction, for each event: go through all predicted states and compare those to the next one. Calculates monotonicity for each event key using its associated mean value in UncertainData.
\(monotonoicity = \| \Sigma \dfrac{sign(i+1 - i)}{N-1}\|\)
Where N is number of measurements and sign indicates sign of calculation [0]_ [1]_.
- Returns
Value between [0, 1] indicating monotonicity of a given event for the Prediction.
- Return type
References
- 0
Coble, J., et. al. (2021). Identifying Optimal Prognostic Parameters from Data: A Genetic Algorithms Approach. Annual Conference of the PHM Society. http://www.papers.phmsociety.org/index.php/phmconf/article/view/1404
- 1
Baptistia, M., et. al. (2022). Relation between prognostics predictor evaluation metrics and local interpretability SHAP values. Aritifical Intelligence, Volume 306. https://www.sciencedirect.com/science/article/pii/S0004370222000078
- snapshot(time_index: int) progpy.uncertain_data.uncertain_data.UncertainData #
Get all samples from a specific timestep
- Parameters
index (int) – Timestep (index number from times)
- Returns
Distribution for time corresponding to times[timestep]
- Return type
- class progpy.predictors.UnweightedSamplesPrediction(times: list, data: list)#
Immutable data class for the result of a prediction, where the predictions are stored as UnweightedSamples. Is returned from the predict method of a sample based prediction class (e.g., MonteCarlo). Objects of this class can be iterated and accessed like a list (e.g., prediction[0]), where prediction[n] represents a profile for sample n.
- Parameters
- count(value) integer -- return number of occurrences of value #
- index(value[, start[, stop]]) integer -- return first index of value. #
Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
- property mean: list#
Estimate of the mean value of the prediction at each time
- Returns
Mean value of the prediction at each time where mean[n] corresponds to the mean value of the prediction at time times[n].
The mean value at each time is a dictionary.
e.g., [{‘state1’: 1.2, ‘state2’: 1.3, …}, …]
- Return type
Example
mean_value = data.mean
- monotonicity() Dict[str, float] #
Calculate monotonicty for a single prediction. Given a single prediction, for each event: go through all predicted states and compare those to the next one. Calculates monotonicity for each event key using its associated mean value in UncertainData.
\(monotonoicity = \| \Sigma \dfrac{sign(i+1 - i)}{N-1}\|\)
Where N is number of measurements and sign indicates sign of calculation [0]_ [1]_.
- Returns
Value between [0, 1] indicating monotonicity of a given event for the Prediction.
- Return type
References
- 0
Coble, J., et. al. (2021). Identifying Optimal Prognostic Parameters from Data: A Genetic Algorithms Approach. Annual Conference of the PHM Society. http://www.papers.phmsociety.org/index.php/phmconf/article/view/1404
- 1
Baptistia, M., et. al. (2022). Relation between prognostics predictor evaluation metrics and local interpretability SHAP values. Aritifical Intelligence, Volume 306. https://www.sciencedirect.com/science/article/pii/S0004370222000078
- snapshot(time_index: int) progpy.uncertain_data.unweighted_samples.UnweightedSamples #
Get all samples from a specific timestep
- Parameters
index (int) – Timestep (index number from times)
- Returns
Samples for time corresponding to times[timestep]
- Return type