I am doing a NLP project and I am running a classification algorithm (RF). So basically, I have turned tokens turned into variables, and the dataframe is filled with their count to the respective text.
When I run a Random Forest, I get the following error:
Error in eval(predvars, data, env) : object 'bachelor's' not found
I have checked other posts and most of the time this error is related to a typo, or that the variable does not exist in the data set.
The variable is present in the data frame because when I ran df$bachelor's it returns the values of the column..
But, and I think the problem happens because of this:
When I write df$bachelor's, it transforms into df$
So it must be the way the variable is written, as it is nor recognised by the Random Forest. But the problem does not stop here and some variables like '2736e' also return an error. Is it because of the numbers?
I don't understand what is going on.
I tried to replicate the code but I couldn't ...
How can I fix this?
Thank you in advance
P.S: Let me know if something is not clear.