2021年1月3日星期日

In R, need to find best combination of 8 columns, only being able to select one value from each row

In R, I'm attempting to find the best combination of 8 different columns of values but with the caveat of only being able to select one value from each row. It sounds relatively simple, but I'm trying to avoid a nasty looping scenario to evaluate all possible options, so I'm hopeful there is a function available that could make this a possibility. There are scenarios where I will need to run this on datasets with over 2000 rows, so efficiency is really important.

Here is an example:

example dataset and highlighted desired result

I've been racking my brain and searching forever, but every scenario and solution I'm able to find can maximize series of columns but cant handle the condition of only allowing a single value per row. Are there any functions where this is possible?

https://stackoverflow.com/questions/65553169/in-r-need-to-find-best-combination-of-8-columns-only-being-able-to-select-one January 04, 2021 at 02:03AM

没有评论:

发表评论