Visualization
Visualization utilities for RUL estimation models
It is possible to visualize how it grows the unexploited lifetime grows as the conservative window size grows and how the unexpected breaks decrease as the conservative window size grows.
barplot_errors_wrt_RUL(results_dict, nbins, y_axis_label=None, x_axis_label=None, ax=None, color_palette='hls', **kwargs)
Barlots of difference between true and predicted RUL
Parameters:
Name | Type | Description | Default |
---|---|---|---|
results_dict |
Dict[str, List[PredictionResult]]
|
Dictionary with the results for each model |
required |
nbins |
int
|
Number of bins in wich divide the RUL target |
required |
y_axis_label |
Y label |
None
|
|
x_axis_label |
X label |
None
|
|
ax |
Axis |
None
|
|
color_palette |
str
|
|
'hls'
|
Source code in ceruleo/graphics/results.py
boxplot_errors_wrt_RUL(results_dict, nbins, y_axis_label=None, x_axis_label=None, ax=None, **kwargs)
Boxplots of difference between true and predicted RUL over Cross-validated results
Parameters:
Name | Type | Description | Default |
---|---|---|---|
results_dict |
Dict[str, List[PredictionResult]]
|
Dictionary with the results of the fitted models |
required |
nbins |
int
|
Number of bins to divide the |
required |
y_axis_label |
Optional[str]
|
Optional string to be added to the y axis |
None
|
x_axis_label |
Optional[str]
|
Optional string to be added to the x axis |
None
|
ax |
Optional axis in which the plot will be drawed. If an axis is not provided, it will create one. |
None
|
Return
The axis in which the plot has been made
Source code in ceruleo/graphics/results.py
cv_plot_errors_wrt_RUL(bin_edges, error_histogram, **kwargs)
Source code in ceruleo/graphics/results.py
plot_life(life, ax=None, units='', markersize=0.7, add_fitted=False, plot_target=True, add_regressed=True, start_x=0, label='', **kwargs)
Plot a single life
Parameters:
Name | Type | Description | Default |
---|---|---|---|
life |
FittedLife
|
A fitted life |
required |
ax |
Optional[Axes]
|
The axis where to plot |
None
|
units |
Optional[str], optional description, by default "" |
''
|
|
markersize |
float
|
Size of the marker |
0.7
|
add_fitted |
bool
|
Wether to add the LS fitted line to the points |
False
|
plot_target |
bool
|
Wether to plot the true RUL values |
True
|
add_regressed |
bool
|
|
True
|
start_x |
int
|
Initial point of the time-indepedent feature to plot |
0
|
label |
str
|
|
''
|
Returns:
Type | Description |
---|---|
Axes
|
The plot axis |
Source code in ceruleo/graphics/results.py
plot_lives(ds)
Plot each life
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ds |
TransformedDataset
|
A transformed dataset |
required |
plot_predictions(result, *, ax=None, units='Hours [h]', markersize=0.7, marker='o', plot_fitted=True, model_name='', **kwargs)
Plots the predicted and the true remaining useful lives
Parameters:
Name | Type | Description | Default |
---|---|---|---|
result |
Union[PredictionResult, Tuple[ndarray, ndarray]]
|
A PredictionResult object or a tuple with (y_true, y_predicted) |
required |
ax |
Optional[Axes]
|
Axis to plot. If it is missing a new figure will be created |
None
|
units |
str
|
Units of time to be used in the axis labels |
'Hours [h]'
|
marker |
str
|
Marker type |
'o'
|
markersize |
float
|
The size of the marker |
0.7
|
plot_fitted |
bool
|
Wether to plot a LS line |
True
|
model_name |
str
|
Name of the model |
''
|
Returns:
Type | Description |
---|---|
Axes
|
The axis on which the plot has been made |
Source code in ceruleo/graphics/results.py
plot_predictions_grid(results, ncols=3, alpha=1.0, xlabel=None, ylabel=None, **kwargs)
Plot a matrix of predictions
Parameters:
Name | Type | Description | Default |
---|---|---|---|
results |
Union[PredictionResult, List[PredictionResult]]
|
Dictionary with the results |
required |
ncols |
int
|
Number of colmns in the plot |
3
|
alpha |
float
|
Opacity of the predicted curves |
1.0
|
xlabel |
Optional[str]
|
Xlabel |
None
|
ylabel |
Optional[str]
|
YLabel |
None
|
Return
The axis on which the plot has been made
Source code in ceruleo/graphics/results.py
plot_unexpected_breaks(results_dict, max_window, n, ax=None, units='', add_shade=True, **kwargs)
Plot the risk of unexpected breaks with respect to the maintenance window
Parameters:
Name | Type | Description | Default |
---|---|---|---|
results_dict |
dict
|
Dictionary with the results |
required |
max_window |
int
|
Maximum size of the maintenance windows |
required |
n |
int
|
Number of points used to evaluate the window size |
required |
ax |
Optional[Axes]
|
axis on which to draw, by default None |
None
|
units |
Optional[str]
|
Units to use in the xlabel, by default "" |
''
|
Returns:
Type | Description |
---|---|
Axes
|
The axis in which the plot was made |
Source code in ceruleo/graphics/results.py
shadedline_plot_errors_wrt_RUL(results_dict, nbins, y_axis_label=None, x_axis_label=None, ax=None, **kwargs)
Shaded line
Parameters:
Name | Type | Description | Default |
---|---|---|---|
results_dict |
dict
|
Dictionary with the results for the model |
required |
nbins |
int
|
Number of bins |
required |
y_axis_label |
Optional[str]
|
Y label |
None
|
x_axis_label |
Optional[str]
|
X label |
None
|
ax |
Optional[Axes]
|
Plot axis |
None
|
Returns:
Type | Description |
---|---|
Axes
|
The plot axis |