SMOTE-function not working in R

0 votes

I need to apply the smote-algorithm to a data set, but can't get it to work.

Example:

x <- c(12,13,14,16,20,25,30,50,75,71)
y <- c(0,0,1,1,1,1,1,1,1,1)

frame <- data.frame(x,y)

library(DMwR)

smotedobs <- SMOTE(y~ ., frame, perc.over=300)

This gives the following error:

Error in scale.default(T, T[i, ], ranges) : subscript out of bounds
In addition: Warning messages:
1: In FUN(newX[, i], ...) :
  no non-missing arguments to max; returning -Inf
2: In FUN(newX[, i], ...) : no non-missing arguments to min; returning Inf

Would appriciate any kind of help or hints.

Jun 26, 2018 in Data Analytics by darklord
• 6,140 points
348 views

1 answer to this question.

0 votes

If you convert 'y' to a factor, SMOTE will return without error - but the synthesized observations have NA values for x

answered Jun 26, 2018 by CodingByHeart77
• 3,680 points

Related Questions In Data Analytics

0 votes
1 answer
0 votes
1 answer

Error saying "could not find function "shinyUI"" in shiny R

Its a small spelling mistake that you've ...READ MORE

answered Nov 28, 2018 in Data Analytics by Maverick
• 10,040 points
347 views
0 votes
1 answer

Error saying "could not find function dashboardPage" in shiny R

Include this line in the code: Library(shinydashboard) READ MORE

answered Nov 28, 2018 in Data Analytics by Maverick
• 10,040 points
196 views
0 votes
1 answer

Is there any easy way to fill in missing data?

You can try the following code: First, you ...READ MORE

answered Jun 20, 2018 in Data Analytics by DataKing99
• 8,100 points
39 views
0 votes
1 answer

How to find out cluster center mean of DBSCAN in R?

Just index back into the original data ...READ MORE

answered Jun 27, 2018 in Data Analytics by darklord
• 6,140 points
104 views
0 votes
1 answer

Create vector matrix of movie ratings using R project?

Why do'nt you try the dcast function, in the reshape2 package. d ...READ MORE

answered Jun 29, 2018 in Data Analytics by anonymous
65 views
0 votes
1 answer

List packages are used for data mining in R?

You can refer to the following packages ...READ MORE

answered Jul 3, 2018 in Data Analytics by DataKing99
• 8,100 points
29 views
0 votes
1 answer

How to write a custom function which will replace all the missing values in a vector with the mean of values in R?

Consider this vector: a<-c(1,2,3,NA,4,5,NA,NA) Write the function to impute ...READ MORE

answered Jul 4, 2018 in Data Analytics by CodingByHeart77
• 3,680 points
112 views
0 votes
2 answers

Apply function in R

apply Description: “Returns a vector or array or ...READ MORE

answered Jul 10, 2018 in Data Analytics by zombie
• 3,690 points
32 views