« ODBC driver. Excel client
SAS/Macro. Data step »


Maximum levels of 512

Posted by Oleg Solovyev on Feb 28, 2010

Working with Enterprise Miner I do often encounter an error “Maximum levels of 512 exceeded”. It occurs after adding new table to the project during the execution of one of the model nodes like decision tree or logistic regression. The reason is that one of the nominal variables has more than 512 different values.

maximum levels of 512 exceeded

SAS offers to workarounds:

  1. Put %let EM_TRAIN_MAXLEVELS=n; in the project SAS code that executes before the project starts. But the risk you face is that the interval variable was interpreted as nominal. In this case the results are unpredictable: from ignoring this variable in the model (decision trees) to inability to develop a model (regression with fixed number of vars).
  2. Redefine the variable role as “interval” if it is really an interval variable like date.

There is also another workaround. One can reduce the number of different values by grouping them. But in order to use the last two advices one has to know which variable causes the error. To define the variable one can add stat explore node to the input data node and run it. I recommend limiting the number of variable to use to nominal variables only (set role “rejected” to any other variable).

stat explore node

Besides other statistics stat explore calculates the number of levels in nominal variables. For instance ZIP variable from cup98lrn data set contains 19 938 different values. One can eliminate this variable from consideration or create another variable that contains only first two to three digits of the ZIP code.

stat explore output

Leave a Reply

Please type the word if you are not a spam-robot