You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was wondering about calculate_distance() and after_cut object.
How it will behave if one wants to calculate_distance() for factor vectors with different number of levels?
For example, if a train and test samples are provided from outside of R. One of the factor variables in test sample (variable_new) is missing some types of values and it won't have the same number of levels as the variable in train sample (variable_old). Then, if I'm not mistaken, c() that creates after_cuts, will encode them differently than it should.
I was wondering about calculate_distance() and after_cut object.
How it will behave if one wants to calculate_distance() for factor vectors with different number of levels?
For example, if a train and test samples are provided from outside of R. One of the factor variables in test sample (variable_new) is missing some types of values and it won't have the same number of levels as the variable in train sample (variable_old). Then, if I'm not mistaken, c() that creates after_cuts, will encode them differently than it should.
Example:
If that's indeed a problem, than maybe the change proposed below would solve it?
after_cuts <- as.factor(c(as.character(variable_old),as.character(variable_new)))
The text was updated successfully, but these errors were encountered: