sorbetto.parameterization.parameterization_default module

class sorbetto.parameterization.parameterization_default.ParameterizationDefault[source]

Bases: AbstractParameterization

This is the parameterization described in Piérard et al. [16].

getBoundsParameter1() tuple[float, float][source]
getBoundsParameter2() tuple[float, float][source]
getCanonicalImportance(param1, param2) Importance[source]

Returns the canonical importance corresponding to the given parameters.

Default implementation calls the getCanonicalImportanceVectorized (abstract) method.

Parameters:
  • param1 (float) – The first parameter.

  • param2 (float) – The second parameter.

Returns:

The canonical importance.

getCanonicalImportanceVectorized(param1: ndarray, param2: ndarray) ndarray[source]

Computes a array of canonical importances values corresponding to the given parameters.

This needs to be implemented by subclasses.

Parameters:
  • param1 (np.ndarray) – The first parameter array.

  • param2 (np.ndarray) – The second parameter array.

Returns:

an array of shape (N, 4) where N is the number of elements in param1 and param2.

getName()[source]
getNameParameter1()[source]
getNameParameter2()[source]
static getPriorNegForIsoValuedNoSkillPerformances(param1: float, param2: float) float[source]

Returns the prior of the negative class \(\pi_-\) such that the performance ordering located at (param1, param2) puts all the performances corresponding to the priors \((P(Y=c_-), P(Y=c_+))=(\pi_-, 1-\pi_-)\) on an equal footing.

See Piérard et al. [16], Fig. 6, left.

Parameters:
  • param1 (float) – the value of the first parameter, \(a\)

  • param2 (float) – the value of the second parameter, \(b\)

Returns:

\(\pi_-\)

Return type:

float

static getPriorPosForIsoValuedNoSkillPerformances(param1: float, param2: float) float[source]

Returns the prior of the positive class \(\pi_+\) such that the performance ordering located at (param1, param2) puts all the performances corresponding to the priors \((P(Y=c_-), P(Y=c_+))=(1-\pi_+, \pi_+)\) on an equal footing.

See Piérard et al. [16], Fig. 6, left.

Parameters:
  • param1 (float) – the value of the first parameter, \(a\)

  • param2 (float) – the value of the second parameter, \(b\)

Returns:

\(\pi_+\)

Return type:

float

static getRateNegPredictionsForIsoValuedNoSkillPerformances(param1: float, param2: float) float[source]

Returns the rate of predictions for the negative class \(\tau_-\) such that the performance ordering located at (param1, param2) puts all the performances corresponding to the prediction rates \((P(\hat{Y}=c_-), P(\hat{Y}=c_+))=(\tau_-, 1-\tau_-)\) on an equal footing.

See Piérard et al. [16], Fig. 6, right.

Parameters:
  • param1 (float) – the value of the first parameter, \(a\)

  • param2 (float) – the value of the second parameter, \(b\)

Returns:

\(\tau_-\)

Return type:

float

static getRatePosPredictionsForIsoValuedNoSkillPerformances(param1: float, param2: float) float[source]

Returns the rate of predictions for the positive class \(\tau_+\) such that the performance ordering located at (param1, param2) puts all the performances corresponding to the prediction rates \((P(\hat{Y}=c_-), P(\hat{Y}=c_+))=(1-\tau_+, \tau_+)\) on an equal footing.

See Piérard et al. [16], Fig. 6, right.

Parameters:
  • param1 (float) – the value of the first parameter, \(a\)

  • param2 (float) – the value of the second parameter, \(b\)

Returns:

\(\tau_+\)

Return type:

float

getValueParameter1(rankingScore) float[source]
getValueParameter2(rankingScore) float[source]
locateOrderingsPuttingNoSkillPerformancesOnAnEqualFootingForFixedClassPriors(priorPos: float) BilinearCurve[source]

The set of performance orderings induced by ranking scores that put all no-skill performances, for given class priors \((\pi_-, \pi_+)\), on an equal footing is given by

See Piérard et al. [16], Figure 6, left. # See Theorem 3 of future “paper 6”. # See Piérard et al. [16], Figure 8.

Parameters:

priorPos (float) – the prior of the positive class, \(\pi_+\)

Returns:

The locus (a curve).

Return type:

BilinearCurve

locateOrderingsPuttingNoSkillPerformancesOnAnEqualFootingForFixedPredictionRates(ratePos: float) BilinearCurve[source]

The set of performance orderings induced by ranking scores that put all no-skill performances, for given prediction rates \((\tau_-, \tau_+)\), on an equal footing is given by

See Piérard et al. [16], Figure 6, right. # See Theorem 4 of future “paper 6”.

Parameters:

ratePos (float) – the prediction rate for the positive class, \(\tau_+\)

Returns:

The locus (a curve).

Return type:

AbstractGeometricObject2D