larch.model.troubleshooting.nothing_chosen_but_nonzero_weight#
- nothing_chosen_but_nonzero_weight(model, repair: Literal['?', '-', '*', '!'] = '?', verbose=3)[source]#
Check if some observations have no choice but have some weight.
- Parameters:
model (BaseModel) – The model to check.
repair ({'?', '-', '*', '!'}) – How to repair the data. Minus (‘-’) will make the weight zero when there is no choice. Star (‘*’) will also make the weight zero, plus autoscale all remaining weights so the total of the case weights equals the number of cases. A question mark (‘?’) effects no repair, and simply emits a warning.
verbose (int, default 3) – The number of example rows to list for each problem.
- Returns:
model (BaseModel) – The revised dataframe
diagnosis (pd.DataFrame) – The number of bad instances, by alternative, and some example rows.
- Raises:
ValueError – If the repair is set to ‘!’ and there are any conflicts found.