Description Usage Arguments Value Author(s) Examples
The function groups the classes of a categorical variable which have population percentage less than a threshold as "Low_pop_perc". The user can choose whether to club the missing class or keep it as separate class. The default setting is that missing classes are not treated separately.
1 | others_class(base, target, column_name, threshold, char_missing = NA)
|
base |
input dataframe |
target |
column / field name for the target variable to be passed as string (must be 0/1 type) |
column_name |
column name or array of column names of the dataframe on which the operation is to be done |
threshold |
threshold population percentage below which the class is to be classified as others, to be provided as decimal/fraction |
char_missing |
(optional) imputed missing value for categorical variable if its to be kept separate (default value is NA) |
base |
a dataframe after converting all low percentage classes into "Low_pop_perc" class |
mapping_table |
a dataframe with mapping between original classes which are now "Low_pop_perc" class (if any) |
Arya Poddar <aryapoddar290990@gmail.com>
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.