yanMHG / pandas_pareto

MIT License
1 stars 0 forks source link

pandas_pareto mixed minimise/maximise #1

Open Tim-Kirkwood opened 2 years ago

Tim-Kirkwood commented 2 years ago

Hi yanMHG,

Hope you're well. Your package looks ideal for some work I want to do, and was wondering if its possible to have different minimisation/maximisation objectives for different dataframe columns. From what I can tell, it looks like you have to apply the same objective for all columns in a given dataframe, but maybe I am misreading your code?

Also apologies if this is the wrong medium with which to contact you, I couldn't see any contact details.

Thanks, Tim

yanMHG commented 2 years ago

Hi Tim,

No worries about contacting me via a GitHub Issue. The package understands the optimization as either "maximizing all columns" or "minimizing all columns". I believe what you want is maximizing some columns while minimizing others. If this is the case, I believe you can hack this feature by selectively changing the sign of the columns of the DataFrame for which you want the opposite behavior. For example, if you want to maximize columns 1 to 3 and minimize columns 4 to 6, you could set the optimization type to "minimization" and change the sign of columns 1 to 3. This would effectively convert the "mixed minimise/maximise" problem into a purely "minimise" problem. Would this help you?