smaa
mcda.smaa
Stochastic multi-criteria acceptability analysis on an MCDA run.
Classes
| Name | Description |
|---|---|
| SMAAReport | Outcome of an SMAA weight-sampling sensitivity analysis. |
SMAAReport
mcda.smaa.SMAAReport(self, base, sampled_weights, sampled_ranks, rank_acceptability_index, central_weight_vector, confidence_factor, method, n_samples, seed)
Outcome of an SMAA weight-sampling sensitivity analysis.
Holds a reference run with equal weights, the sampled weight matrix, the per-sample rank matrix, and three summary fields: the rank acceptability index, the central weight vector per tool, and the confidence factor per tool (Lahdelma and Salminen 2001).
Shapes: sampled_weights: (n_samples, n_metrics) sampled_ranks: (n_samples, n_tools), each row a rank permutation rank_acceptability_index: (n_tools, n_tools), entry [a, k - 1] is the empirical probability that tool a obtains rank k. central_weight_vector: (n_tools, n_metrics), the mean of the sampled weight vectors restricted to samples where tool a is top-ranked; row a is the zero vector if tool a is never top-ranked. confidence_factor: (n_tools,), the share of samples in which tool a is top-ranked; equal to rank_acceptability_index[:, 0].
Functions
| Name | Description |
|---|---|
| smaa | Run an SMAA-style weight-sampling sensitivity analysis on scores. |
smaa
mcda.smaa.smaa(scores, polarity, n_samples=1000, method='saw', alpha=None, seed=None, normalization=None, bounds=None, baselines=None, targets=None, missing='error')
Run an SMAA-style weight-sampling sensitivity analysis on scores.
Draw n_samples weight vectors from a Dirichlet over the metrics simplex (so every sampled vector is non-negative and sums to 1). For each draw, run the full MCDA pipeline with run and record the rank vector. Tabulate three summaries:
- The rank acceptability index, the empirical probability per tool and per rank.
- The central weight vector per tool, the mean of the sampled weights restricted to samples where that tool is top-ranked. A tool that is never top-ranked gets the zero vector.
- The confidence factor per tool, the share of samples in which the tool is top-ranked.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
scores |
Array-like of shape (n_tools, n_metrics). |
required | |
polarity |
Sequence[str] | Length n_metrics sequence of "higher_is_better" or "lower_is_better". Use beam.cards.polarities_for to source this from the registry. |
required |
n_samples |
int | Number of weight vectors to draw. Defaults to 1000. | 1000 |
method |
str | Aggregation method forwarded to run. Any of the five methods supported by run: "saw", "topsis", "vikor", "promethee_ii" or "comet". |
'saw' |
alpha |
Sequence[float] | None | Optional length n_metrics concentration vector for the Dirichlet draw. Defaults to ones, which gives a uniform distribution over the simplex. |
None |
seed |
int | None | Optional integer seed for the random generator. Recorded in the report so the run can be reproduced. | None |
normalization |
Optional per-metric normalization context forwarded to run. Default None keeps the run defaults (min-max with empirical extrema). Pass the values resolved by beam.mcda.registry_context so the SMAA analysis normalizes the scores the same way as the headline ranking. |
None |
|
bounds |
Optional per-metric normalization context forwarded to run. Default None keeps the run defaults (min-max with empirical extrema). Pass the values resolved by beam.mcda.registry_context so the SMAA analysis normalizes the scores the same way as the headline ranking. |
None |
|
baselines |
Optional per-metric normalization context forwarded to run. Default None keeps the run defaults (min-max with empirical extrema). Pass the values resolved by beam.mcda.registry_context so the SMAA analysis normalizes the scores the same way as the headline ranking. |
None |
|
targets |
Optional per-metric normalization context forwarded to run. Default None keeps the run defaults (min-max with empirical extrema). Pass the values resolved by beam.mcda.registry_context so the SMAA analysis normalizes the scores the same way as the headline ranking. |
None |
|
missing |
str | Missing-data policy forwarded to every run call; see beam.mcda.run. Defaults to "error". |
'error' |
Returns
| Type | Description |
|---|---|
| SMAAReport |