New scikit-criteria 0.5
Closed this issue · 2 comments
Hi I am the author of scikit-criteria, and I just publish a new and improved version of the project (but is not backward compatible)
So I paste an equivalent snippet to replace the current functionality in POTATO
The import lines
POTATO/xpotato/models/trainer.py
Lines 14 to 15 in 7ec6876
Must be replaced with
import skcriteria as skc
from skcriteria.madm import simple
from skcriteria.pipeline import mkpipe
from skcriteria.preprocessing import invert_objectives, scalers
Then the code
POTATO/xpotato/models/trainer.py
Lines 95 to 104 in 7ec6876
must be replaced with
criteria_data = skc.mkdm(
matrix=stat_opt,
objectives=[min, max],
alternatives=val,
criteria=stat_opt.columns,
weights=[30, 70]
)
dm = mkpipe(
invert_objectives.MinimizeToMaximize(),
scalers.SumScaler(target="both"),
simple.WeightedSumModel()
)
dec = dm.evaluate(criteria_data)
Also: The previous versions of skcriteria have a conceptual bug. In many cases is incorrect to normalize before invert the objectives, so here I split the logic and must be manually assembled in a pipeline
Hello @leliel12.
We are very thankful for your input, I've updated the code based on your recommendations. It works well and your package is great!
Prefect thanks por the words!