Add a function to reset the levels in a categorical column to the ones that are currently present

Description

This function would reset the levels in a H2OFrame column. The use-case is that someone subsets a frame using a categorical column, but the new/partitioned H2OFrame would still return the original levels when queried. There are many use-cases where you'd want to keep the original domain, but also use-cases where you'd want to reset it with the subset of levels that exist in the new frame.

Proposed name in R: `h2o.reset_levels()`, and in python: `h2o.H2OFrame.reset_levels()`

I'm assuming that we don’t want to use the existing `h2o.setLevels(x, levels, in.place = TRUE)` function (where the levels must be same size as previous levels). in python its `h2o.H2OFrame.set_levels()`

Side note: Even though we have `h2o.setLevels()` (camelCase in R), we have been making aliases for all these really old functions to use snake_case, as prescribed by the tidyverse Style Guide, which is the style guide we follow in H2O-R. I don't think it's worth creating the camelCase version of the `h2o.reset_levels()` function; its sufficient to have the snake case only. Also, while we're here, we could add the missing `h2o.set_levels()` alias for `h2o.setLevels()` in this ticket.

Assignee

New H2O Bugs

Fix versions

None

Reporter

Erin LeDell

Support ticket URL

None

Labels

None

Affected Spark version

None

Customer Request Type

None

Task progress

None

ReleaseNotesHidden

None

CustomerVisible

No

Components

Priority

Major