Skip to content

Commit

Permalink
Replace tsk("boston_housing") with tsk("ames_housing")
Browse files Browse the repository at this point in the history
  • Loading branch information
be-marc committed Nov 4, 2024
1 parent f2fe89f commit a9ce0f0
Show file tree
Hide file tree
Showing 39 changed files with 192 additions and 180 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ Collate:
'TaskGeneratorSpirals.R'
'TaskGeneratorXor.R'
'TaskRegr.R'
'TaskRegr_boston_housing.R'
'TaskRegr_ames_housing.R'
'TaskRegr_mtcars.R'
'TaskUnsupervised.R'
'as_benchmark_result.R'
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# mlr3 (development version)

* fix: Quantiles must not ascend with probabilities.
* refactor: Replace `tsk("boston_housing")` with `tsk("ames_housing")`.

# mlr3 0.21.1

Expand Down
2 changes: 1 addition & 1 deletion R/PredictionRegr.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' @template seealso_prediction
#' @export
#' @examples
#' task = tsk("boston_housing")
#' task = tsk("ames_housing")
#' learner = lrn("regr.featureless", predict_type = "se")
#' p = learner$train(task)$predict(task)
#' p$predict_types
Expand Down
2 changes: 1 addition & 1 deletion R/Task.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#' For example, for a classification task a single column must be marked as target column, and others as features.
#'
#' Predefined (toy) tasks are stored in the [dictionary][mlr3misc::Dictionary] [mlr_tasks],
#' e.g. [`penguins`][mlr_tasks_penguins] or [`boston_housing`][mlr_tasks_boston_housing].
#' e.g. [`penguins`][mlr_tasks_penguins] or [`ames_housing`][mlr_tasks_ames_housing].
#' More toy tasks can be found in the dictionary after loading \CRANpkg{mlr3data}.
#'
#' @template param_id
Expand Down
35 changes: 35 additions & 0 deletions R/TaskRegr_ames_housing.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#' @title House Sales in Ames, Iowa
#'
#' @name ames_housing
#' @format [R6::R6Class] inheriting from [TaskRegr].
#' @aliases mlr_tasks_ames_housing
#'
#' @description
#' A regression task to predict house sale prices for Ames, Iowa.
#' This is the processed version from the [AmesHousing::make_ames()] package.
#'
#' Contains 80 features and 2930 observations.
#' Target column is `"Sale_Price"`.
#'
#' @section Construction:
#' ```
#' mlr_tasks$get("ames_housing")
#' tsk("ames_housing")
#' ```
#'
#' @section Meta Information:
#' `r rd_info(tsk("ames_housing"))`
#'
#' @template seealso_task
NULL

load_task_ames_housing = function(id = "ames_housing") {
b = as_data_backend(readRDS(system.file("extdata", "ames_housing.rds", package = "mlr3")))
task = mlr3::TaskRegr$new(id, b, target = "Sale_Price", label = "Ames House Sales")
b$hash = task$man = "mlr3::mlr_tasks_ames_housing"
task
}

#' @include mlr_tasks.R
mlr_tasks$add("ames_housing", load_task_ames_housing)

33 changes: 0 additions & 33 deletions R/TaskRegr_boston_housing.R

This file was deleted.

2 changes: 1 addition & 1 deletion R/partition.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' @export
#' @examples
#' # regression task partitioned into training and test set
#' task = tsk("boston_housing")
#' task = tsk("ames_housing")
#' split = partition(task, ratio = 0.5)
#' data = data.frame(
#' y = c(task$truth(split$train), task$truth(split$test)),
Expand Down
3 changes: 3 additions & 0 deletions inst/extdata/ames_housing.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
root = rprojroot::find_package_root_file()
data = setDT(AmesHousing::make_ames())
saveRDS(data, file = file.path(root, "inst", "extdata", "ames_housing.rds"), version = 2L)
Binary file added inst/extdata/ames_housing.rds
Binary file not shown.
2 changes: 1 addition & 1 deletion man/PredictionRegr.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/Task.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/TaskClassif.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/TaskRegr.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/TaskSupervised.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/TaskUnsupervised.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 72 additions & 0 deletions man/ames_housing.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/mlr_tasks.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

69 changes: 0 additions & 69 deletions man/mlr_tasks_boston_housing.Rd

This file was deleted.

2 changes: 1 addition & 1 deletion man/mlr_tasks_breast_cancer.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/mlr_tasks_german_credit.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/mlr_tasks_iris.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/mlr_tasks_mtcars.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/mlr_tasks_penguins.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/mlr_tasks_pima.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a9ce0f0

Please sign in to comment.