diff --git a/.DS_Store b/.DS_Store index c98a046..3aa9b2a 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/DESCRIPTION b/DESCRIPTION index c96b871..8ef24e5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: tidyrules Type: Package Title: Obtain Rules from Rule Based Models as Tidy Dataframe -Version: 0.1.4 +Version: 0.1.5 Authors@R: c( person("Srikanth", "Komala Sheshachala", email = "sri.teach@gmail.com", role = c("aut", "cre")), person("Amith Kumar", "Ullur Raghavendra", email = "amith54@gmail.com", role = c("aut")) @@ -22,7 +22,7 @@ Suggests: Cubist (>= 0.2.2), rpart (>= 1.2.2), rpart.plot (>= 3.0.7), - rsample (>= 0.0.2), + modeldata (>= 0.0.1), testthat (>= 2.0.1), MASS (>= 7.3.50), mlbench (>= 2.1.1), @@ -35,5 +35,5 @@ BugReports: https://github.com/talegari/tidyrules/issues License: GPL-3 Encoding: UTF-8 LazyData: true -RoxygenNote: 7.0.2 +RoxygenNote: 7.1.0 VignetteBuilder: knitr diff --git a/NEWS.md b/NEWS.md index 5872ab5..35b105b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# tidyrules 0.1.5 + +- Maintenance release (replace package rsample with modeldata) + # tidyrules 0.1.4 - Added rules parsable in python and SQL (default: R) diff --git a/R/c5.R b/R/c5.R index 7ffc06e..4888a5e 100644 --- a/R/c5.R +++ b/R/c5.R @@ -28,7 +28,7 @@ #' } #' #' @examples -#' data("attrition", package = "rsample") +#' data("attrition", package = "modeldata") #' attrition <- tibble::as_tibble(attrition) #' c5_model <- C50::C5.0(Attrition ~., data = attrition, rules = TRUE) #' summary(c5_model) diff --git a/R/cubist.R b/R/cubist.R index 101f1c5..ff7fba9 100644 --- a/R/cubist.R +++ b/R/cubist.R @@ -26,7 +26,7 @@ #' } #' #' @examples -#' data("attrition", package = "rsample") +#' data("attrition", package = "modeldata") #' attrition <- tibble::as_tibble(attrition) #' cols_att <- setdiff(colnames(attrition), c("MonthlyIncome", "Attrition")) #' diff --git a/R/varSpec.R b/R/varSpec.R index bc4a8ad..7709462 100644 --- a/R/varSpec.R +++ b/R/varSpec.R @@ -12,7 +12,7 @@ #' @return A tibble with three columns: variable(character), type(character) and #' levels(a list-column). For numeric variables, levels are set to NA. #' @examples -#' data("attrition", package = "rsample") +#' data("attrition", package = "modeldata") #' attrition <- tibble::as_tibble(attrition) #' cols_att <- setdiff(colnames(attrition), c("MonthlyIncome", "Attrition")) #' diff --git a/README.Rmd b/README.Rmd index d520f45..3583852 100644 --- a/README.Rmd +++ b/README.Rmd @@ -19,7 +19,7 @@ knitr::opts_chunk$set( [![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/tidyrules)](https://cran.r-project.org/package=tidyrules) -`tidyrules` converts texual rules from models to dataframes with parseable rules. Supported models are: `C5`, `cubist` and `rpart`. +`tidyrules` converts textual rules from models to dataframes with parseable rules. Supported models are: `C5`, `cubist` and `rpart`. ## Example diff --git a/docs/404.html b/docs/404.html index a1c3137..ec0611c 100644 --- a/docs/404.html +++ b/docs/404.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -53,7 +57,7 @@ - +
@@ -100,7 +104,7 @@
+ + @@ -135,7 +145,7 @@

Page not found (404)

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/articles/index.html b/docs/articles/index.html index 13699ee..bf49217 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -53,7 +57,7 @@ - +
@@ -100,7 +104,7 @@
@@ -139,7 +144,7 @@

All vignettes

-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/articles/tidyrules_vignette.html b/docs/articles/tidyrules_vignette.html index 67e23c3..7d07a87 100644 --- a/docs/articles/tidyrules_vignette.html +++ b/docs/articles/tidyrules_vignette.html @@ -6,19 +6,19 @@ Vignette_tidyrules • tidyrules - - - - + + + + + - - + - +
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/authors.html b/docs/authors.html index f5b0bb6..75c5bcc 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -53,7 +57,7 @@ - +
@@ -100,7 +104,7 @@
-

Site built with pkgdown 1.4.1.

+

Site built with pkgdown 1.5.1.

diff --git a/docs/bootstrap-toc.css b/docs/bootstrap-toc.css new file mode 100644 index 0000000..5a85941 --- /dev/null +++ b/docs/bootstrap-toc.css @@ -0,0 +1,60 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ + +/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ + +/* All levels of nav */ +nav[data-toggle='toc'] .nav > li > a { + display: block; + padding: 4px 20px; + font-size: 13px; + font-weight: 500; + color: #767676; +} +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 19px; + color: #563d7c; + text-decoration: none; + background-color: transparent; + border-left: 1px solid #563d7c; +} +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 18px; + font-weight: bold; + color: #563d7c; + background-color: transparent; + border-left: 2px solid #563d7c; +} + +/* Nav: second level (shown on .active) */ +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} +nav[data-toggle='toc'] .nav .nav > li > a { + padding-top: 1px; + padding-bottom: 1px; + padding-left: 30px; + font-size: 12px; + font-weight: normal; +} +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 29px; +} +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 28px; + font-weight: 500; +} + +/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ +nav[data-toggle='toc'] .nav > .active > ul { + display: block; +} diff --git a/docs/bootstrap-toc.js b/docs/bootstrap-toc.js new file mode 100644 index 0000000..1cdd573 --- /dev/null +++ b/docs/bootstrap-toc.js @@ -0,0 +1,159 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ +(function() { + 'use strict'; + + window.Toc = { + helpers: { + // return all matching elements in the set, or their descendants + findOrFilter: function($el, selector) { + // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ + // http://stackoverflow.com/a/12731439/358804 + var $descendants = $el.find(selector); + return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); + }, + + generateUniqueIdBase: function(el) { + var text = $(el).text(); + var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); + return anchor || el.tagName.toLowerCase(); + }, + + generateUniqueId: function(el) { + var anchorBase = this.generateUniqueIdBase(el); + for (var i = 0; ; i++) { + var anchor = anchorBase; + if (i > 0) { + // add suffix + anchor += '-' + i; + } + // check if ID already exists + if (!document.getElementById(anchor)) { + return anchor; + } + } + }, + + generateAnchor: function(el) { + if (el.id) { + return el.id; + } else { + var anchor = this.generateUniqueId(el); + el.id = anchor; + return anchor; + } + }, + + createNavList: function() { + return $(''); + }, + + createChildNavList: function($parent) { + var $childList = this.createNavList(); + $parent.append($childList); + return $childList; + }, + + generateNavEl: function(anchor, text) { + var $a = $(''); + $a.attr('href', '#' + anchor); + $a.text(text); + var $li = $('
  • '); + $li.append($a); + return $li; + }, + + generateNavItem: function(headingEl) { + var anchor = this.generateAnchor(headingEl); + var $heading = $(headingEl); + var text = $heading.data('toc-text') || $heading.text(); + return this.generateNavEl(anchor, text); + }, + + // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). + getTopLevel: function($scope) { + for (var i = 1; i <= 6; i++) { + var $headings = this.findOrFilter($scope, 'h' + i); + if ($headings.length > 1) { + return i; + } + } + + return 1; + }, + + // returns the elements for the top level, and the next below it + getHeadings: function($scope, topLevel) { + var topSelector = 'h' + topLevel; + + var secondaryLevel = topLevel + 1; + var secondarySelector = 'h' + secondaryLevel; + + return this.findOrFilter($scope, topSelector + ',' + secondarySelector); + }, + + getNavLevel: function(el) { + return parseInt(el.tagName.charAt(1), 10); + }, + + populateNav: function($topContext, topLevel, $headings) { + var $context = $topContext; + var $prevNav; + + var helpers = this; + $headings.each(function(i, el) { + var $newNav = helpers.generateNavItem(el); + var navLevel = helpers.getNavLevel(el); + + // determine the proper $context + if (navLevel === topLevel) { + // use top level + $context = $topContext; + } else if ($prevNav && $context === $topContext) { + // create a new level of the tree and switch to it + $context = helpers.createChildNavList($prevNav); + } // else use the current $context + + $context.append($newNav); + + $prevNav = $newNav; + }); + }, + + parseOps: function(arg) { + var opts; + if (arg.jquery) { + opts = { + $nav: arg + }; + } else { + opts = arg; + } + opts.$scope = opts.$scope || $(document.body); + return opts; + } + }, + + // accepts a jQuery object, or an options object + init: function(opts) { + opts = this.helpers.parseOps(opts); + + // ensure that the data attribute is in place for styling + opts.$nav.attr('data-toggle', 'toc'); + + var $topContext = this.helpers.createChildNavList(opts.$nav); + var topLevel = this.helpers.getTopLevel(opts.$scope); + var $headings = this.helpers.getHeadings(opts.$scope, topLevel); + this.helpers.populateNav($topContext, topLevel, $headings); + } + }; + + $(function() { + $('nav[data-toggle="toc"]').each(function(i, el) { + var $nav = $(el); + Toc.init($nav); + }); + }); +})(); diff --git a/docs/index.html b/docs/index.html index 8e0c96c..9fcd74d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,19 +6,19 @@ Obtain Rules from Rule Based Models as Tidy Dataframe • tidyrules - - - - + + + + + - - +
    -
    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.5.1.

    diff --git a/docs/reference/package_tidyrules.html b/docs/reference/package_tidyrules.html index e09bf0d..170a095 100644 --- a/docs/reference/package_tidyrules.html +++ b/docs/reference/package_tidyrules.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
    @@ -102,7 +105,7 @@

    - @@ -164,7 +158,7 @@

    Author

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.5.1.

    diff --git a/docs/reference/positionSpaceOutsideSinglequotes.html b/docs/reference/positionSpaceOutsideSinglequotes.html index ec7faeb..3bf367f 100644 --- a/docs/reference/positionSpaceOutsideSinglequotes.html +++ b/docs/reference/positionSpaceOutsideSinglequotes.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -38,7 +42,6 @@ - @@ -56,7 +59,7 @@ - +
    @@ -103,7 +106,7 @@
    - @@ -175,7 +174,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.5.1.

    diff --git a/docs/reference/removeEmptyLines.html b/docs/reference/removeEmptyLines.html index 11f3a3e..9ac4304 100644 --- a/docs/reference/removeEmptyLines.html +++ b/docs/reference/removeEmptyLines.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
    @@ -102,7 +105,7 @@
    - @@ -168,7 +167,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.5.1.

    diff --git a/docs/reference/ruleRToPython.html b/docs/reference/ruleRToPython.html index be78202..e48f5c4 100644 --- a/docs/reference/ruleRToPython.html +++ b/docs/reference/ruleRToPython.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
    @@ -102,7 +105,7 @@
    - @@ -162,7 +162,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.5.1.

    diff --git a/docs/reference/ruleRToSQL.html b/docs/reference/ruleRToSQL.html index cb33ed9..7d0b571 100644 --- a/docs/reference/ruleRToSQL.html +++ b/docs/reference/ruleRToSQL.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
    @@ -102,7 +105,7 @@
    - @@ -162,7 +162,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.5.1.

    diff --git a/docs/reference/strHead.html b/docs/reference/strHead.html index 6ecfbc6..87ae332 100644 --- a/docs/reference/strHead.html +++ b/docs/reference/strHead.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
    @@ -102,7 +105,7 @@
    - @@ -176,7 +174,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.5.1.

    diff --git a/docs/reference/strReplaceReduce.html b/docs/reference/strReplaceReduce.html index f0c8a74..23ccb5f 100644 --- a/docs/reference/strReplaceReduce.html +++ b/docs/reference/strReplaceReduce.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
    @@ -102,7 +105,7 @@
    - @@ -176,7 +175,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.5.1.

    diff --git a/docs/reference/strSplitSingle.html b/docs/reference/strSplitSingle.html index 5e9ad93..f108989 100644 --- a/docs/reference/strSplitSingle.html +++ b/docs/reference/strSplitSingle.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
    @@ -102,7 +105,7 @@
    - @@ -172,7 +171,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.5.1.

    diff --git a/docs/reference/strTail.html b/docs/reference/strTail.html index c254590..5174c2b 100644 --- a/docs/reference/strTail.html +++ b/docs/reference/strTail.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -37,7 +41,6 @@ - @@ -55,7 +58,7 @@ - +
    @@ -102,7 +105,7 @@
    - @@ -176,7 +174,7 @@

    Contents

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.5.1.

    diff --git a/docs/reference/tidyRules.C5.0.html b/docs/reference/tidyRules.C5.0.html index 4a3fb8b..31f019a 100644 --- a/docs/reference/tidyRules.C5.0.html +++ b/docs/reference/tidyRules.C5.0.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -38,7 +42,6 @@ - @@ -56,7 +59,7 @@ - +
    @@ -103,7 +106,7 @@
    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.5.1.

    diff --git a/docs/reference/tidyRules.cubist.html b/docs/reference/tidyRules.cubist.html index 6fa4700..251ae25 100644 --- a/docs/reference/tidyRules.cubist.html +++ b/docs/reference/tidyRules.cubist.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -38,7 +42,6 @@ - @@ -56,7 +59,7 @@ - +
    @@ -103,7 +106,7 @@
    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.5.1.

    diff --git a/docs/reference/tidyRules.html b/docs/reference/tidyRules.html index 37c9411..525960c 100644 --- a/docs/reference/tidyRules.html +++ b/docs/reference/tidyRules.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -38,7 +42,6 @@ - @@ -56,7 +59,7 @@ - +
    @@ -103,7 +106,7 @@
    - @@ -181,7 +178,7 @@

    Author

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.5.1.

    diff --git a/docs/reference/tidyRules.rpart.html b/docs/reference/tidyRules.rpart.html index f70045f..0e73488 100644 --- a/docs/reference/tidyRules.rpart.html +++ b/docs/reference/tidyRules.rpart.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -38,7 +42,6 @@ - @@ -56,7 +59,7 @@ - +
    @@ -103,7 +106,7 @@
    - @@ -193,7 +189,7 @@

    Author

    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.5.1.

    diff --git a/docs/reference/varSpec.html b/docs/reference/varSpec.html index d1ce428..2d81c98 100644 --- a/docs/reference/varSpec.html +++ b/docs/reference/varSpec.html @@ -10,23 +10,27 @@ - + - + - + + + + + - - + + - + - - + + @@ -38,7 +42,6 @@ - @@ -56,7 +59,7 @@ - +
    @@ -103,7 +106,7 @@
    -

    Site built with pkgdown 1.4.1.

    +

    Site built with pkgdown 1.5.1.

    diff --git a/man/tidyRules.C5.0.Rd b/man/tidyRules.C5.0.Rd index b6c1f37..2992149 100644 --- a/man/tidyRules.C5.0.Rd +++ b/man/tidyRules.C5.0.Rd @@ -34,7 +34,7 @@ The allowed options is one among: r, python, sql } } \examples{ -data("attrition", package = "rsample") +data("attrition", package = "modeldata") attrition <- tibble::as_tibble(attrition) c5_model <- C50::C5.0(Attrition ~., data = attrition, rules = TRUE) summary(c5_model) diff --git a/man/tidyRules.cubist.Rd b/man/tidyRules.cubist.Rd index 9599bfc..0cc9317 100644 --- a/man/tidyRules.cubist.Rd +++ b/man/tidyRules.cubist.Rd @@ -34,7 +34,7 @@ When col_classes argument is missing, an educated guess is made } } \examples{ -data("attrition", package = "rsample") +data("attrition", package = "modeldata") attrition <- tibble::as_tibble(attrition) cols_att <- setdiff(colnames(attrition), c("MonthlyIncome", "Attrition")) diff --git a/man/varSpec.Rd b/man/varSpec.Rd index 4b7ddcc..194e0f5 100644 --- a/man/varSpec.Rd +++ b/man/varSpec.Rd @@ -18,7 +18,7 @@ Obtain variable names, type (numeric, ordered, factor) and levels as a tibble } \examples{ -data("attrition", package = "rsample") +data("attrition", package = "modeldata") attrition <- tibble::as_tibble(attrition) cols_att <- setdiff(colnames(attrition), c("MonthlyIncome", "Attrition")) diff --git a/tests/testthat/test-c5.R b/tests/testthat/test-c5.R index 79f9098..e35ed94 100644 --- a/tests/testthat/test-c5.R +++ b/tests/testthat/test-c5.R @@ -7,7 +7,7 @@ context("test-c5") # setup some models ---- # attrition -data("attrition", package = "rsample") +data("attrition", package = "modeldata") attrition <- tibble::as_tibble(attrition) c5_att <- C50::C5.0(Attrition ~ ., data = attrition, rules = TRUE) diff --git a/tests/testthat/test-cubist.R b/tests/testthat/test-cubist.R index 40bf037..cfc8828 100644 --- a/tests/testthat/test-cubist.R +++ b/tests/testthat/test-cubist.R @@ -7,7 +7,7 @@ context("test-cubist") # setup some models ---- # attrition -data("attrition", package = "rsample") +data("attrition", package = "modeldata") attrition <- tibble::as_tibble(attrition) cols_att <- setdiff(colnames(attrition), c("MonthlyIncome", "Attrition")) diff --git a/tests/testthat/test-rpart.R b/tests/testthat/test-rpart.R index 70a0674..136c042 100644 --- a/tests/testthat/test-rpart.R +++ b/tests/testthat/test-rpart.R @@ -7,7 +7,7 @@ context("test-rpart") # setup some models ---- # attrition -data("attrition", package = "rsample") +data("attrition", package = "modeldata") attrition_1 <- attrition %>% dplyr::mutate_if(is.ordered, function(x) x <- factor(x,ordered = F)) %>% dplyr::mutate(Attrition = factor(Attrition, levels = c("No","Yes"))) diff --git a/vignettes/.DS_Store b/vignettes/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/vignettes/.DS_Store differ diff --git a/vignettes/tidyrules_vignette.Rmd b/vignettes/tidyrules_vignette.Rmd index e3d1c79..e7b33f8 100644 --- a/vignettes/tidyrules_vignette.Rmd +++ b/vignettes/tidyrules_vignette.Rmd @@ -67,7 +67,7 @@ library("C50") library("dplyr") # attrition data load -data("attrition", package = "rsample") +data("attrition", package = "modeldata") attrition <- as_tibble(attrition) glimpse(attrition) @@ -215,9 +215,9 @@ library("Cubist") # ames housing data set ames <- AmesHousing::make_ames() cubist_ames <- cubist(x = ames[, setdiff(colnames(ames), c("Sale_Price"))], - y = log10(ames[["Sale_Price"]]), - committees = 3 - ) + y = log10(ames[["Sale_Price"]]), + committees = 3 + ) # rule extract rules_ames <- tidyRules(cubist_ames) @@ -232,4 +232,4 @@ of `confidence` and `lift`. Here `mean`, `min` and `max` are calculated based on * C5.0: An Informal Tutorial * Recursive partitioning for classification, regression and survival trees -* Data Mining with Cubist \ No newline at end of file +* Data Mining with Cubist