adaamko/POTATO

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

from skcriteria import Data
from skcriteria.madm import simple

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

criteria_data = Data(
stat_opt,
[min, max],
anames=val,
cnames=stat_opt.columns,
weights=[30, 70],
)
dm = simple.WeightedSum(mnorm="sum")
dec = dm.decide(criteria_data)

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!