BookmarkSubscribeRSS Feed
frozenSea
Calcite | Level 5

Hello.

I have the following problem that I need to solve.

Let's suppose I have 2 variables (A and B) with 10 categories (ordinal most commonly) each containing nA1,...nA10,nb1,...nb10 clients each. I want to regroup these 10 categories into 3 categories called 1A, 1B and 1C (and for B:2A, 2B and 2C) and create a new variable lets say NEW_A and NEW_B.

Now, the problem is to tell SAS to optimize the selection of these new subcategories of A in order to maximize the diagonal of NEW_A and NEW_B, so the selection of -let's suppose 1A- NEW_A will bring the most clients of 2A, 1B of 2B...etc.

 

So the selection need to be recursive. That's all I could figure so far and the key is to maximize number of clients.

 

All help is greatly appreciated.

 

Thanks!

Jay

 

 

1 REPLY 1
rayIII
SAS Employee

Hi, Jay. I've been thinking about how to approach this problem. To find the optimal groupings there are many combinations to consider but you could try this simple (but nonexhaustive) approach: 

 

a. Build a decision tree to predict B from A using maxbranches = 3 and maxdepth = 1. This will give you A' which has grouped the 10 original categories into 3. 

 

b. Now predict A' from B, agaiin using maxbranches =3 and maxdepth = 1. This gives you B', with three ordered categories. 

 

Examine the 3 by 3 crosstabulation between A' and B'.

 

You can get the code for mapping A to A' and B to B' from the Decision Tree node in Enterprise Miner and apply the code using as SAS Code node. 

 

If that doesn't give you a satisfactory solution, try posting your question to the SAS “Mathematical Optimization, Discrete-event Simulation, and OR” community.  

 

Hope this helps.

 

Ray

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 855 views
  • 0 likes
  • 2 in conversation