Skip to content

Commit 8e98fc7

Browse files
committed
docs: build readme
1 parent 1c38e2c commit 8e98fc7

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -44,34 +44,32 @@ prediction = ff$predict_newdata(newdata, task)
4444
prediction
4545
#> <PredictionRegr> for 3 observations:
4646
#> row_ids truth response
47-
#> 1 NA 450.0689
48-
#> 2 NA 472.9712
49-
#> 3 NA 482.1500
47+
#> 1 NA 446.8101
48+
#> 2 NA 473.1211
49+
#> 3 NA 485.5068
5050
prediction = ff$predict(task, 142:144)
51-
#> Warning in warn_deprecated("Task$data_formats"): Task$data_formats is
52-
#> deprecated and will be removed in the future.
5351
prediction
5452
#> <PredictionRegr> for 3 observations:
5553
#> row_ids truth response
56-
#> 1 461 455.8978
57-
#> 2 390 414.0475
58-
#> 3 432 402.1915
54+
#> 1 461 455.3990
55+
#> 2 390 409.9824
56+
#> 3 432 396.0751
5957
prediction$score(measure)
6058
#> regr.rmse
61-
#> 22.3074
59+
#> 23.95318
6260

6361
ff = Forecaster$new(lrn("regr.ranger"), 1:3)
6462
resampling = rsmp("forecast_holdout", ratio = 0.8)
6563
rr = resample(task, ff, resampling)
6664
rr$aggregate(measure)
6765
#> regr.rmse
68-
#> 105.1936
66+
#> 106.6029
6967

7068
resampling = rsmp("forecast_cv")
7169
rr = resample(task, ff, resampling)
7270
rr$aggregate(measure)
7371
#> regr.rmse
74-
#> 54.36987
72+
#> 49.93778
7573
```
7674

7775
### Multivariate
@@ -90,45 +88,47 @@ prediction = ff$predict(new_task, 142:144)
9088
ff$predict(new_task, 142:144)
9189
#> <PredictionRegr> for 3 observations:
9290
#> row_ids truth response
93-
#> 1 461 456.5591
94-
#> 2 390 410.6596
95-
#> 3 432 408.2172
91+
#> 1 461 455.7255
92+
#> 2 390 409.7808
93+
#> 3 432 405.6454
9694
prediction$score(measure)
9795
#> regr.rmse
98-
#> 18.36813
96+
#> 19.26714
9997

10098
row_ids = new_task$nrow - 0:2
10199
ff$predict_newdata(new_task$data(rows = row_ids), new_task)
102100
#> <PredictionRegr> for 3 observations:
103101
#> row_ids truth response
104-
#> 1 432 412.9277
105-
#> 2 390 391.1173
106-
#> 3 461 398.0259
102+
#> 1 432 411.3026
103+
#> 2 390 391.5954
104+
#> 3 461 396.3538
107105
newdata = new_task$data(rows = row_ids, cols = new_task$feature_names)
108106
ff$predict_newdata(newdata, new_task)
109107
#> <PredictionRegr> for 3 observations:
110108
#> row_ids truth response
111-
#> 1 NA 412.9277
112-
#> 2 NA 391.1173
113-
#> 3 NA 398.0259
109+
#> 1 NA 411.3026
110+
#> 2 NA 391.5954
111+
#> 3 NA 396.3538
114112

115113
resampling = rsmp("forecast_holdout", ratio = 0.8)
116114
rr = resample(new_task, ff, resampling)
117115
rr$aggregate(measure)
118116
#> regr.rmse
119-
#> 81.0461
117+
#> 81.93515
120118

121119
resampling = rsmp("forecast_cv")
122120
rr = resample(new_task, ff, resampling)
123121
rr$aggregate(measure)
124122
#> regr.rmse
125-
#> 44.99413
123+
#> 42.9069
126124
```
127125

128-
### WIP
126+
### mlr3pipelines integration
129127

130128
``` r
131-
# doesn't work since the graph learner does its own thing
132129
glrn = as_learner(pop %>>% ff)$train(task)
133-
glrn$predict(task, 142:144)
130+
prediction = glrn$predict(task, 142:144)
131+
prediction$score(measure)
132+
#> regr.rmse
133+
#> 18.60496
134134
```

0 commit comments

Comments
 (0)