2

I'm having some issues using SMOTE, from the smotefamily package, my code keeps getting this error:

Error in get.knnx(data, query, k, algorithm) : Data non-numeric

I'm new at R Language, I'm trying to make the following work:

dados_treino_bal <- SMOTE(X = dados_treino, target = dados_treino$Inadimplente, K = ~ ., dup_size = 0)

SMOTE(X, target, K = 5, dup_size = 0)

Considering my dataset is correct with the proposed factors not all data is numeric, but that's how it's supposed to be right ?

For K I'm considering ~ + . to indicate I want all predictors variables

patL
  • 2,259
  • 1
  • 17
  • 38
  • as the error informs there is at least one none numeric column and smote only works on numeric data. Since you informed there are some factors but have not supplied any sample data my suggestion would be to transform the factor data to numeric before applying smote and then convert back to factor afterwards. – DPH Jul 17 '21 at 13:08

0 Answers0