My goal was to do Target Encoding when the target variable is continuous.
I installed the latest package (as of now) from GitHub repository, but got the following error:
java.lang.IllegalStateException: `target` must be a binary categorical vector. We do not support multi-class and continuos target case for now
java.lang.IllegalStateException: `target` must be a binary categorical vector. We do not support multi-class and continuos target case for now
at ai.h2o.targetencoding.TargetEncoder.ensureTargetColumnIsBinaryCategorical(TargetEncoder.java:188)
at ai.h2o.targetencoding.TargetEncoder.prepareEncodingMap(TargetEncoder.java:137)
at ai.h2o.targetencoding.TargetEncoder.prepareEncodingMap(TargetEncoder.java:198)
at ai.h2o.targetencoding.TargetEncoderBuilder$TargetEncoderDriver.computeImpl(TargetEncoderBuilder.java:45)
at hex.ModelBuilder$Driver.compute2(ModelBuilder.java:222)
at water.H2O$H2OCountedCompleter.compute(H2O.java:1417)
at jsr166y.CountedCompleter.exec(CountedCompleter.java:468)
at jsr166y.ForkJoinTask.doExec(ForkJoinTask.java:263)
at jsr166y.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:974)
at jsr166y.ForkJoinPool.runWorker(ForkJoinPool.java:1477)
at jsr166y.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104)
Error: java.lang.IllegalStateException: `target` must be a binary categorical vector. We do not support multi-class and continuos target case for now
It seems that the this is not an option for me right now for Target Encoding when target continuous variable.
I am wondering what you are trying to achieve by trying to encode a continuous variable. For a categorical variable like c('cat', 'dog') one can encode this as c(1,2) with the category cat encoded as 1 and dog - as 2. But for a continuous numeric variable I am not sure if/what encoding can be used (for).
Hi @valeri, I was not trying to target encode a predictor continuous variable. What I said above is:
"this is not an option for me right now for Target Encoding when targetcontinuous variable"
what it is continue is the target variable, but variable: animal (which will be encoded) is categorical.
Thanks @tlg265, I think I understand but I am not sure - if the operation is called targetencoding and the target is continuous, then isn't that what it is trying to encode? In my comment, I actually meant it in general, regardless if the continuous variable is a target or predictor - I still don't see sense in encoding it, unless by encoding we mean binning it somehow.
Sometimes this procedure is called "target-based encoding", which is perhaps a clearer name. What's being encoded is not the continuous "target" — instead, a continuous (or categorical) "target" variable is being used to encode a categorical variable. See: