.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_reliability/reliability_analysis/plot_active_learning_reliability.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_auto_reliability_reliability_analysis_plot_active_learning_reliability.py: Active learning algorithms for reliability analysis =================================================== .. GENERATED FROM PYTHON SOURCE LINES 7-46 The objective is to illustrate the behavior of active learning algorithms in the context of reliability analysis. These algorithms couple a simulation algorithm (e.g., Monte-Carlo simulation, Importance Sampling, Subset Sampling), a Gaussian Process and an active learning criterion to enrich the metamodel in a goal-oriented approach to efficiently estimate a probability of failure. For more details, please consult :class:`~openturns.experimental.ActiveLearningReliabilityAlgorithm`. In this example, two cases are described. Firstly, :class:`~openturns.ProbabilitySimulationAlgorithm` using :class:`~openturns.MonteCarloExperiment` is combined with :class:`~openturns.experimental.ActiveLearningUFunction`. Secondly, :class:`~openturns.SubsetSampling` is associated with :class:`~openturns.experimental.ActiveLearningGMMFunction`. We consider the four-branch function :math:`g : \mathbb{R}^2 \rightarrow \mathbb{R}` defined by: .. math:: :nowrap: \begin{align*} g(\vect{x}) = \min \begin{pmatrix}3+0.1(x_1-x_2)^2-\frac{(x_1+x_2)}{\sqrt{2}}\\ 3+0.1(x_1-x_2)^2+\frac{(x_1+x_2)}{\sqrt{2}}\\ (x_1-x_2)+ \frac{6}{\sqrt{2}}\\ (x_2-x_1)+ \frac{6}{\sqrt{2}} \end{pmatrix} \end{align*} and the input random vector :math:`\vect{X} = (X_1, X_2)` which follows the 2-dimensional Normal distribution: .. math:: :nowrap: \begin{align*} \vect{X} \sim \mathcal{N}(\mu = [0, 0], \sigma = [1.5,1.5], corr = \mat{I}_2) \end{align*} We want to evaluate the probability: .. math:: :nowrap: \begin{align*} p = \mathbb{P} ( g(\vect{X}) \leq 0 ) \end{align*} .. GENERATED FROM PYTHON SOURCE LINES 49-50 First, import the python modules: .. GENERATED FROM PYTHON SOURCE LINES 52-56 .. code-block:: Python import openturns as ot import openturns.experimental as otexp import openturns.viewer as otv .. GENERATED FROM PYTHON SOURCE LINES 57-58 Set the seed for reproducibility of the design of experiments: .. GENERATED FROM PYTHON SOURCE LINES 60-62 .. code-block:: Python ot.RandomGenerator.SetSeed(0) .. GENERATED FROM PYTHON SOURCE LINES 63-65 Create the probabilistic model :math:`Y = g(\vect{X})` ------------------------------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 67-68 Create the input random vector :math:`\vect{X}`: .. GENERATED FROM PYTHON SOURCE LINES 70-74 .. code-block:: Python input_distribution = ot.Normal([0.0, 0.0], [1.5, 1.5]) X = ot.RandomVector(input_distribution) input_dimension = input_distribution.getDimension() .. GENERATED FROM PYTHON SOURCE LINES 75-76 Create the function :math:`g` as a single symbolic expression: .. GENERATED FROM PYTHON SOURCE LINES 78-87 .. code-block:: Python g = ot.SymbolicFunction( ["x1", "x2"], [ "min(3+0.1*(x1-x2)^2-(x1+x2)/sqrt(2)," "3+0.1*(x1-x2)^2+(x1+x2)/sqrt(2)," "(x1-x2)+6/sqrt(2),(x2-x1)+6/sqrt(2))" ], ) .. GENERATED FROM PYTHON SOURCE LINES 88-89 Draw the function :math:`g` to understand the shape of the limit state function: .. GENERATED FROM PYTHON SOURCE LINES 91-101 .. code-block:: Python graph = ot.Graph("Four Branch function", "x1", "x2") graph.setAxes(True) graph.setGrid(True) graph.setLegendPosition("upper right") drawfunction = g.draw( [-5] * input_dimension, [5] * input_dimension, [100] * input_dimension ) graph.add(drawfunction) view = otv.View(graph) .. image-sg:: /auto_reliability/reliability_analysis/images/sphx_glr_plot_active_learning_reliability_001.svg :alt: Four Branch function :srcset: /auto_reliability/reliability_analysis/images/sphx_glr_plot_active_learning_reliability_001.svg :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 102-103 Create the output random vector :math:`Y = g(\vect{X})`: .. GENERATED FROM PYTHON SOURCE LINES 105-107 .. code-block:: Python Y = ot.CompositeRandomVector(g, X) .. GENERATED FROM PYTHON SOURCE LINES 108-110 Create the event :math:`\{ Y = g(\vect{X}) \leq 0 \}` ----------------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 112-115 .. code-block:: Python threshold = 0.0 event = ot.ThresholdEvent(Y, ot.Less(), threshold) .. GENERATED FROM PYTHON SOURCE LINES 116-120 Evaluate the probability with various active learning algorithms ---------------------------------------------------------------- To set an active learning algorithm, we must define its core components: the parameterized Gaussian process fitter, the wrapped simulation algorithm, and the active learning criterion. .. GENERATED FROM PYTHON SOURCE LINES 122-124 Definition of Gaussian Process fitter ------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 126-129 Creation of DoE with a limited size (number_samples_DoE = 10) and evaluation of the exact limit state function. The definition domain for the DoE (through the lower and upper bounds) is extended in order to get samples in rare event regions. It can be also defined by a combination of mean and standard deviation of the input distribution (for example, :math:`\mu \pm 4 \sigma`). .. GENERATED FROM PYTHON SOURCE LINES 131-141 .. code-block:: Python lower_bound_DoE = -5.0 upper_bound_DoE = 5.0 number_samples_DoE = 10 distribution_LHS = ot.JointDistribution( [ot.Uniform(lower_bound_DoE, upper_bound_DoE)] * input_dimension ) lhs = ot.LHSExperiment(distribution_LHS, number_samples_DoE) input_DoE = lhs.generate() output_DoE = g(input_DoE) .. GENERATED FROM PYTHON SOURCE LINES 142-143 Creation of Gaussian Process Fitter .. GENERATED FROM PYTHON SOURCE LINES 145-149 .. code-block:: Python basis = ot.ConstantBasisFactory(input_dimension).build() covariance_model = ot.MaternModel(input_dimension) fitter = ot.GaussianProcessFitter(input_DoE, output_DoE, covariance_model, basis) .. GENERATED FROM PYTHON SOURCE LINES 150-152 First example: Monte-Carlo simulation and "U" function for active learning criterion ------------------------------------------------------------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 154-157 Definition of Monte-Carlo algorithm. The settings of the Monte-Carlo algorithm can have a large impact on the results of the active learning algorithm. These settings should be carefully chosen. .. GENERATED FROM PYTHON SOURCE LINES 157-162 .. code-block:: Python Monte_Carlo_experiment = ot.MonteCarloExperiment() Monte_Carlo_algorithm = ot.ProbabilitySimulationAlgorithm(event, Monte_Carlo_experiment) Monte_Carlo_algorithm.setMaximumCoefficientOfVariation(0.01) Monte_Carlo_algorithm.setMaximumOuterSampling(5000) .. GENERATED FROM PYTHON SOURCE LINES 163-167 Definition of active learning function. Here, we choose the "U" function. This function takes two arguments. The first one is the event threshold. The second one is used to assess the convergence of active learning if the Convergence Criterion of :class:`~openturns.experimental.ActiveLearningReliabilityAlgorithm` is set to `ACTIVE_LEARNING`. Here, we choose that the algorithm will stop if the "U" function evaluations for all the samples of the simulation algorithm are greater than 2. .. GENERATED FROM PYTHON SOURCE LINES 167-172 .. code-block:: Python active_learning_convergence_threshold = 2.0 u_function = otexp.ActiveLearningUFunction( event.getThreshold(), active_learning_convergence_threshold ) .. GENERATED FROM PYTHON SOURCE LINES 173-175 Now, we can build the active learning algorithm. We define the maximal number of exact limit state function evaluations to 50. This budget keeps the gallery example fast enough for the test suite while remaining illustrative. .. GENERATED FROM PYTHON SOURCE LINES 175-181 .. code-block:: Python simulation_budget = 50 active_learning_MonteCarlo = otexp.ActiveLearningReliabilityAlgorithm( fitter, Monte_Carlo_algorithm, u_function ) active_learning_MonteCarlo.setMaximumIterations(simulation_budget) .. GENERATED FROM PYTHON SOURCE LINES 182-184 We need to select the stopping criterion of active learning algorithm. Here we choose to use a criterion based on the active learning function (with the settings given at the :class:`~openturns.experimental.ActiveLearningUFunction` instantiation). .. GENERATED FROM PYTHON SOURCE LINES 184-187 .. code-block:: Python convergence_criterion = active_learning_MonteCarlo.ACTIVE_LEARNING active_learning_MonteCarlo.setConvergenceCriterion(convergence_criterion) .. GENERATED FROM PYTHON SOURCE LINES 188-189 Now, we can run the algorithm and get results .. GENERATED FROM PYTHON SOURCE LINES 189-192 .. code-block:: Python active_learning_MonteCarlo.run() results_active_MonteCarlo = active_learning_MonteCarlo.getResult() .. GENERATED FROM PYTHON SOURCE LINES 193-194 Probability estimate .. GENERATED FROM PYTHON SOURCE LINES 194-196 .. code-block:: Python print("Probability estimate:", results_active_MonteCarlo.getProbabilityEstimate()) .. rst-class:: sphx-glr-script-out .. code-block:: none Probability estimate: 0.07019999999999993 .. GENERATED FROM PYTHON SOURCE LINES 197-199 Per-iteration inner simulation results are also exposed by the algorithm. For example, the inner result of the third enrichment iteration: .. GENERATED FROM PYTHON SOURCE LINES 199-202 .. code-block:: Python tenthIteration = active_learning_MonteCarlo.getSimulationResults()[9] print("Results at iteration 10:", tenthIteration) .. rst-class:: sphx-glr-script-out .. code-block:: none Results at iteration 10: probabilityEstimate=6.680000e-02 varianceEstimate=1.246755e-05 standard deviation=3.53e-03 coefficient of variation=5.29e-02 confidenceLength(0.95)=1.38e-02 outerSampling=5000 blockSize=1 .. GENERATED FROM PYTHON SOURCE LINES 203-204 Confidence interval of probability estimation due to Gaussian Process uncertainty .. GENERATED FROM PYTHON SOURCE LINES 204-208 .. code-block:: Python print( "Confidence interval:", results_active_MonteCarlo.getProbabilityConfidenceInterval() ) .. rst-class:: sphx-glr-script-out .. code-block:: none Confidence interval: [0.063, 0.0822] .. GENERATED FROM PYTHON SOURCE LINES 209-210 Number of function calls during active learning process .. GENERATED FROM PYTHON SOURCE LINES 210-215 .. code-block:: Python print( "Number of function calls during active learning:", results_active_MonteCarlo.getFunctionCallNumber(), ) .. rst-class:: sphx-glr-script-out .. code-block:: none Number of function calls during active learning: 50 .. GENERATED FROM PYTHON SOURCE LINES 216-219 Visualization of infill samples. We can draw the metamodel of the function and final DoE. We use the Gaussian process regressor refined with the active learning algorithm. We plot both the initial and enriched DoEs. We also plot the contours of the limit state approximation with the metamodel. .. GENERATED FROM PYTHON SOURCE LINES 221-243 .. code-block:: Python gprResult = results_active_MonteCarlo.getGprResult() metamodel = gprResult.getMetaModel() final_input_DoE = results_active_MonteCarlo.getGprResult().getInputSample() final_output_DoE = results_active_MonteCarlo.getGprResult().getOutputSample() graph = ot.Graph("Final Gaussian Process metamodel", "x1", "x2") graph.setAxes(True) graph.setGrid(True) graph.setLegendPosition("upper right") drawfunction = metamodel.draw( [-5] * input_dimension, [5] * input_dimension, [100] * input_dimension ) drawfunction.setTitle("Metamodel after active learning") drawfunction.setXTitle("x1") drawfunction.setYTitle("x2") cloud1 = ot.Cloud(final_input_DoE, "final DoE") cloud2 = ot.Cloud(input_DoE, "initial DoE") graph.add(drawfunction) graph.add(cloud1) graph.add(cloud2) view = otv.View(graph) # sphinx_gallery_thumbnail_number = 2 .. image-sg:: /auto_reliability/reliability_analysis/images/sphx_glr_plot_active_learning_reliability_002.svg :alt: Final Gaussian Process metamodel :srcset: /auto_reliability/reliability_analysis/images/sphx_glr_plot_active_learning_reliability_002.svg :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 244-245 We can see that as the active learning is goal-oriented, the metamodel is accurate only in the vicinity of the event threshold. .. GENERATED FROM PYTHON SOURCE LINES 247-248 We can compare the metamodel before and after refinement. .. GENERATED FROM PYTHON SOURCE LINES 248-265 .. code-block:: Python fitter.run() gpr_initial = ot.GaussianProcessRegression(fitter.getResult()) gpr_initial.run() metamodel_initial = gpr_initial.getResult().getMetaModel() drawfunction_initial = metamodel_initial.draw( [-5] * input_dimension, [5] * input_dimension, [100] * input_dimension ) drawfunction_initial.setTitle("Metamodel before active learning") drawfunction_initial.setXTitle("x1") drawfunction_initial.setYTitle("x2") grid = ot.GridLayout(1, 2) grid.setGraph(0, 1, drawfunction) grid.setGraph(0, 0, drawfunction_initial) _ = otv.View(grid) .. image-sg:: /auto_reliability/reliability_analysis/images/sphx_glr_plot_active_learning_reliability_003.svg :alt: , Metamodel before active learning, Metamodel after active learning :srcset: /auto_reliability/reliability_analysis/images/sphx_glr_plot_active_learning_reliability_003.svg :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 266-267 We can plot the probability history along the active learning process iterations. .. GENERATED FROM PYTHON SOURCE LINES 267-275 .. code-block:: Python graph_history = ot.Graph("Probability history", "iterations", "Probability estimate") graph_history.setGrid(True) probability_history = results_active_MonteCarlo.getProbabilityHistory() size_history = len(probability_history) graph_history.add(ot.Curve(range(size_history), probability_history)) _ = otv.View(graph_history) .. image-sg:: /auto_reliability/reliability_analysis/images/sphx_glr_plot_active_learning_reliability_004.svg :alt: Probability history :srcset: /auto_reliability/reliability_analysis/images/sphx_glr_plot_active_learning_reliability_004.svg :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 276-277 We can also plot the limit state provided by the true function and compare with the one estimated by the refined metamodel. .. GENERATED FROM PYTHON SOURCE LINES 277-317 .. code-block:: Python graph = ot.Graph("Limit states", "x1", "x2") g_IsoLines = g.draw( [-5] * input_dimension, [5] * input_dimension, [128] * input_dimension ) dr = g_IsoLines.getDrawable(0) dr.setLevels([threshold]) dr.setLegend("Limit state - true function") dr.setColor("blue") dr.setLineWidth(1) metamodel_initial_IsoLines = metamodel_initial.draw( [-5] * input_dimension, [5] * input_dimension, [128] * input_dimension ) dr_metamodel_initial = metamodel_initial_IsoLines.getDrawable(0) dr_metamodel_initial.setLevels([threshold]) dr_metamodel_initial.setLineStyle("dashed") dr_metamodel_initial.setLegend("Limit state - metamodel before active learning") dr_metamodel_initial.setColor("orange") dr_metamodel_initial.setLineWidth(1) metamodel_IsoLines = metamodel.draw( [-5] * input_dimension, [5] * input_dimension, [128] * input_dimension ) dr_metamodel = metamodel_IsoLines.getDrawable(0) dr_metamodel.setLevels([threshold]) dr_metamodel.setLineStyle("dashed") dr_metamodel.setLegend( "Limit state - metamodel obtained with Monte-Carlo and U function" ) dr_metamodel.setColor("red") dr_metamodel.setLineWidth(1) graph.add(dr) graph.add(dr_metamodel_initial) graph.add(dr_metamodel) graph.setLegendCorner([-0.05, -0.2]) graph.setLegendPosition("upper left") _ = otv.View(graph) .. image-sg:: /auto_reliability/reliability_analysis/images/sphx_glr_plot_active_learning_reliability_005.svg :alt: Limit states :srcset: /auto_reliability/reliability_analysis/images/sphx_glr_plot_active_learning_reliability_005.svg :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 318-320 Second example: Subset Sampling simulation and "Generalized Max Min" function for active learning criterion ------------------------------------------------------------------------------------------------------------ .. GENERATED FROM PYTHON SOURCE LINES 322-323 Definition of Subset sampling with default parameters .. GENERATED FROM PYTHON SOURCE LINES 323-325 .. code-block:: Python subset_algorithm = ot.SubsetSampling(event) .. GENERATED FROM PYTHON SOURCE LINES 326-329 Definition of active learning function. Here, we choose the "generalized max min" function: the infill point maximizes the distance to the current design weighted by the input PDF, see [lacaze2014]_. .. GENERATED FROM PYTHON SOURCE LINES 329-338 .. code-block:: Python active_learning_convergence_threshold = 1e-10 gmm_output_quantile = 0.1 gmm_function = otexp.ActiveLearningGMMFunction( threshold, active_learning_convergence_threshold, input_distribution, gmm_output_quantile, ) .. GENERATED FROM PYTHON SOURCE LINES 339-342 Now, we can build the active learning algorithm. The uncertainty-based stopping criterion evaluates several subset simulations per iteration, hence a smaller budget of 20 exact evaluations is enough here. .. GENERATED FROM PYTHON SOURCE LINES 342-347 .. code-block:: Python active_learning_subset = otexp.ActiveLearningReliabilityAlgorithm( fitter, subset_algorithm, gmm_function ) active_learning_subset.setMaximumIterations(20) .. GENERATED FROM PYTHON SOURCE LINES 348-362 Here we choose to stop the algorithm based on the probability uncertainty estimation due to the Gaussian Process Regressor model. We stop the algorithm if the difference between the probability estimated using :math:`\hat{g}(\vect{X}) + k \widehat{\sigma}(\vect{X})` and the probability estimated using :math:`\hat{g}(\vect{X}) - k \widehat{\sigma}(\vect{X})` is below a given threshold. Mathematically, the stopping criterion is given by .. math:: :nowrap: \begin{align*} \frac{|\Prob{\hat{g}(\vect{X}) + k \hat{\sigma}(\vect{X})\leq 0} - \Prob{\hat{g}(\vect{X}) - k \hat{\sigma}(\vect{X})\leq 0}|}{\Prob{\hat{g}(\vect{X})\leq 0}} \leq \epsilon \end{align*} In this example, we choose :math:`k = 2` and :math:`\epsilon = 0.2`. .. GENERATED FROM PYTHON SOURCE LINES 362-367 .. code-block:: Python convergence_criterion = active_learning_subset.PROBABILITY_UNCERTAINTY active_learning_subset.setConvergenceUncertaintyFactor(2.0) active_learning_subset.setConvergenceCriterionThreshold(0.2) active_learning_subset.setConvergenceCriterion(convergence_criterion) .. GENERATED FROM PYTHON SOURCE LINES 368-369 Now we can run the algorithm and get results .. GENERATED FROM PYTHON SOURCE LINES 369-372 .. code-block:: Python active_learning_subset.run() results_active_subset = active_learning_subset.getResult() .. GENERATED FROM PYTHON SOURCE LINES 373-374 Probability estimate .. GENERATED FROM PYTHON SOURCE LINES 374-376 .. code-block:: Python print("Probability estimate:", results_active_subset.getProbabilityEstimate()) .. rst-class:: sphx-glr-script-out .. code-block:: none Probability estimate: 0.06165000000000013 .. GENERATED FROM PYTHON SOURCE LINES 377-378 Confidence interval of probability estimation due to Gaussian Process uncertainty .. GENERATED FROM PYTHON SOURCE LINES 378-380 .. code-block:: Python print("Confidence interval:", results_active_subset.getProbabilityConfidenceInterval()) .. rst-class:: sphx-glr-script-out .. code-block:: none Confidence interval: [0.03947, 0.0971] .. GENERATED FROM PYTHON SOURCE LINES 381-382 Number of function calls .. GENERATED FROM PYTHON SOURCE LINES 382-384 .. code-block:: Python print("Number of function calls:", results_active_subset.getFunctionCallNumber()) .. rst-class:: sphx-glr-script-out .. code-block:: none Number of function calls: 20 .. GENERATED FROM PYTHON SOURCE LINES 385-390 Visualization of infill samples. We use the Gaussian process regressor refined with the active learning algorithm. We plot both the initial and enriched DoEs. We also plot the contours of the limit state approximation with the metamodel. We can see that the infilled samples using the GMM are more spread out than with the "U"-function. This is due to the fact that the GMM function takes the distance between the current DoE samples into account. .. GENERATED FROM PYTHON SOURCE LINES 390-410 .. code-block:: Python gprResult_subset = results_active_subset.getGprResult() metamodel_subset = gprResult_subset.getMetaModel() final_input_DoE_subset = results_active_subset.getGprResult().getInputSample() graph = ot.Graph("Final Gaussian Process metamodels", "x1", "x2") graph.setAxes(True) graph.setGrid(True) graph.setLegendPosition("upper right") drawfunction = metamodel_subset.draw( [-5] * input_dimension, [5] * input_dimension, [100] * input_dimension ) cloud1 = ot.Cloud(final_input_DoE_subset, "final DoE") cloud2 = ot.Cloud(input_DoE, "initial DoE") graph.add(drawfunction) graph.add(cloud1) graph.add(cloud2) view = otv.View(graph) otv.View.ShowAll() .. image-sg:: /auto_reliability/reliability_analysis/images/sphx_glr_plot_active_learning_reliability_006.svg :alt: Final Gaussian Process metamodels :srcset: /auto_reliability/reliability_analysis/images/sphx_glr_plot_active_learning_reliability_006.svg :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 411-412 We can also plot the limit state provided by the true function and compare with the one estimated by the new refined metamodel. .. GENERATED FROM PYTHON SOURCE LINES 412-434 .. code-block:: Python graph = ot.Graph("Limit states", "x1", "x2") levels = [0.0] graph.add(dr) graph.add(dr_metamodel_initial) graph.add(dr_metamodel) metamodel_IsoLines_subset = metamodel_subset.draw( [-5] * input_dimension, [5] * input_dimension, [128] * input_dimension ) dr_metamodel_subset = metamodel_IsoLines_subset.getDrawable(0) dr_metamodel_subset.setLevels([threshold]) dr_metamodel_subset.setLineStyle("dashed") dr_metamodel_subset.setLegend( "Limit state - metamodel obtained with Subset sampling and GMM" ) dr_metamodel_subset.setColor("green") dr_metamodel_subset.setLineWidth(1) graph.add(dr_metamodel_subset) graph.setLegendCorner([-0.05, -0.2]) graph.setLegendPosition("upper left") _ = otv.View(graph) otv.View.ShowAll() .. image-sg:: /auto_reliability/reliability_analysis/images/sphx_glr_plot_active_learning_reliability_007.svg :alt: Limit states :srcset: /auto_reliability/reliability_analysis/images/sphx_glr_plot_active_learning_reliability_007.svg :class: sphx-glr-single-img .. _sphx_glr_download_auto_reliability_reliability_analysis_plot_active_learning_reliability.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_active_learning_reliability.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_active_learning_reliability.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_active_learning_reliability.zip `