Join the Inspire AMA with Joshua Burkhow, March 31-April 4. Ask, share, and connect with the Alteryx community!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Optimization newbie

lliberm1
7 - Meteor

I have what I believe is a relatively straight forward optimization flow.

I would like to select players that have the highest value (coefficient) relative to their cost.  The by player tab illustrates these data points.  you can either select a player or not so lower bound is 0, upper bound is 1, and type is binary.

on the constraint tab i have the players listed again with their cost (what we want to minimize) and their position.  i have set the positions to select 1 QB, 1 TE, 2 RB and 3 WR.  there needs to be a full team, you cant just have 1 QB and no one else for example.

I am not clear where i am going wrong now as i have never used this tool before and am following a guide online.  any help would be appreciated.

4 REPLIES 4
AngelosPachis
16 - Nebula

Hey @lliberm1 ,

 

Here's a couple of things you can fix in your workflow to get the Optimization tool working : 

 

  1. Your type should be B for binary and not as it's case sensitive (since it's a binary, no need to define upper and lower boundaries, so lb, ub columns can be omitted)
  2. You have to exclude the null values that feed in to the Objective input anchor
  3. The number of records in the A input anchor of the tool should be the same as the number of records that feed into the O input anchor. It appears some records/players appear more than once (I used a Unique tool to figure that, but you know the dataset better)
  4. In the B Input anchor, the optimisation tool recognizes the equal sign as == and not =

It appears to be working now, but I'm not sure what you are trying to achieve so I didn't mess the configuration more than to overcome those error messages

AngelosPachis_0-1619706460476.png

 

Hope that helps,

 

Angelos

lliberm1
7 - Meteor

Thanks @AngelosPachis 

I leveraged what you provided and updated a few items.

1) i realized that the maximize objective should be selected as we are looking to maximize value not minimize cost as that is already in the constraints.

2) i concatenated name and position to make unique records as some players had the same name but were different people

3) i updated some of where the data is coming from but shouldn't be material to the discussion

 

my issue now is that i want to limit the positions as its currently optimizing by selecting 2 QBs when i only want 1 max.  i thought my constraint of setting QB == 1 would handle that but it doesn't appear to be working.  i am not sure if that is because the constraint shows 1 for all the positions where not null?

apathetichell
19 - Altair

The data that you posted is all choppy - perhaps this is an earlier version? I'm only seeing two columns going into the 0 and a whole lot of errors popping up. Is there a version which runs but doesn't give you the results you want?

 

Off the top of my head I'd say that you should look at the Fantasy Sport League Optimization workflow which is under the help/sample workflows/predictive anlytics menu...

AngelosPachis
16 - Nebula

Hey @lliberm1 ,

 

Your constraints coming in the B anchor should come in the same order as from the A input anchor. For example, looking at the A input anchor, you have

 

AngelosPachis_0-1619767845416.png

 

You should rearrange the values in the B input anchor so they appear in the same order, so on the left hand side of the following image is how things used to be and on the right hand side how you should rearrange them

 

 

Untitled.png

 

Output now gives me only one QB

 

AngelosPachis_2-1619768138891.png

 

Hope that helps, let me know if that worked for you.

 

Cheers,

 

Angelos

 

Labels
Top Solution Authors