class AdaptiveHitMissPOD(*args)

Adaptive algorithm for hit miss data type.

Available constructor:

AdaptiveHitMissPOD(inputDOE, outputDOE, physicalModel, nMorePoints, detection, noiseThres, saturationThres)

Parameters
inputDOE2-d sequence of float

Vector of the input values. The first column must correspond with the defect sizes.

outputDOE2-d sequence of float

Vector of the signals, of dimension 1.

physicalModelopenturns.Function

True model used to compute the real hit miss value of the signal value to be added to the DOE.

nMorePointspositive int

The number of points to add to the DOE, computed by the physicalModel.

detectionfloat

Detection value of the signal if the physical model does not return a hit miss value.

noiseThresfloat

Value for low censored data. Default is None.

saturationThresfloat

Value for high censored data. Default is None

Warning

The first column of the input sample must corresponds with the defect sizes.

Notes

This class aims at building the POD based on a classifier model where the design of experiments is iteratively enriched. The initial design of experiments is given as input parameters. The enrichment criterion is based on the misclassification empirical risk. The criterion is computed on several candidate points. The sample of candidate points is created using a low discrepancy sequence (Sobol’) if the input distribution has an independant copula, otherwise a Monte Carlo experiment is used. The stopping criterion is only based on the number of points that must be added to the design of experiments.

The classifier algorithms availables are the SVC and the random forests. The choice of the algorithm can be defined using setClassifierType. The default algorithm is the random forests.

The physical model can return either the hit miss value (0 or 1) or the signal value. In this case, the detection value must be given and the physical model is transformed in order to provide a hit miss value.

The POD are computed by a Monte Carlo simulation for several defect values. The accuracy of the Monte Carlo simulation is taken into account using the TCL. The return POD model corresponds with an interpolate function built with the POD values computed for the given defect sizes. The default values are 20 defect sizes between the minimum and maximum value of the defect sample. The defect sizes can be changed using the method setDefectSizes.

A progress bar is shown if the verbosity is enabled. It can be disabled using the method setVerbose.

Methods

 computeDetectionSize(self, probabilityLevel) Compute the detection size for a given probability level. drawBoxCoxLikelihood(self[, name]) Draw the loglikelihood versus the Box Cox parameter. drawPOD(self[, probabilityLevel, …]) Draw the POD curve. Accessor to the Box Cox parameter. Accessor to the number of candidate points. getClassifier(self) Accessor to the classifier model. Accessor to the classifier parameters. Accessor to the classifier type. Accessor to the confusion matrix. getDefectSizes(self) Accessor to the defect size where POD is computed. Accessor to the parameters distribution. getGraphActive(self) Accessor to the graph verbosity. getInputDOE(self) Accessor to the final input values of the DOE. getOutputDOE(self) Accessor to the final output values of the DOE. getPMax(self) Accessor to the upper probability bound for the point selections. getPMin(self) Accessor to the lower probability bound for the point selections. getPODCLModel(self[, confidenceLevel]) Accessor to the POD model at a given confidence level. getPODModel(self) Accessor to the POD model. Accessor to the Monte Carlo sampling size. Accessor to the simulation size. getVerbose(self) Accessor to the verbosity. run(self) Launch the algorithm and build the POD models. setCandidateSize(self, size) Accessor to the number of candidate points. setClassifierParameters(self, parameters) Accessor to the classifier parameters. setClassifierType(self, classifier) Accessor to the classifier type. setDefectSizes(self, size) Accessor to the defect size where POD is computed. setDistribution(self, distribution) Accessor to the parameters distribution. setGraphActive(self, graphVerbose[, …]) Accessor to the graph verbosity. setPMax(self, pmax) Accessor to the upper probability bound for the point selections. setPMin(self, pmin) Accessor to the lower probability bound for the point selections. setSamplingSize(self, size) Accessor to the Monte Carlo sampling size. setSimulationSize(self, size) Accessor to the simulation size. setVerbose(self, verbose) Accessor to the verbosity.
computeDetectionSize(self, probabilityLevel, confidenceLevel=None)

Compute the detection size for a given probability level.

Parameters
probabilityLevelfloat

The probability level for which the defect size is computed.

confidenceLevelfloat

The confidence level associated to the given probability level the defect size is computed. Default is None.

Returns
resultcollection of openturns.PointWithDescription

A PointWithDescription containing the detection size computed at the given probability level and confidence level if provided.

drawBoxCoxLikelihood(self, name=None)

Draw the loglikelihood versus the Box Cox parameter.

Parameters
namestring

name of the figure to be saved with transparent option sets to True and bbox_inches=’tight’. It can be only the file name or the full path name. Default is None.

Returns
figmatplotlib.figure

Matplotlib figure object.

axmatplotlib.axes

Matplotlib axes object.

Notes

This method is available only when the parameter boxCox is set to True.

drawPOD(self, probabilityLevel=None, confidenceLevel=None, defectMin=None, defectMax=None, nbPt=100, name=None)

Draw the POD curve.

Parameters
probabilityLevelfloat

The probability level for which the defect size is computed. Default is None.

confidenceLevelfloat

The confidence level associated to the given probability level the defect size is computed. Default is None.

defectMin, defectMaxfloat

Define the interval where the curve is plotted. Default : min and max values of the input sample.

nbPtint

The number of points to draw the curves. Default is 100.

namestring

name of the figure to be saved with transparent option sets to True and bbox_inches=’tight’. It can be only the file name or the full path name. Default is None.

Returns
figmatplotlib.figure

Matplotlib figure object.

axmatplotlib.axes

Matplotlib axes object.

getBoxCoxParameter(self)

Accessor to the Box Cox parameter.

Returns
lambdaBoxCoxfloat

The Box Cox parameter used to transform the data. If the transformation is not enabled None is returned.

getCandidateSize(self)

Accessor to the number of candidate points.

Returns
sizeint

The number of candidate points on which the criterion is computed.

getClassifier(self)

Accessor to the classifier model.

Returns
resultclassifier

The classifier model, either random forest or svm.

getClassifierParameters(self)

Accessor to the classifier parameters.

getClassifierType(self)

Accessor to the classifier type.

getConfusionMatrix(self)

Accessor to the confusion matrix.

getDefectSizes(self)

Accessor to the defect size where POD is computed.

Returns
defectSizesequence of float

The defect sizes where the Monte Carlo simulation is performed to compute the POD.

getDistribution(self)

Accessor to the parameters distribution.

Returns
distributionopenturns.ComposedDistribution

The input parameters distribution, default is a Uniform distribution for all parameters.

getGraphActive(self)

Accessor to the graph verbosity.

Returns
graphVerbosebool

Enable or disable the display of the POD graph at each iteration. Default is False.

getInputDOE(self)

Accessor to the final input values of the DOE.

getOutputDOE(self)

Accessor to the final output values of the DOE.

getPMax(self)

Accessor to the upper probability bound for the point selections.

getPMin(self)

Accessor to the lower probability bound for the point selections.

getPODCLModel(self, confidenceLevel=0.95)

Accessor to the POD model at a given confidence level.

Parameters
confidenceLevelfloat

The confidence level the POD must be computed. Default is 0.95

Returns
PODModelClopenturns.Function

The function which computes the probability of detection for a given defect value at the confidence level given as parameter.

getPODModel(self)

Accessor to the POD model.

Returns
PODModelopenturns.Function

The function which computes the probability of detection for a given defect value.

getSamplingSize(self)

Accessor to the Monte Carlo sampling size.

Returns
sizeint

The size of the Monte Carlo simulation used to compute the POD for each defect size.

getSimulationSize(self)

Accessor to the simulation size.

Returns
sizeint

The size of the simulation used to compute the confidence interval.

getVerbose(self)

Accessor to the verbosity.

Returns
verbosebool

Enable or disable the verbosity. Default is True.

run(self)

Launch the algorithm and build the POD models.

Notes

This method launches the iterative algorithm. Once the algorithm stops, it builds the POD models : Monte Carlo simulation are performed for each defect sizes with the final classifier model. Eventually, the sample is used to compute the mean POD and the POD at the confidence level.

setCandidateSize(self, size)

Accessor to the number of candidate points.

Parameters
sizeint

The number of candidate points on which the criterion is computed

setClassifierParameters(self, parameters)

Accessor to the classifier parameters.

setClassifierType(self, classifier)

Accessor to the classifier type.

setDefectSizes(self, size)

Accessor to the defect size where POD is computed.

Parameters
defectSizesequence of float

The defect sizes where the Monte Carlo simulation is performed to compute the POD.

setDistribution(self, distribution)

Accessor to the parameters distribution.

Parameters
distributionopenturns.ComposedDistribution

The input parameters distribution.

setGraphActive(self, graphVerbose, probabilityLevel=None, confidenceLevel=None, directory=None)

Accessor to the graph verbosity.

Parameters
graphVerbosebool

Enable or disable the display of the POD graph at each iteration.

probabilityLevelfloat

The probability level for which the defect size is computed. Default is None.

confidenceLevelfloat

The confidence level associated to the given probability level the defect size is computed. Default is None.

directorystring

Directory where to save the graphs as png files.

setPMax(self, pmax)

Accessor to the upper probability bound for the point selections.

setPMin(self, pmin)

Accessor to the lower probability bound for the point selections.

setSamplingSize(self, size)

Accessor to the Monte Carlo sampling size.

Parameters
sizeint

The size of the Monte Carlo simulation used to compute the POD for each defect size.

setSimulationSize(self, size)

Accessor to the simulation size.

Parameters
sizeint

The size of the simulation used to compute the confidence interval.

setVerbose(self, verbose)

Accessor to the verbosity.

Parameters
verbosebool

Enable or disable the verbosity.