Matrix.
add_criterion
Add a criterion into the matrix to evaluate each choice against.
criterion (str) – Name of the criterion to add.
weight (float) – How important this criterion is (usually on a 0-10 scale).
**choices_to_ratings (float, optional) – Immediately assign a rating (dictionary values) to given choices (dictionary keys).
ValueError – If a weight value is zero.
ValueError
Examples
>>> import matrix >>> m = matrix.Matrix() >>> m.add_criterion('taste', weight=7) >>> m | | taste | |:-------|--------:| | Weight | 7 |
>>> m = matrix.Matrix('apple', 'orange') >>> m.add_criterion('color', weight=3, apple=4, orange=6) >>> m | | color | Percentage | |:-------|--------:|:-------------| | Weight | 3 | | | apple | 4 | 40.0 | | orange | 6 | 60.0 |