Mcompetitions / M5-methods

Data, Benchmarks, and methods submitted to the M5 forecasting competition
573 stars 232 forks source link

“NAs introduced by coercion” #4

Open JohnTaco93 opened 4 years ago

JohnTaco93 commented 4 years ago

Hi, when I run the code, the following error appears; Error in starting_period:nrow(sales_train): NA/NaN argument Warning message in eval(expr, envir, enclos): “NAs introduced by coercion”

I think this is the line that has problems: sales_train <- as.numeric(ex_sales[,6:ncol(ex_sales)])

I changed it to: sales_train <- as.numeric(ex_sales[,7:ncol(ex_sales)])

But I'm not sure if it's ok to make this change.

Thanks and Regards, John Taco

escott8908 commented 3 years ago

J

I Agree @JohnTaco93 . I think the author originally developed the script to work with sales_train_evaluation.csv instead of sales_train_validation.csv. The file sales_train_validation has an extra categorical column and therefore the index should be 7 instead of 6.