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 27, 2018 in Data Analytics by Sahiti
• 6,370 points
2,937 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 27, 2018 by CodingByHeart77
• 3,750 points

Related Questions In Data Analytics

+1 vote
1 answer
+1 vote
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,840 points
2,626 views
+1 vote
1 answer

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

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

answered Nov 29, 2018 in Data Analytics by Maverick
• 10,840 points
3,658 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,250 points
1,091 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 Sahiti
• 6,370 points
1,459 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 30, 2018 in Data Analytics by anonymous
1,155 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,250 points
1,549 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,750 points
4,556 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,790 points
1,077 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP