0

I have to change numeric columns to Enum type of h2o frame in sparkling water using Scala and how to print schema of h2o frame.

2 Answers2

0

You can use .toCategoricalVec

Here is an example of the usage:

val trainFrame:H2OFrame = bigTable
withLockAndUpdate(trainFrame){ fr => fr.replace(19, fr.vec("IsDepDelayed").toCategoricalVec)}
Lauren
  • 5,640
  • 1
  • 13
  • 19
0

We have to transform our H2OFrame.

Here is an example:

NameOfH2OFrame.colToEnum(Array(<"NameOfColumnYouWantToChangeInEnum">))

val h2oFrameTrain = h2oContext.asH2OFrame(trainingData)
h2oFrameTrain.colToEnum(Array("WEEKDAY_LABEL", "EVENT_TYPE", "EVENT_NAME"))
Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92