I want to perform a text-classfication with many (>50K) tokens as feature names. However the Task()
functions in mlr3
do not allow many characters in column names, which are passed by make.names
and are otherwise fine. Here is a list of them that I found so far:
mutate(token=str_replace(token, "à", "a")) %>%
mutate(token=str_replace(token, "ã", "a")) %>%
mutate(token=str_replace(token, "á", "a")) %>%
mutate(token=str_replace(token, "ø", "o")) %>%
mutate(token=str_replace(token, "ç", "c")) %>%
mutate(token=str_replace(token, "ô", "o")) %>%
mutate(token=str_replace(token, "é", "e")) %>%
mutate(token=str_replace(token, "é", "e")) %>%
mutate(token=str_replace(token, "í", "i")) %>%
mutate(token=str_replace(token, "î", "i")) %>%
mutate(token=str_replace(token, "è", "e")) %>%
mutate(token=str_replace(token, "ë", "e")) %>%
mutate(token=str_replace(token, "å", "a")) %>%
mutate(token=str_replace(token, "â", "a")) %>%
mutate(token=str_replace(token, "æ", "a")) %>%
mutate(token=str_replace(token, "ñ", "n")) %>%
How do I make my data.frame compatible with mlr3
, without manually replacing all special characters this way (trial and error)? make.names()
does obviously not work!
I would very much appreciate some help :) Thanks!