File: UnsupervisedTask.R

package info (click to toggle)
r-cran-mlr 2.19.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,264 kB
  • sloc: ansic: 65; sh: 13; makefile: 5
file content (27 lines) | stat: -rw-r--r-- 955 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
makeUnsupervisedTask = function(type, data, weights, blocking, fixup.data, check.data, coordinates) {
  task = makeTask(type, data, weights, blocking, fixup.data = fixup.data, check.data = check.data,
    coordinates = coordinates)
  if (check.data) {
    # we can't use getTaskData to access the tasks's data here because we then
    # want to access the description object which is not existing yet
    checkTaskData(task$env$data)
  }
  addClasses(task, "UnsupervisedTask")
}

#' @export
print.UnsupervisedTask = function(x, print.weights = TRUE, ...) {

  td = x$task.desc
  catf("Unsupervised task: %s", td$id)
  catf("Type: %s", td$type)
  catf("Observations: %i", td$size)
  catf("Features:")
  catf(printToChar(td$n.feat, collapse = "\n"))
  catf("Missings: %s", td$has.missings)
  if (print.weights) {
    catf("Has weights: %s", td$has.weights)
  }
  catf("Has blocking: %s", td$has.blocking)
  catf("Has coordinates: %s", td$has.coordinates)
}