tlverse / sl3
Showing 1 of 1 files from the diff.

@@ -141,7 +141,7 @@
Loading
141 141
142 142
      task <- self$subset_covariates(task)
143 143
      processed_task <- self$process_formula(task)
144 -
      
144 +
145 145
      verbose <- getOption("sl3.verbose")
146 146
147 147
      if (!is.null(trained_sublearners)) {
@@ -186,7 +186,7 @@
Loading
186 186
      assert_that(is(task, "sl3_Task"))
187 187
      task <- self$subset_covariates(task)
188 188
      task <- self$process_formula(task)
189 -
      
189 +
190 190
      predictions <- private$.predict(task)
191 191
192 192
      ncols <- ncol(predictions)
@@ -204,7 +204,7 @@
Loading
204 204
      assert_that(is(task, "sl3_Task"))
205 205
      task <- self$subset_covariates(task)
206 206
      task <- self$process_formula(task)
207 -
      
207 +
208 208
      # use custom chain function if provided
209 209
      if (!is.null(private$.custom_chain)) {
210 210
        next_task <- private$.custom_chain(self, task)
@@ -298,42 +298,41 @@
Loading
298 298
      return(new_object)
299 299
    },
300 300
    process_formula = function(task) {
301 -
      if ("formula" %in% names(self$params) && 
302 -
          !is.null(self$params[["formula"]])) {
303 -
        
301 +
      if ("formula" %in% names(self$params) &&
302 +
        !is.null(self$params[["formula"]])) {
304 303
        form <- self$params$formula
305 304
        if (class(form) != "formula") form <- as.formula(form)
306 -
        
305 +
307 306
        # check response variable corresponds to outcome in task, if provided
308 -
        if(attr(terms(form), "response")){
307 +
        if (attr(terms(form), "response")) {
309 308
          if (!all.vars(form)[1] == task$nodes$outcome) {
310 309
            stop(paste0(
311 310
              "Outcome variable in formula ", all.vars(form)[1],
312 311
              " does not match the task's outcome ", task$nodes$outcome
313 312
            ))
314 313
          }
315 -
          formula_covars <- all.vars(form)[-1] 
314 +
          formula_covars <- all.vars(form)[-1]
316 315
        } else {
317 316
          formula_covars <- all.vars(form)
318 317
        }
319 318
        # check that regressors in the formula are contained in the task
320 -
        if(!all(formula_covars %in% task$nodes$covariates)){
319 +
        if (!all(formula_covars %in% task$nodes$covariates)) {
321 320
          stop("Regressors in the formula are not covariates in task")
322 321
        }
323 -
        
322 +
324 323
        # get data corresponding to formula and add new columns to the task
325 324
        data <- as.data.table(stats::model.matrix(form, data = task$data))
326 325
        new_cols <- setdiff(names(data), names(task$data))
327 -
        if(any(grepl("Intercept", new_cols))){
326 +
        if (any(grepl("Intercept", new_cols))) {
328 327
          new_cols <- new_cols[!grepl("Intercept", new_cols)]
329 328
        }
330 -
        data <- data[, new_cols, with = FALSE] 
329 +
        data <- data[, new_cols, with = FALSE]
331 330
        new_cols <- task$add_columns(data)
332 331
        return(
333 332
          task$next_in_chain(covariates = names(data), column_names = new_cols)
334 333
        )
335 334
      } else {
336 -
        return(task) 
335 +
        return(task)
337 336
      }
338 337
    }
339 338
  ),
Files Coverage
R 77.01%
Project Totals (90 files) 77.01%
s87qgj526k4rabg9
3e77rvxo8x8t7fbu
1
codecov:
2
  token: 0e172078-76a1-4b94-bd7f-2e10d0647b3d
3

4
comment: false
5

6
ignore:
7
  - "R/utils.R"
8

9
coverage:
10
  status:
11
    project:
12
      default:
13
        against: parent
14
        target: auto
15
        threshold: 1%
16
        branches:
17
          - master
18
        if_no_uploads: error
19
        if_not_found: success
20
        if_ci_failed: error
21
        only_pulls: false
22
        flags:
23
          - integration
24
        paths:
25
          - folder
26

27
    patch:
28
      default:
29
        against: parent
30
        target: 80%
31
        branches: null
32
        if_no_uploads: success
33
        if_not_found: success
34
        if_ci_failed: error
35
        only_pulls: false
36
        flags:
37
          - integration
38
        paths:
39
          - folder
40

41
    changes:
42
      default:
43
        against: parent
44
        branches: null
45
        if_no_uploads: error
46
        if_not_found: success
47
        if_ci_failed: error
48
        only_pulls: false
49
        flags:
50
          - integration
51
        paths:
52
          - folder
53

54
  flags:
55
    integration:
56
      branches:
57
        - master
58
      ignore:
59
        - app/ui
60

61
  ignore: # files and folders for processing
62
    - tests/*
63

64
  fixes:
65
    - "old_path::new_path"
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading