0

I have a dataset "B_data" which looks like this. ( 84 Obs and 56 variables).

   ToF_Freq1 ToF_Freq2 ToF_Freq3 Hat_ToF_sd_Freq1  Hat_ToF_mean_Freq2  pfit_1
1  16.40474  17.22727  22.16426  0.6888009          30.24077          36.5500
2  16.45814  19.27711  21.43667  0.4256916          31.48554          74.85000

dim(B_data)
[1] 84 56

Then i convert the target variables to "factor".

Flag_B <- as.factor(datas$factor_B)

head(Flag_B)
[1] 1  1  1  1  1  10
Levels: 1 10 3 5

length(Flag_B)
[1] 86

and train the data set.

control <- trainControl(method = "repeatedcv",number = 3, repeats = 3)
rf_random <- train(B_data, Flag_B, method="rf", trcontrol = control, metric="Accuracy")

I have the similar error as in the post nrow(x) ==n is not true.

Error: nrow(x) == n is not TRUE. 

How do i fix this. I tried reading through but its of not much help.

Many thanks.

jmuhlenkamp
  • 2,102
  • 1
  • 14
  • 37
stochastiker
  • 25
  • 1
  • 11

0 Answers0