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