Skip to content

Commit

Permalink
Merge pull request #194 from hneth/master
Browse files Browse the repository at this point in the history
Maintenance
  • Loading branch information
hneth committed May 16, 2023
2 parents ac8c65b + d16ba14 commit a4f4307
Show file tree
Hide file tree
Showing 14 changed files with 139 additions and 61 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.9027
Date: 2023-05-13
Version: 1.9.0.9028
Date: 2023-05-15
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
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# FFTrees 1.9

## 1.9.0.9027
## 1.9.0.9028

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

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-05-10.]
[File `NEWS.md` last updated on 2023-05-14.]

<!-- eof. -->
79 changes: 59 additions & 20 deletions R/FFTreesdata_doc.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,28 @@

#' Blood donation data
#'
#' Data taken from the Blood Transfusion Service Center in Hsin-Chu City in Taiwan
#'
#' @format A data frame containing 748 rows and 5 columns.
#'
#' \describe{
#' \item{recency}{Months since last donation}
#' \item{frequency}{Total number of donations}
#' \item{total}{Total blood donated in c.c.}
#' \item{total}{Total blood donated (in c.c.)}
#' \item{time}{Months since first donation}
#' \item{donation.crit}{Did he/she donated blood in March 2007?}
#'
#' ...
#' \item{donation.crit}{\emph{Criterion}: Did the person donate blood (in March 2007)?
#' Values: \code{0}/no vs. \code{1}/yes (76.2\% vs.\ 23.8\%).}
#' }
#'
#' @family datasets
#'
#' @source https://archive.ics.uci.edu/ml/datasets/Blood+Transfusion+Service+Center
#'
#' Original owner and donor:
#' Prof. I-Cheng Yeh
#' Department of Information Management
#' Chung-Hua University
#'

"blood"

Expand All @@ -43,14 +50,18 @@
#' \item{chromatin}{Bland Chromatin}
#' \item{nucleoli}{Normal Nucleoli}
#' \item{mitoses}{Mitoses}
#' \item{diagnosis}{Is cancer present? TRUE or FALSE}
#'
#' ...
#' \item{diagnosis}{\emph{Criterion}: Absence/presence of breast cancer.
#' Values: \code{FALSE} vs. \code{TRUE} (65.0\% vs.\ 35.0\%).}
#' }
#'
#' @family datasets
#'
#' @source https://archive.ics.uci.edu/ml/datasets/Breast+Cancer+Wisconsin+(Original)
#' @source \url{https://archive.ics.uci.edu/ml/datasets/Breast+Cancer+Wisconsin+(Original)}
#'
#' Original creator:
#' Dr. William H. Wolberg (physician)
#' University of Wisconsin Hospitals
#' Madison, Wisconsin, USA

"breastcancer"

Expand All @@ -73,15 +84,15 @@
#' \item{persons}{Numeric}
#' \item{luggage}{Numeric}
#' \item{safety}{Factor}
#' \item{acceptability}{Factor}
#'
#' ...
#' \item{acceptability}{\emph{Criterion}: Category of acceptability rating (as factor).
#' Values: \code{unacc}/\code{acc}/\code{good}/\code{vgood} (70.0\%/22.2\%/4.0\%/3.8\%).}
#' }
#'
#' @family datasets
#'
#' @references
#' Bohanec, M., Rajkovic, V. (1990): Expert system for decision making. Sistemica 1 (1), pp. 145-157.
#' Bohanec, M., Rajkovic, V. (1990): Expert system for decision making.
#' \emph{Sistemica}, \emph{1} (1), 145--157.
#'
#' @source \url{http://archive.ics.uci.edu/ml/datasets/Car+Evaluation}
#'
Expand All @@ -96,12 +107,14 @@
#'
#' A subset of the 1987 National Indonesia Contraceptive Prevalence Survey.
#'
#' The samples describe married women who were either not pregnant or do not know if they were at the time of interview.
#' The samples describe married women who were either not pregnant
#' or do not know if they were pregnant at the time of the interview.
#'
#' The problem consists in predicting a woman's current contraceptive method choice (here: binarized \code{cont.crit})
#' The problem consists in predicting a woman's current contraceptive method choice
#' (here: binarized \code{cont.crit})
#' based on her demographic and socio-economic characteristics.
#'
#' @format A data frame containing 1473 rows and 10 columns.
#' @format A data frame containing 1473 cases (rows) and 10 variables (columns).
#'
#' \describe{
#' \item{wife.age}{Numeric}
Expand All @@ -113,9 +126,8 @@
#' \item{hus.occ}{Factor}
#' \item{sol}{Factor}
#' \item{media}{Numeric}
#' \item{cont.crit}{numeric}
#'
#' ...
#' \item{cont.crit}{\emph{Criterion}: Use of a contraceptive (as logical).
#' Values: \code{FALSE} vs. \code{TRUE} (42.7\% vs.\ 57.3\%).}
#' }
#'
#' @family datasets
Expand All @@ -126,12 +138,37 @@
"contraceptive"



# 5. creditapproval: ------

#' Credit approval data
#'
#' @format A data frame containing 690 rows and 15 columns
#' This data reports predictors and the result of credit card applications.
#' Its attribute names and values have been changed to symbols to protect confidentiality.
#'
#' This dataset contains a mix of attributes -- continuous, nominal with small Ns,
#' and nominal with larger Ns. There are also a few missing values.
#'
#' @format A data frame containing 690 cases (rows) and 15 variables (columns).
#'
#' \describe{
#' \item{c.1}{categorical: b, a}
#' \item{c.2}{continuous}
#' \item{c.3}{continuous}
#' \item{c.4}{categorical: u, y, l, t}
#' \item{c.5}{categorical: g, p, gg}
#' \item{c.6}{categorical: c, d, cc, i, j, k, m, r, q, w, x, e, aa, ff}
#' \item{c.7}{categorical: v, h, bb, j, n, z, dd, ff, o}
#' \item{c.8}{continuous}
#' \item{c.9}{categorical: t, f}
#' \item{c.10}{categorical: t, f}
#' \item{c.11}{continuous}
#' \item{c.12}{categorical: t, f}
#' \item{c.13}{categorical: g, p, s}
#' \item{c.14}{continuous}
#' \item{c.15}{continuous}
#' \item{crit}{\emph{Criterion}: Credit approval.
#' Values: \code{TRUE}/$+$ vs. \code{FALSE}/$-$ (44.5\% vs. 55.5\%).}
#' }
#'
#' @family datasets
#'
Expand All @@ -140,6 +177,8 @@
"creditapproval"


# +++ here now +++


# 6. fertility: ------

Expand Down
3 changes: 3 additions & 0 deletions R/util_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,10 @@ replace_NA_num <- function(df){

# ToDo: ------

# - Create describe_data() analogous to handle_NA_data():
# dims / criterion / predictors (by type) / NA values (by type)
# - Handle the consequences of allowing NAs in numeric predictors.
# - Handle NAs in the criterion variable.


# eof.
9 changes: 5 additions & 4 deletions R/util_gfft.R
Original file line number Diff line number Diff line change
Expand Up @@ -1757,7 +1757,7 @@ reorder_nodes <- function(fft, order = NA, quiet = FALSE){
# Goal: Apply reorder_nodes(fft) to get all possible permutations of cues for a fft.
#
# Input:
# fft: 1 FFT (as df, 1 row per cue)
# fft: 1 FFT (as tidy df, 1 row per cue)
#
# Output:
# A set of FFT definitions in all possible cue orders (predicting 1/Signal/TRUE for all changed cues, as reorder_nodes())
Expand Down Expand Up @@ -1840,7 +1840,7 @@ all_node_orders <- function(fft, quiet = FALSE){
#
# Method: Use flip_exits() on nodes = `all_combinations()` for all length values of 1:(n_cues - 1).
#
# Input: fft: 1 FFT (as df, 1 row per cue).
# Input: fft: 1 FFT (as tidy df, 1 row per cue).
# Output: A set of FFT definitions (ffts_df).


Expand Down Expand Up @@ -1919,9 +1919,10 @@ all_exit_structures <- function(fft, quiet = FALSE){

# Goal: Get all subtrees of an FFT.
#
# Input: fft: 1 FFT (as df, 1 row per cue).
# Input: fft: 1 FFT (as tidy df, 1 row per cue).
# Output: A set of FFT definitions (ffts_df).


all_node_subsets <- function(fft, quiet = FALSE){

# Prepare: ----
Expand Down Expand Up @@ -1994,7 +1995,7 @@ all_node_subsets <- function(fft, quiet = FALSE){
# 3. all_exit_structures()
# to get ALL possible variants of a given FFT.
#
# Input: fft: 1 FFT (as df, 1 row per cue).
# Input: fft: 1 FFT (as tidy df, 1 row per cue).
# Output: A set of FFT definitions (ffts_df).


Expand Down
2 changes: 0 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,12 @@ url_JDM_doi <- "https://doi.org/10.1017/S1930297500006239"
<!-- Devel badges end. -->



<!-- Release badges start: -->
<!-- [![CRAN status](https://www.r-pkg.org/badges/version/FFTrees)](https://CRAN.R-project.org/package=FFTrees) -->
<!-- [![Total downloads](https://cranlogs.r-pkg.org/badges/grand-total/FFTrees?color='00a9e0')](https://www.r-pkg.org/pkg/FFTrees) -->
<!-- Release badges end. -->



<!-- ALL badges start: -->
<!-- [![CRAN status](https://www.r-pkg.org/badges/version/FFTrees)](https://CRAN.R-project.org/package=FFTrees) -->
<!-- [![Build Status](https://travis-ci.org/ndphillips/FFTrees.svg?branch=master)](https://travis-ci.org/ndphillips/FFTrees) -->
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- README.md is generated from README.Rmd. Please only edit the .Rmd file! -->
<!-- Title, version and logo: -->

# FFTrees 1.9.0.9027 <img src = "./inst/FFTrees_Logo.jpg" align = "right" alt = "FFTrees" width = "225" />
# FFTrees 1.9.0.9028 <img src = "./inst/FFTrees_Logo.jpg" align = "right" alt = "FFTrees" width = "225" />

<!-- Devel badges start: -->

Expand Down Expand Up @@ -333,6 +333,6 @@ Examples include:

------------------------------------------------------------------------

\[File `README.Rmd` last updated on 2023-05-04.\]
\[File `README.Rmd` last updated on 2023-05-14.\]

<!-- eof. -->
14 changes: 7 additions & 7 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Gundle
Haehner
Hunink
ISI
Interpretable
Kagan
Klement
Lepiota
Expand All @@ -42,6 +43,7 @@ SDT
Seedat
Sistemica
Sonke
ToDo
UCI
Virginica
Visualise
Expand All @@ -63,7 +65,9 @@ cp
cr
data's
data’s
datur
dec
df
dfan
discriminability
dl
Expand All @@ -79,20 +83,18 @@ fft
flourosopy
fourier
gilled
github
glm
heartdisease
https
ics
ifan
ijrobp
jan
laplace
lr
mV
magrittr
mcu
mon
nd
ndphillips
np
npv
oldpeak
Expand All @@ -104,14 +106,12 @@ ppv
px
randomForest
restecg
rf
rlr
rpart
socio
specificities
stereotactic
subpanels
svm
tertium
testthat
th
thal
Expand Down
14 changes: 9 additions & 5 deletions man/blood.Rd

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

12 changes: 8 additions & 4 deletions man/breastcancer.Rd

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

0 comments on commit a4f4307

Please sign in to comment.