Skip to content

Commit c8c2474

Browse files
committed
Revert "refactor: move ames housing to mlr3 (#20)"
This reverts commit 9b7e8c2.
1 parent c0ce4a2 commit c8c2474

File tree

8 files changed

+53
-1
lines changed

8 files changed

+53
-1
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ LazyData: true
3131
LazyDataCompression: xz
3232
NeedsCompilation: no
3333
Roxygen: list(markdown = TRUE)
34-
RoxygenNote: 7.3.2
34+
RoxygenNote: 7.2.3

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
<<<<<<< HEAD
12
# mlr3data (development version)
23

34
# mlr3data 0.8.0
45

56
* Move `ames_housing` to mlr3.
67

8+
=======
9+
>>>>>>> parent of 9b7e8c2 (refactor: move ames housing to mlr3 (#20))
710
# mlr3data 0.7.0
811

912
* Added dataset `ames_housing`, used in the book about mlr3.

R/ames_housing.R

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#' @title House Sales in Ames, Iowa
2+
#'
3+
#' @name ames_housing
4+
#' @aliases mlr_tasks_ames_housing
5+
#'
6+
#' @description
7+
#' Regression task to predict house sale prices for Ames, Iowa.
8+
#'
9+
#' Contains 80 features and 2930 observations.
10+
#' Target column is `"Sale_Price"`.
11+
#'
12+
#' @docType data
13+
#' @keywords data
14+
#' @examples
15+
#' data("ames_housing", package = "mlr3data")
16+
#' str(ames_housing)
17+
NULL
18+
19+
get_ames_housing_task = function() {
20+
b = as_backend("ames_housing")
21+
task = mlr3::TaskRegr$new("ames_housing", b, target = "Sale_Price", label = "Ames House Sales")
22+
b$hash = task$man = "mlr3data::mlr_tasks_ames_housing"
23+
task
24+
}

R/zzz.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
register_tasks = function() {
55
x = getFromNamespace("mlr_tasks", ns = "mlr3")
66

7+
x$add("ames_housing", get_ames_housing_task)
78
x$add("bike_sharing", get_bike_sharing_task)
89
x$add("ilpd", get_ilpd_task)
910
x$add("kc_housing", get_kc_housing_task)

data-raw/ames_housing.R

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
requireNamespace("rprojroot")
2+
requireNamespace("data.table")
3+
root = rprojroot::find_package_root_file()
4+
5+
ames_housing = data.table::fread(file.path(root, "data-raw", "ames_housing.csv.bz2"), stringsAsFactors = TRUE)
6+
usethis::use_data(ames_housing, overwrite = TRUE, compress = "xz")

data-raw/ames_housing.csv.bz2

119 KB
Binary file not shown.

data/ames_housing.rda

98.2 KB
Binary file not shown.

man/ames_housing.Rd

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)