Guest User

Untitled

a guest
Jul 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. 'data.frame': 958000 obs. of 5 variables:
  2. $ date : Factor w/ 1916 levels "2013-01-01","2013-01-02",..: 1 2 3 4 5 6 7 8 9 10 ...
  3. $ store: int 1 1 1 1 1 1 1 1 1 1 ...
  4. $ item : int 1 1 1 1 1 1 1 1 1 1 ...
  5. $ sales: num 13 11 14 13 10 12 10 9 12 9 ...
  6. $ id : Factor w/ 45001 levels "0","1","10","100",..: 45001 45001 45001 45001 45001 45001 45001 45001 45001 45001 ...`
  7.  
  8. set.seed(1234)
  9. n = nrow(df_all)
  10. index = sample(1:n, size = round(0.7*n), replace=T)
  11. train = df_all[index, ]
  12. test = df_all[-index, ]
  13.  
  14. trainm <- sparse.model.matrix(sales ~ ., data= train)[,-1]
  15.  
  16. 6 x 46917 sparse Matrix of class "dgCMatrix"
  17. [[ suppressing 20 column names ‘date2013-01-02’, ‘date2013-01-03’, ‘date2013-01-04’ ... ]]
  18.  
  19. 108928 . . . . . . . . . . . . . . . . . . . .
  20. 596163 . . . . . . . . . . . . . . . . . . . .
  21. 583686 . . . . . . . . . . . . . . . . . . . .
  22. 597198 . . . . . . . . . . . . . . . . . . . .
  23. 824757 . . . . . . . . . . . . . . . . . . . .
  24. 613418 . . . . . . . . . . . . . . . . . . . .
  25.  
  26. 108928 ......
  27. 596163 ......
  28. 583686 ......
  29. 597198 ......
  30. 824757 ......
  31. 613418 ......
  32.  
  33. .....suppressing columns in show(); maybe adjust 'options(max.print= *, width = *)'
  34. ..............................
Add Comment
Please, Sign In to add comment