Skip to content

Commit

Permalink
Merge pull request #190 from hneth/master
Browse files Browse the repository at this point in the history
Provide functions for converting and manipulating FFT definitions
  • Loading branch information
hneth committed Mar 29, 2023
2 parents c14dcf3 + b240cf2 commit e31b842
Show file tree
Hide file tree
Showing 18 changed files with 896 additions and 77 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: FFTrees
Type: Package
Title: Generate, Visualise, and Evaluate Fast-and-Frugal Decision Trees
Version: 1.9.0.9025
Date: 2023-03-25
Version: 1.9.0.9026
Date: 2023-03-29
Authors@R: c(person("Nathaniel", "Phillips", role = c("aut"), email = "Nathaniel.D.Phillips.is@gmail.com", comment = c(ORCID = "0000-0002-8969-7013")),
person("Hansjoerg", "Neth", role = c("aut", "cre"), email = "h.neth@uni.kn", comment = c(ORCID = "0000-0001-5427-3141")),
person("Jan", "Woike", role = "aut", comment = c(ORCID = "0000-0002-6816-121X")),
Expand Down
6 changes: 6 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ S3method(summary,FFTrees)
export(FFTrees)
export(FFTrees.guide)
export(add_fft_df)
export(add_nodes)
export(drop_nodes)
export(edit_nodes)
export(fftrees_apply)
export(fftrees_create)
export(fftrees_cuerank)
Expand All @@ -15,11 +18,14 @@ export(fftrees_ffttowords)
export(fftrees_threshold_factor_grid)
export(fftrees_threshold_numeric_grid)
export(fftrees_wordstofftrees)
export(flip_exits)
export(get_best_tree)
export(get_exit_type)
export(get_fft_df)
export(inwords)
export(read_fft_df)
export(reorder_nodes)
export(select_nodes)
export(showcues)
export(write_fft_df)
import(testthat)
Expand Down
10 changes: 5 additions & 5 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# FFTrees 1.9

## 1.9.0.9025
## 1.9.0.9026

This is the current development version of **FFTrees**, available at <https://github.com/ndphillips/FFTrees>.

Expand All @@ -17,9 +17,9 @@ Changes since last release:

<!-- gfft: Manipulating FFTs -->

- Enabling conversions between tree definition formats and manipulating individual FFTs:
- Enabled conversions between tree definition formats and manipulating individual FFTs:
- tree definition and conversion functions: `get_fft_df`, `read_fft_df`, `write_fft_df`, `add_fft_df`
- tree trimming functions: ...
- tree trimming functions: `add_nodes`, `drop_nodes`, `edit_nodes`, `flip_exits`, `reorder_nodes`, `select_nodes`


<!-- NA handling: -->
Expand All @@ -28,7 +28,7 @@ Changes since last release:
- `NA` values in categorical (i.e., character/factor/logical) predictors are treated as `<NA>` factor levels.
- `NA` values in numeric predictors are either _imputed_ (as the mean of the corresponding predictor) or
_ignored_ when creating and using FFTs to decide/predict (if possible).
- `NA` values in criterion are yet to be dealt with.
- `NA` values in the criterion variable are yet to be dealt with.


<!-- Stopping rule: -->
Expand Down Expand Up @@ -473,6 +473,6 @@ Thus, the main tree building function is now `FFTrees()` and the new tree object

------

[File `NEWS.md` last updated on 2023-03-25.]
[File `NEWS.md` last updated on 2023-03-29.]

<!-- eof. -->
4 changes: 2 additions & 2 deletions R/util_abc.R
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,8 @@ get_exit_word <- function(data){
#' in the one-line per FFT definition format used by an \code{FFTrees} object).
#'
#' @family utility functions
#' @family tree definition and conversion functions
#' @family tree definition and manipulation functions
#' @family tree selection, conversion, and collection functions
#'
#' @seealso
#' \code{\link{read_fft_df}} for reading one FFT definition from tree definitions;
Expand All @@ -474,7 +475,6 @@ get_exit_word <- function(data){
#'
#' @export


get_fft_df <- function(x){

# verify input:
Expand Down
6 changes: 3 additions & 3 deletions R/util_const.R
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ cost_cues_default <- 0 # (global constant)
# - numerical (integer / double )
# See clean_data() and handle_NA_data() in util_data.R for conversions.

cue_classes <- c( # (global constant)
cue_classes <- c( # (global constant)
"c", # categorical: character, factor, logical
"n") # numeric: integer, double

Expand Down Expand Up @@ -116,7 +116,7 @@ exit_types <- c(0, 1, 0.5) # (global constant)
# Stopping rules for (as character string):
# - "exemplars" #
# - "levels" # ToDo: implement by allowing stopping.par > 1
# - "statdelta" # ToDo: implement with stopping.par for goal.chase
# - "statdelta" # ToDo: stop 1 level earlier (when criterion satisfied)

stopping_rules <- c("exemplars", "levels", "statdelta") # (global constant)

Expand Down Expand Up @@ -153,7 +153,7 @@ replace_NA_num_pred <- TRUE # (global constant)

# - fin_NA_options: ----

# Options for dealing with NA values in final nodes / leaf cues:
# Options/policy for dealing with NA values in final nodes / leaf cues:

fin_NA_options <- c("noise", "signal", "baseline", "majority") # (global constant)

Expand Down

0 comments on commit e31b842

Please sign in to comment.