The cl-random-forest Reference Manual

This is the cl-random-forest Reference Manual, version 0.2, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 04:22:57 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 cl-random-forest

Random Forest for Common Lisp

Author

Satoshi Imai

License

MIT Licence

Long Description

* cl-random-forest

[[http://quickdocs.org/cl-random-forest/][http://quickdocs.org/badge/cl-random-forest.svg]]
[[https://github.com/masatoi/cl-random-forest/actions?query=workflow%3ACI][https://github.com/masatoi/cl-random-forest/workflows/CI/badge.svg]]

Cl-random-forest is a implementation of Random Forest for multiclass classification and univariate regression written in Common Lisp. It also includes a implementation of Global Refinement of Random Forest (Ren, Cao, Wei and Sun. "Global Refinement of Random Forest" CVPR2015). This refinement makes faster and more accurate than standard Random Forest.

** Features and Limitations

- Faster and more accurate than other major implementations such as scikit-learn (Python/Cython) or ranger (R/C++)

| | scikit-learn | ranger | cl-random-forest |
| MNIST | 96.95%, 41.72sec | 97.17%, 69.34sec | *98.29%*, *12.68sec* |
| letter | 96.38%, 2.569sec | 96.42%, *1.828sec* | *97.32%*, 3.497sec |
| covtype | 94.89%, 263.7sec | 83.95%, 139.0sec | *96.01%*, *103.9sec* |
| usps | 93,47%, 3.583sec | 93.57%, 11.70sec | *94.96%*, *0.686sec* |

- Supporting parallelization of training and prediction (tested on SBCL, CCL)

- It also includes Global Pruning algorithm of Random Forest which can make the model extremely compact

- Currently, multivariate regression is not implemented

** Installation

In quicklisp’s local-projects directory,

#+BEGIN_SRC
git clone https://github.com/masatoi/cl-online-learning.git
git clone https://github.com/masatoi/cl-random-forest.git
#+END_SRC

In Lisp,

#+BEGIN_SRC lisp
(ql:quickload :cl-random-forest)
#+END_SRC

When using Roswell,

#+BEGIN_SRC
ros install masatoi/cl-online-learning masatoi/cl-random-forest
#+END_SRC

** Usage
*** Classification
**** Prepare training dataset
A dataset consists of a target vector and a input data matrix.
For classification, the target vector should be a fixnum simple-vector and the data matrix should be a 2-dimensional single-float array whose row corresponds one datum.
Note that the target is a integer starting from 0.
For example, the following dataset is valid for 4-class classification with 2-dimensional input.

#+BEGIN_SRC lisp
(defparameter *target*
(make-array 11 :element-type ’fixnum
:initial-contents ’(0 0 1 1 2 2 2 3 3 3 3)))

(defparameter *datamatrix*
(make-array ’(11 2)
:element-type ’single-float
:initial-contents ’((-1.0 -2.0)
(-2.0 -1.5)
(1.0 -2.0)
(3.0 -1.5)
(-2.0 2.0)
(-3.0 1.0)
(-2.0 1.0)
(3.0 2.0)
(2.0 2.0)
(1.0 2.0)
(1.0 1.0))))
#+END_SRC

[[./docs/img/clrf-example-simple.png]]

**** Make Decision Tree

To construct a decision tree, MAKE-DTREE function is available. This function receives the number of classes, the data matrix and the target vector and then returns a decision tree object. This function also receives optionally the max depth of the tree and the minimum number of samples in the region the tree divides and the number of trials of splits.

#+BEGIN_SRC lisp
(defparameter *n-class* 4)

(defparameter *dtree*
(make-dtree *n-class* *datamatrix* *target*
:max-depth 5 :min-region-samples 1 :n-trial 10))
#+END_SRC

Next, make a prediction from the constructed decision tree with PREDICT-DTREE function. For example, to predict the first datum in the data matrix with this decision tree, do as follows.

#+BEGIN_SRC lisp
(predict-dtree *dtree* *datamatrix* 0)
;; => 0 (correct class id)
#+END_SRC

To make predictions for the entire dataset and calculate the accuracy, use TEST-DTREE function.

#+BEGIN_SRC lisp
(test-dtree *dtree* *datamatrix* *target*)
;; Accuracy: 100.0%, Correct: 11, Total: 11
#+END_SRC

**** Make Random Forest

To construct a random forest, MAKE-FOREST function is available. In addition to the MAKE-DTREE function arguments, this function receives optionally the number of decision trees and the bagging ratio that is used for sampling from training data to construct each sub decision trees.

#+BEGIN_SRC lisp
(defparameter *forest*
(make-forest *n-class* *datamatrix* *target*
:n-tree 10 :bagging-ratio 1.0
:max-depth 5 :min-region-samples 1 :n-trial 10))
#+END_SRC

Prediction and test of random forest are done in the almost same way as decision trees. PREDICT-FOREST function and TEST-FOREST function are available for each purpose.

#+BEGIN_SRC lisp
(predict-forest *forest* *datamatrix* 0)
;; => 0 (correct class id)

(test-forest *forest* *datamatrix* *target*)
;; Accuracy: 100.0%, Correct: 11, Total: 11
#+END_SRC

**** Global Refinement of Random Forest

Cl-random-forest has a way to improve pre-trained random forest using global information between each decision trees.
For this purpose, we make an another dataset from original dataset and pre-trained random forest.
When an original datum input into the random forest, the datum enters into a region which corresponds one leaf node for each decision trees.
The datum of the new dataset represents which position of leaf node the original datum entered for each decision tree.
Then we train a linear classifier (AROW) using this new dataset and the original target.

#+BEGIN_SRC lisp
;; Make refine learner
(defparameter *forest-learner* (make-refine-learner *forest*))

;; Make refine dataset
(defparameter *forest-refine-dataset* (make-refine-dataset *forest* *datamatrix*))

;; Train refine learner
(train-refine-learner *forest-learner* *forest-refine-dataset* *target*)

;; Test refine learner
(test-refine-learner *forest-learner* *forest-refine-dataset* *target*)
#+END_SRC

This TRAIN-REFINE-LEARNER function can be used to learn the dataset collectively, but it may be necessary to call this function several times until learning converges. TRAIN-REFINE-LEARNER-PROCESS function is used for training until converged.

#+BEGIN_SRC lisp
(train-refine-learner-process *forest-learner* *forest-refine-dataset* *target*
*forest-refine-dev-dataset* *dev-target*)
#+END_SRC

**** Global Pruning of Random Forest

***** Pruning
Global pruning is a method for compactization of the model size of the random forest using information of the global-refinement learner. A leaf node in a decision tree is no longer necessary when its corresponding element of the weight vector of the global-refinement learner has a small value norm.

To prune a forest destructively, after training the global-refinement learner, run PRUNING! function.

#+BEGIN_SRC lisp
;; Prune *forest*
(pruning! *forest* *forest-learner* 0.1)
#+END_SRC

The third argument is pruning rate. In this case, 10% leaf nodes are deleted.

***** Re-learning

After pruning, it is required to re-learn the global-refinement learner.

#+BEGIN_SRC lisp
;; Re-learning of refine-learner
(setf *forest-refine-dataset* (make-refine-dataset *forest* *datamatrix*))
(setf *forest-learner* (make-refine-learner *forest*))
(train-refine-learner *forest-learner* *forest-refine-dataset* *target*)
(test-refine-learner *forest-learner* *forest-refine-dataset* *target*)
#+END_SRC

The following figure shows the accuracy for test dataset and the number of leaf nodes when repeating pruning and re-learning on the MNIST dataset. We can see that the performance hardly changes even if the number of leaf nodes decreases to about 1/10.

[[./docs/img/clrf-mnist-pruning.png]]

**** Parallelization
The following several functions can be parallelized with [[https://lparallel.org/][lparallel]].

- MAKE-FOREST
- MAKE-REGRESSION-FOREST
- MAKE-REFINE-DATASET
- TRAIN-REFINE-LEARNER

To enable/disable parallelization, set lparallel’s kernel object. For example, to enable parallelization with 4 threads,

#+BEGIN_SRC lisp
;; Enable parallelization
(setf lparallel:*kernel* (lparallel:make-kernel 4))

;; Disable parallelization
(setf lparallel:*kernel* nil)
#+END_SRC

*** Regression
**** Prepare training dataset
In case of classification, the target is a vector of integer values, whereas in regression is a vector of continuous values.

#+BEGIN_SRC lisp
(defparameter *n* 100)

(defparameter *datamatrix*
(let ((arr (make-array (list *n* 1) :element-type ’single-float)))
(loop for i from 0 below *n* do
(setf (aref arr i 0) (random-uniform (- pi) pi)))
arr))

(defparameter *target*
(let ((arr (make-array *n* :element-type ’single-float)))
(loop for i from 0 below *n* do
(setf (aref arr i) (+ (sin (aref *datamatrix* i 0))
(random-normal :sd 0.1))))
arr))

(defparameter *test*
(let ((arr (make-array (list *n* 1) :element-type ’single-float)))
(loop for i from 0 below *n*
for x from (- pi) to pi by (/ (* 2 pi) *n*)
do (setf (aref arr i 0) x))
arr))

(defparameter *test-target*
(let ((arr (make-array *n* :element-type ’single-float)))
(loop for i from 0 below *n* do
(setf (aref arr i) (sin (aref *test* i 0))))
arr))
#+END_SRC

**** Make Regression Tree

#+BEGIN_SRC lisp
;; Make regression tree
(defparameter *rtree*
(make-rtree *datamatrix* *target* :max-depth 5 :min-region-samples 5 :n-trial 10))

;; Testing
(test-rtree *rtree* *test* *test-target*)
; RMSE: 0.09220732459820888

;; Make a prediction for first data point of test dataset
(predict-rtree *rtree* *test* 0)
; => -0.08374452528780077
#+END_SRC

**** Make Random Forest for Regression

#+BEGIN_SRC lisp
;; Make regression tree forest
(defparameter *rforest*
(make-regression-forest *datamatrix* *target*
:n-tree 100 :bagging-ratio 0.6
:max-depth 5 :min-region-samples 5 :n-trial 10))

;; Testing
(test-regression-forest *rforest* *test* *test-target*)
; RMSE: 0.05006872795207973

;; Make a prediction for first data point of test dataset
(predict-regression-forest *rforest* *test* 0)
; => -0.16540771296145781
#+END_SRC

[[./docs/img/clrf-regression.png]]

** Author
Satoshi Imai (satoshi.imai@gmail.com)

** Licence
This software is released under the MIT License, see LICENSE.txt.

Version

0.2

Dependencies
Source

cl-random-forest.asd.


2.2 cl-random-forest/cl-random-forest

Author

Satoshi Imai

License

MIT Licence

Dependencies
Source

cl-random-forest.asd.


2.3 cl-random-forest/src/random-forest

Author

Satoshi Imai

License

MIT Licence

Dependency

cl-random-forest/src/utils (system).

Source

cl-random-forest.asd.


2.4 cl-random-forest/src/utils

Author

Satoshi Imai

License

MIT Licence

Source

cl-random-forest.asd.


2.5 cl-random-forest/src/reconstruction

Author

Satoshi Imai

License

MIT Licence

Dependency

cl-random-forest/src/random-forest (system).

Source

cl-random-forest.asd.


2.6 cl-random-forest/src/feature-importance

Author

Satoshi Imai

License

MIT Licence

Dependency

cl-random-forest/src/random-forest (system).

Source

cl-random-forest.asd.


3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.2 cl-random-forest/cl-random-forest/file-type.lisp

Source

cl-random-forest.asd.

Parent Component

cl-random-forest/cl-random-forest (system).

Packages

cl-random-forest.


3.1.3 cl-random-forest/src/random-forest/file-type.lisp

Source

cl-random-forest.asd.

Parent Component

cl-random-forest/src/random-forest (system).

Packages

cl-random-forest/src/random-forest.

Public Interface
Internals

3.1.4 cl-random-forest/src/utils/file-type.lisp

Source

cl-random-forest.asd.

Parent Component

cl-random-forest/src/utils (system).

Packages

cl-random-forest/src/utils.

Public Interface
Internals

3.1.5 cl-random-forest/src/reconstruction/file-type.lisp

Source

cl-random-forest.asd.

Parent Component

cl-random-forest/src/reconstruction (system).

Packages

cl-random-forest/src/reconstruction.

Public Interface
Internals

3.1.6 cl-random-forest/src/feature-importance/file-type.lisp

Source

cl-random-forest.asd.

Parent Component

cl-random-forest/src/feature-importance (system).

Packages

cl-random-forest/src/feature-importance.

Public Interface

forest-feature-importance (function).

Internals

4 Packages

Packages are listed by definition order.


4.1 cl-random-forest/src/feature-importance

Source

file-type.lisp.

Nicknames
  • cl-random-forest.feature-importance
  • clrf.feature-importance
Use List
Used By List

cl-random-forest.

Public Interface

forest-feature-importance (function).

Internals

4.3 cl-random-forest/src/random-forest

Source

file-type.lisp.

Use List
Used By List
Public Interface
Internals

4.4 cl-random-forest/src/utils

Source

file-type.lisp.

Nicknames
  • cl-random-forest.utils
  • clrf.utils
Use List

common-lisp.

Used By List

cl-random-forest/src/random-forest.

Public Interface
Internals

4.5 cl-random-forest-asd

Source

cl-random-forest.asd.

Use List
  • asdf/interface.
  • common-lisp.

4.6 cl-random-forest/src/reconstruction

Source

file-type.lisp.

Nicknames
  • cl-random-forest.reconstruction
  • clrf.reconstruction
Use List
Used By List

cl-random-forest.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Macros

Macro: dotimes/pdotimes ((var n) &body body)
Package

cl-random-forest/src/utils.

Source

file-type.lisp.

Macro: mapc/pmapc (fn &rest lsts)
Package

cl-random-forest/src/utils.

Source

file-type.lisp.

Macro: mapcar/pmapcar (fn &rest lsts)
Package

cl-random-forest/src/utils.

Source

file-type.lisp.

Macro: push-ntimes (n lst &body body)
Package

cl-random-forest/src/utils.

Source

file-type.lisp.

Macro: train-refine-learner-process (refine-learner train-dataset train-target test-dataset test-target &key max-epoch)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.


5.1.2 Ordinary functions

Function: clol-dataset->datamatrix/target (dataset)
Package

cl-random-forest/src/utils.

Source

file-type.lisp.

Function: clol-dataset->datamatrix/target-regression (dataset)
Package

cl-random-forest/src/utils.

Source

file-type.lisp.

Function: cross-validation-forest-with-refine-learner (n-fold n-class datamatrix target &key n-tree bagging-ratio max-depth min-region-samples n-trial gain-test remove-sample-indices? gamma)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: decode-datum (forest leaf-index-vector &optional leaf-node-vector)
Package

cl-random-forest/src/reconstruction.

Source

file-type.lisp.

Function: encode-datum (forest datamatrix datum-index)
Package

cl-random-forest/src/reconstruction.

Source

file-type.lisp.

Function: entropy (sample-indices terminate-index dtree)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Reader: forest-bagging-ratio (instance)
Writer: (setf forest-bagging-ratio) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

bagging-ratio.

Reader: forest-class-count-array (instance)
Writer: (setf forest-class-count-array) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

class-count-array.

Reader: forest-datamatrix (instance)
Writer: (setf forest-datamatrix) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

datamatrix.

Reader: forest-datum-dim (instance)
Writer: (setf forest-datum-dim) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

datum-dim.

Reader: forest-dtree-list (instance)
Writer: (setf forest-dtree-list) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

dtree-list.

Function: forest-feature-importance (forest datamatrix target)
Package

cl-random-forest/src/feature-importance.

Source

file-type.lisp.

Reader: forest-gain-test (instance)
Writer: (setf forest-gain-test) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

gain-test.

Reader: forest-index-offset (instance)
Writer: (setf forest-index-offset) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

index-offset.

Reader: forest-max-depth (instance)
Writer: (setf forest-max-depth) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

max-depth.

Reader: forest-min-region-samples (instance)
Writer: (setf forest-min-region-samples) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

min-region-samples.

Reader: forest-n-class (instance)
Writer: (setf forest-n-class) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

n-class.

Reader: forest-n-leaf (instance)
Writer: (setf forest-n-leaf) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

n-leaf.

Reader: forest-n-tree (instance)
Writer: (setf forest-n-tree) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

n-tree.

Reader: forest-n-trial (instance)
Writer: (setf forest-n-trial) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

n-trial.

Function: forest-p (object)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Reader: forest-target (instance)
Writer: (setf forest-target) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

target.

Function: gini (sample-indices terminate-index dtree)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: make-dtree (n-class datamatrix target &key max-depth min-region-samples n-trial gain-test remove-sample-indices? save-parent-node? sample-indices)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: make-forest (n-class datamatrix target &key n-tree bagging-ratio max-depth min-region-samples n-trial gain-test remove-sample-indices? save-parent-node? balance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: make-refine-dataset (forest datamatrix)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: make-refine-learner (forest &optional gamma)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: make-regression-forest (datamatrix target &key n-tree bagging-ratio max-depth min-region-samples n-trial gain-test remove-sample-indices? save-parent-node?)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: make-regression-refine-dataset (forest datamatrix)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: make-regression-refine-learner (forest &optional gamma)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: make-rtree (datamatrix target &key max-depth min-region-samples n-trial gain-test remove-sample-indices? save-parent-node? sample-indices)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: predict-dtree (dtree datamatrix datum-index)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: predict-forest (forest datamatrix datum-index)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: predict-refine-learner (forest refine-learner datamatrix datum-index)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: predict-regression-forest (forest datamatrix datum-index)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: predict-regression-refine-learner (forest refine-learner datamatrix datum-index)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: predict-rtree (rtree datamatrix datum-index)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: pruning! (forest learner &optional pruning-rate min-depth)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: random-normal (&key mean sd)
Package

cl-random-forest/src/utils.

Source

file-type.lisp.

Function: random-uniform (start end)
Package

cl-random-forest/src/utils.

Source

file-type.lisp.

Function: read-data (data-path data-dimension)
Package

cl-random-forest/src/utils.

Source

file-type.lisp.

Function: read-data-regression (data-path data-dimension)
Package

cl-random-forest/src/utils.

Source

file-type.lisp.

Function: reconstruction-dtree (leaf-node input-range-array)
Package

cl-random-forest/src/reconstruction.

Source

file-type.lisp.

Function: reconstruction-forest (forest datamatrix datum-index)
Package

cl-random-forest/src/reconstruction.

Source

file-type.lisp.

Function: test-dtree (dtree datamatrix target &key quiet-p)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: test-forest (forest datamatrix target &key quiet-p)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: test-refine-learner (refine-learner refine-dataset target &key quiet-p mini-batch-size)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: test-regression-forest (forest datamatrix target &key quiet-p)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: test-regression-refine-learner (refine-learner refine-dataset target &key quiet-p)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: test-rtree (rtree datamatrix target &key quiet-p)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: train-refine-learner (refine-learner refine-dataset target)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: train-regression-refine-learner (refine-learner refine-dataset target)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: variance (sample-indices terminate-index rtree)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: write-to-r-format-from-clol-dataset (dataset file)
Package

cl-random-forest/src/utils.

Source

file-type.lisp.


5.1.3 Standalone methods

Method: print-object ((object dtree) stream)
Source

file-type.lisp.

Method: print-object ((object forest) stream)
Source

file-type.lisp.

Method: print-object ((object node) stream)
Source

file-type.lisp.


5.2 Internals


5.2.1 Macros

Macro: do-index-value-list ((index value list) &body body)
Package

cl-random-forest/src/utils.

Source

file-type.lisp.


5.2.2 Ordinary functions

Function: %make-dtree (&key n-class class-count-array datum-dim datamatrix target root max-depth min-region-samples n-trial gain-test remove-sample-indices? save-parent-node? tmp-arr1 tmp-index1 tmp-arr2 tmp-index2 best-arr1 best-index1 best-arr2 best-index2 max-leaf-index id)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: %make-forest (&key n-tree bagging-ratio datamatrix target dtree-list n-class class-count-array datum-dim max-depth min-region-samples n-trial gain-test n-leaf index-offset)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: %make-node (&key sample-indices n-sample depth test-attribute test-threshold information-gain parent-node left-node right-node dtree leaf-index)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: %print-dtree (obj stream)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: %print-forest (obj stream)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: %print-node (obj stream)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: argmax (arr)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: balanced-bootstrap-sample-indices (n n-class target)

Bagging classifiers induced over balanced bootstrap samples. Also known as Balanced Random Forest.

This implementation counts the number of examples in each class, which might be inefficient.

> In this work we provide such an explanation, and we conclude that
> in almost all imbalanced scenarios, practitioners should bag classifiers induced over
> balanced bootstrap samples.

Wallace, Byron C., et al. “Class imbalance, redux.”
2011 IEEE 11th International Conference on Data Mining (ICDM), 2011.

Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: bootstrap-sample-indices (n datamatrix)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: calc-accuracy (n-correct len &key quiet-p)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: children-l2-norm (node l2-norm-arr forest)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: class-distribution (sample-indices terminate-index dtree)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: class-distribution-forest (forest datamatrix datum-index)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: clean-dtree! (dtree)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: collect-leaf-parent (forest)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: collect-leaf-parent-sorted (forest learner)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: copy-dtree (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: copy-forest (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: copy-node (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: copy-tmp->best! (dtree)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: delete-children! (node)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: do-leaf (fn node)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Reader: dtree-best-arr1 (instance)
Writer: (setf dtree-best-arr1) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

best-arr1.

Reader: dtree-best-arr2 (instance)
Writer: (setf dtree-best-arr2) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

best-arr2.

Reader: dtree-best-index1 (instance)
Writer: (setf dtree-best-index1) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

best-index1.

Reader: dtree-best-index2 (instance)
Writer: (setf dtree-best-index2) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

best-index2.

Reader: dtree-class-count-array (instance)
Writer: (setf dtree-class-count-array) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

class-count-array.

Reader: dtree-datamatrix (instance)
Writer: (setf dtree-datamatrix) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

datamatrix.

Reader: dtree-datum-dim (instance)
Writer: (setf dtree-datum-dim) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

datum-dim.

Function: dtree-feature-importance (dtree datamatrix target)
Package

cl-random-forest/src/feature-importance.

Source

file-type.lisp.

Function: dtree-feature-importance-impurity (dtree)
Package

cl-random-forest/src/feature-importance.

Source

file-type.lisp.

Reader: dtree-gain-test (instance)
Writer: (setf dtree-gain-test) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

gain-test.

Reader: dtree-id (instance)
Writer: (setf dtree-id) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

id.

Reader: dtree-max-depth (instance)
Writer: (setf dtree-max-depth) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

max-depth.

Reader: dtree-max-leaf-index (instance)
Writer: (setf dtree-max-leaf-index) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

max-leaf-index.

Reader: dtree-min-region-samples (instance)
Writer: (setf dtree-min-region-samples) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

min-region-samples.

Reader: dtree-n-class (instance)
Writer: (setf dtree-n-class) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

n-class.

Reader: dtree-n-trial (instance)
Writer: (setf dtree-n-trial) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

n-trial.

Function: dtree-oob-sample-indices (dtree)
Package

cl-random-forest/src/feature-importance.

Source

file-type.lisp.

Function: dtree-p (object)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Reader: dtree-remove-sample-indices? (instance)
Writer: (setf dtree-remove-sample-indices?) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

remove-sample-indices?.

Reader: dtree-root (instance)
Writer: (setf dtree-root) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

root.

Reader: dtree-save-parent-node? (instance)
Writer: (setf dtree-save-parent-node?) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

save-parent-node?.

Reader: dtree-target (instance)
Writer: (setf dtree-target) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

target.

Reader: dtree-tmp-arr1 (instance)
Writer: (setf dtree-tmp-arr1) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

tmp-arr1.

Reader: dtree-tmp-arr2 (instance)
Writer: (setf dtree-tmp-arr2) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

tmp-arr2.

Reader: dtree-tmp-index1 (instance)
Writer: (setf dtree-tmp-index1) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

tmp-index1.

Reader: dtree-tmp-index2 (instance)
Writer: (setf dtree-tmp-index2) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

tmp-index2.

Function: find-leaf (node datamatrix datum-index)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: find-leaf-randomized (node datamatrix datum-index randomized-attribute oob-sample-indices)
Package

cl-random-forest/src/feature-importance.

Source

file-type.lisp.

Function: forest-feature-importance-impurity (forest)
Package

cl-random-forest/src/feature-importance.

Source

file-type.lisp.

Function: format-datum (datum stream)
Package

cl-random-forest/src/utils.

Source

file-type.lisp.

Function: leaf? (node)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: make-l2-norm (learner)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: make-l2-norm-binary (learner)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: make-l2-norm-multiclass (learner)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: make-leaf-node-vector (forest)
Package

cl-random-forest/src/reconstruction.

Source

file-type.lisp.

Function: make-node (sample-indices parent-node)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: make-oob-sample-indices (total-size sample-indices)
Package

cl-random-forest/src/feature-importance.

Source

file-type.lisp.

Function: make-partial-arr (arr len)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: make-random-test (node)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: make-refine-vector (forest datamatrix datum-index)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: make-regression-refine-vector (forest datamatrix datum-index)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: make-root-node (dtree &key sample-indices)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: maximize-activation/count (activation-matrix end-of-mini-batch target cycle)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: node-class-distribution (node)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Reader: node-depth (instance)
Writer: (setf node-depth) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

depth.

Reader: node-dtree (instance)
Writer: (setf node-dtree) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

dtree.

Reader: node-information-gain (instance)
Writer: (setf node-information-gain) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

information-gain.

Reader: node-leaf-index (instance)
Writer: (setf node-leaf-index) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

leaf-index.

Reader: node-left-node (instance)
Writer: (setf node-left-node) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

left-node.

Reader: node-n-sample (instance)
Writer: (setf node-n-sample) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

n-sample.

Function: node-p (object)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Reader: node-parent-node (instance)
Writer: (setf node-parent-node) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

parent-node.

Function: node-regression-mean (node)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Reader: node-right-node (instance)
Writer: (setf node-right-node) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

right-node.

Reader: node-sample-indices (instance)
Writer: (setf node-sample-indices) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

sample-indices.

Reader: node-test-attribute (instance)
Writer: (setf node-test-attribute) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

test-attribute.

Reader: node-test-threshold (instance)
Writer: (setf node-test-threshold) (instance)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Target Slot

test-threshold.

Function: normalize-arr! (arr)
Package

cl-random-forest/src/feature-importance.

Source

file-type.lisp.

Function: predict-dtree-randomized (dtree datamatrix datum-index randomized-attribute oob-sample-indices)
Package

cl-random-forest/src/feature-importance.

Source

file-type.lisp.

Function: predict-rtree-randomized (rtree datamatrix datum-index randomized-attribute oob-sample-indices)
Package

cl-random-forest/src/feature-importance.

Source

file-type.lisp.

Function: reconstruction-backward (node input-range-array)
Package

cl-random-forest/src/reconstruction.

Source

file-type.lisp.

Function: region-min/max (sample-indices datamatrix attribute)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: rtree-feature-importance (rtree datamatrix target)
Package

cl-random-forest/src/feature-importance.

Source

file-type.lisp.

Function: rtree? (dtree)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: set-activation-matrix! (activation-matrix refine-learner n-class sv-vec refine-dataset cycle end-of-mini-batch)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: set-best-children! (node)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: set-leaf-index! (dtree)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: set-leaf-index-forest! (forest)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: split-node! (node)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: split-sample-indices (sample-indices true-array false-array attribute threshold datamatrix)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: square (x)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: stop-split? (node)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: test-dtree-oob (dtree datamatrix target &key quiet-p oob-sample-indices)
Package

cl-random-forest/src/feature-importance.

Source

file-type.lisp.

Function: test-dtree-oob-randomized (dtree datamatrix target randomized-attribute &key quiet-p oob-sample-indices)
Package

cl-random-forest/src/feature-importance.

Source

file-type.lisp.

Function: test-refine-learner-binary (refine-learner refine-dataset target &key quiet-p)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: test-refine-learner-multiclass (refine-learner refine-dataset target &key quiet-p mini-batch-size)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: test-rtree-oob (rtree datamatrix target &key quiet-p oob-sample-indices)
Package

cl-random-forest/src/feature-importance.

Source

file-type.lisp.

Function: test-rtree-oob-randomized (rtree datamatrix target randomized-attribute &key quiet-p oob-sample-indices)
Package

cl-random-forest/src/feature-importance.

Source

file-type.lisp.

Function: train-refine-learner-binary (refine-learner refine-dataset target)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: train-refine-learner-multiclass (refine-learner refine-dataset target)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: train-refine-learner-process-inner (refine-learner train-dataset train-target test-dataset test-target &key max-epoch)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Function: traverse (fn node)
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.


5.2.3 Structures

Structure: dtree
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

print-object.

Direct slots
Slot: n-class
Readers

dtree-n-class.

Writers

(setf dtree-n-class).

Slot: class-count-array
Readers

dtree-class-count-array.

Writers

(setf dtree-class-count-array).

Slot: datum-dim
Readers

dtree-datum-dim.

Writers

(setf dtree-datum-dim).

Slot: datamatrix
Readers

dtree-datamatrix.

Writers

(setf dtree-datamatrix).

Slot: target
Readers

dtree-target.

Writers

(setf dtree-target).

Slot: root
Readers

dtree-root.

Writers

(setf dtree-root).

Slot: max-depth
Readers

dtree-max-depth.

Writers

(setf dtree-max-depth).

Slot: min-region-samples
Readers

dtree-min-region-samples.

Writers

(setf dtree-min-region-samples).

Slot: n-trial
Readers

dtree-n-trial.

Writers

(setf dtree-n-trial).

Slot: gain-test
Readers

dtree-gain-test.

Writers

(setf dtree-gain-test).

Slot: remove-sample-indices?
Readers

dtree-remove-sample-indices?.

Writers

(setf dtree-remove-sample-indices?).

Slot: save-parent-node?
Readers

dtree-save-parent-node?.

Writers

(setf dtree-save-parent-node?).

Slot: tmp-arr1
Readers

dtree-tmp-arr1.

Writers

(setf dtree-tmp-arr1).

Slot: tmp-index1
Readers

dtree-tmp-index1.

Writers

(setf dtree-tmp-index1).

Slot: tmp-arr2
Readers

dtree-tmp-arr2.

Writers

(setf dtree-tmp-arr2).

Slot: tmp-index2
Readers

dtree-tmp-index2.

Writers

(setf dtree-tmp-index2).

Slot: best-arr1
Readers

dtree-best-arr1.

Writers

(setf dtree-best-arr1).

Slot: best-index1
Readers

dtree-best-index1.

Writers

(setf dtree-best-index1).

Slot: best-arr2
Readers

dtree-best-arr2.

Writers

(setf dtree-best-arr2).

Slot: best-index2
Readers

dtree-best-index2.

Writers

(setf dtree-best-index2).

Slot: max-leaf-index
Readers

dtree-max-leaf-index.

Writers

(setf dtree-max-leaf-index).

Slot: id
Readers

dtree-id.

Writers

(setf dtree-id).

Structure: forest
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

print-object.

Direct slots
Slot: n-tree
Readers

forest-n-tree.

Writers

(setf forest-n-tree).

Slot: bagging-ratio
Readers

forest-bagging-ratio.

Writers

(setf forest-bagging-ratio).

Slot: datamatrix
Readers

forest-datamatrix.

Writers

(setf forest-datamatrix).

Slot: target
Readers

forest-target.

Writers

(setf forest-target).

Slot: dtree-list
Readers

forest-dtree-list.

Writers

(setf forest-dtree-list).

Slot: n-class
Readers

forest-n-class.

Writers

(setf forest-n-class).

Slot: class-count-array
Readers

forest-class-count-array.

Writers

(setf forest-class-count-array).

Slot: datum-dim
Readers

forest-datum-dim.

Writers

(setf forest-datum-dim).

Slot: max-depth
Readers

forest-max-depth.

Writers

(setf forest-max-depth).

Slot: min-region-samples
Readers

forest-min-region-samples.

Writers

(setf forest-min-region-samples).

Slot: n-trial
Readers

forest-n-trial.

Writers

(setf forest-n-trial).

Slot: gain-test
Readers

forest-gain-test.

Writers

(setf forest-gain-test).

Slot: n-leaf
Readers

forest-n-leaf.

Writers

(setf forest-n-leaf).

Slot: index-offset
Readers

forest-index-offset.

Writers

(setf forest-index-offset).

Structure: node
Package

cl-random-forest/src/random-forest.

Source

file-type.lisp.

Direct superclasses

structure-object.

Direct methods

print-object.

Direct slots
Slot: sample-indices
Readers

node-sample-indices.

Writers

(setf node-sample-indices).

Slot: n-sample
Readers

node-n-sample.

Writers

(setf node-n-sample).

Slot: depth
Readers

node-depth.

Writers

(setf node-depth).

Slot: test-attribute
Readers

node-test-attribute.

Writers

(setf node-test-attribute).

Slot: test-threshold
Readers

node-test-threshold.

Writers

(setf node-test-threshold).

Slot: information-gain
Readers

node-information-gain.

Writers

(setf node-information-gain).

Slot: parent-node
Readers

node-parent-node.

Writers

(setf node-parent-node).

Slot: left-node
Readers

node-left-node.

Writers

(setf node-left-node).

Slot: right-node
Readers

node-right-node.

Writers

(setf node-right-node).

Slot: dtree
Readers

node-dtree.

Writers

(setf node-dtree).

Slot: leaf-index
Readers

node-leaf-index.

Writers

(setf node-leaf-index).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   %   (  
A   B   C   D   E   F   G   L   M   N   P   R   S   T   V   W  
Index Entry  Section

%
%make-dtree: Private ordinary functions
%make-forest: Private ordinary functions
%make-node: Private ordinary functions
%print-dtree: Private ordinary functions
%print-forest: Private ordinary functions
%print-node: Private ordinary functions

(
(setf dtree-best-arr1): Private ordinary functions
(setf dtree-best-arr2): Private ordinary functions
(setf dtree-best-index1): Private ordinary functions
(setf dtree-best-index2): Private ordinary functions
(setf dtree-class-count-array): Private ordinary functions
(setf dtree-datamatrix): Private ordinary functions
(setf dtree-datum-dim): Private ordinary functions
(setf dtree-gain-test): Private ordinary functions
(setf dtree-id): Private ordinary functions
(setf dtree-max-depth): Private ordinary functions
(setf dtree-max-leaf-index): Private ordinary functions
(setf dtree-min-region-samples): Private ordinary functions
(setf dtree-n-class): Private ordinary functions
(setf dtree-n-trial): Private ordinary functions
(setf dtree-remove-sample-indices?): Private ordinary functions
(setf dtree-root): Private ordinary functions
(setf dtree-save-parent-node?): Private ordinary functions
(setf dtree-target): Private ordinary functions
(setf dtree-tmp-arr1): Private ordinary functions
(setf dtree-tmp-arr2): Private ordinary functions
(setf dtree-tmp-index1): Private ordinary functions
(setf dtree-tmp-index2): Private ordinary functions
(setf forest-bagging-ratio): Public ordinary functions
(setf forest-class-count-array): Public ordinary functions
(setf forest-datamatrix): Public ordinary functions
(setf forest-datum-dim): Public ordinary functions
(setf forest-dtree-list): Public ordinary functions
(setf forest-gain-test): Public ordinary functions
(setf forest-index-offset): Public ordinary functions
(setf forest-max-depth): Public ordinary functions
(setf forest-min-region-samples): Public ordinary functions
(setf forest-n-class): Public ordinary functions
(setf forest-n-leaf): Public ordinary functions
(setf forest-n-tree): Public ordinary functions
(setf forest-n-trial): Public ordinary functions
(setf forest-target): Public ordinary functions
(setf node-depth): Private ordinary functions
(setf node-dtree): Private ordinary functions
(setf node-information-gain): Private ordinary functions
(setf node-leaf-index): Private ordinary functions
(setf node-left-node): Private ordinary functions
(setf node-n-sample): Private ordinary functions
(setf node-parent-node): Private ordinary functions
(setf node-right-node): Private ordinary functions
(setf node-sample-indices): Private ordinary functions
(setf node-test-attribute): Private ordinary functions
(setf node-test-threshold): Private ordinary functions

A
argmax: Private ordinary functions

B
balanced-bootstrap-sample-indices: Private ordinary functions
bootstrap-sample-indices: Private ordinary functions

C
calc-accuracy: Private ordinary functions
children-l2-norm: Private ordinary functions
class-distribution: Private ordinary functions
class-distribution-forest: Private ordinary functions
clean-dtree!: Private ordinary functions
clol-dataset->datamatrix/target: Public ordinary functions
clol-dataset->datamatrix/target-regression: Public ordinary functions
collect-leaf-parent: Private ordinary functions
collect-leaf-parent-sorted: Private ordinary functions
copy-dtree: Private ordinary functions
copy-forest: Private ordinary functions
copy-node: Private ordinary functions
copy-tmp->best!: Private ordinary functions
cross-validation-forest-with-refine-learner: Public ordinary functions

D
decode-datum: Public ordinary functions
delete-children!: Private ordinary functions
do-index-value-list: Private macros
do-leaf: Private ordinary functions
dotimes/pdotimes: Public macros
dtree-best-arr1: Private ordinary functions
dtree-best-arr2: Private ordinary functions
dtree-best-index1: Private ordinary functions
dtree-best-index2: Private ordinary functions
dtree-class-count-array: Private ordinary functions
dtree-datamatrix: Private ordinary functions
dtree-datum-dim: Private ordinary functions
dtree-feature-importance: Private ordinary functions
dtree-feature-importance-impurity: Private ordinary functions
dtree-gain-test: Private ordinary functions
dtree-id: Private ordinary functions
dtree-max-depth: Private ordinary functions
dtree-max-leaf-index: Private ordinary functions
dtree-min-region-samples: Private ordinary functions
dtree-n-class: Private ordinary functions
dtree-n-trial: Private ordinary functions
dtree-oob-sample-indices: Private ordinary functions
dtree-p: Private ordinary functions
dtree-remove-sample-indices?: Private ordinary functions
dtree-root: Private ordinary functions
dtree-save-parent-node?: Private ordinary functions
dtree-target: Private ordinary functions
dtree-tmp-arr1: Private ordinary functions
dtree-tmp-arr2: Private ordinary functions
dtree-tmp-index1: Private ordinary functions
dtree-tmp-index2: Private ordinary functions

E
encode-datum: Public ordinary functions
entropy: Public ordinary functions

F
find-leaf: Private ordinary functions
find-leaf-randomized: Private ordinary functions
forest-bagging-ratio: Public ordinary functions
forest-class-count-array: Public ordinary functions
forest-datamatrix: Public ordinary functions
forest-datum-dim: Public ordinary functions
forest-dtree-list: Public ordinary functions
forest-feature-importance: Public ordinary functions
forest-feature-importance-impurity: Private ordinary functions
forest-gain-test: Public ordinary functions
forest-index-offset: Public ordinary functions
forest-max-depth: Public ordinary functions
forest-min-region-samples: Public ordinary functions
forest-n-class: Public ordinary functions
forest-n-leaf: Public ordinary functions
forest-n-tree: Public ordinary functions
forest-n-trial: Public ordinary functions
forest-p: Public ordinary functions
forest-target: Public ordinary functions
format-datum: Private ordinary functions
Function, %make-dtree: Private ordinary functions
Function, %make-forest: Private ordinary functions
Function, %make-node: Private ordinary functions
Function, %print-dtree: Private ordinary functions
Function, %print-forest: Private ordinary functions
Function, %print-node: Private ordinary functions
Function, (setf dtree-best-arr1): Private ordinary functions
Function, (setf dtree-best-arr2): Private ordinary functions
Function, (setf dtree-best-index1): Private ordinary functions
Function, (setf dtree-best-index2): Private ordinary functions
Function, (setf dtree-class-count-array): Private ordinary functions
Function, (setf dtree-datamatrix): Private ordinary functions
Function, (setf dtree-datum-dim): Private ordinary functions
Function, (setf dtree-gain-test): Private ordinary functions
Function, (setf dtree-id): Private ordinary functions
Function, (setf dtree-max-depth): Private ordinary functions
Function, (setf dtree-max-leaf-index): Private ordinary functions
Function, (setf dtree-min-region-samples): Private ordinary functions
Function, (setf dtree-n-class): Private ordinary functions
Function, (setf dtree-n-trial): Private ordinary functions
Function, (setf dtree-remove-sample-indices?): Private ordinary functions
Function, (setf dtree-root): Private ordinary functions
Function, (setf dtree-save-parent-node?): Private ordinary functions
Function, (setf dtree-target): Private ordinary functions
Function, (setf dtree-tmp-arr1): Private ordinary functions
Function, (setf dtree-tmp-arr2): Private ordinary functions
Function, (setf dtree-tmp-index1): Private ordinary functions
Function, (setf dtree-tmp-index2): Private ordinary functions
Function, (setf forest-bagging-ratio): Public ordinary functions
Function, (setf forest-class-count-array): Public ordinary functions
Function, (setf forest-datamatrix): Public ordinary functions
Function, (setf forest-datum-dim): Public ordinary functions
Function, (setf forest-dtree-list): Public ordinary functions
Function, (setf forest-gain-test): Public ordinary functions
Function, (setf forest-index-offset): Public ordinary functions
Function, (setf forest-max-depth): Public ordinary functions
Function, (setf forest-min-region-samples): Public ordinary functions
Function, (setf forest-n-class): Public ordinary functions
Function, (setf forest-n-leaf): Public ordinary functions
Function, (setf forest-n-tree): Public ordinary functions
Function, (setf forest-n-trial): Public ordinary functions
Function, (setf forest-target): Public ordinary functions
Function, (setf node-depth): Private ordinary functions
Function, (setf node-dtree): Private ordinary functions
Function, (setf node-information-gain): Private ordinary functions
Function, (setf node-leaf-index): Private ordinary functions
Function, (setf node-left-node): Private ordinary functions
Function, (setf node-n-sample): Private ordinary functions
Function, (setf node-parent-node): Private ordinary functions
Function, (setf node-right-node): Private ordinary functions
Function, (setf node-sample-indices): Private ordinary functions
Function, (setf node-test-attribute): Private ordinary functions
Function, (setf node-test-threshold): Private ordinary functions
Function, argmax: Private ordinary functions
Function, balanced-bootstrap-sample-indices: Private ordinary functions
Function, bootstrap-sample-indices: Private ordinary functions
Function, calc-accuracy: Private ordinary functions
Function, children-l2-norm: Private ordinary functions
Function, class-distribution: Private ordinary functions
Function, class-distribution-forest: Private ordinary functions
Function, clean-dtree!: Private ordinary functions
Function, clol-dataset->datamatrix/target: Public ordinary functions
Function, clol-dataset->datamatrix/target-regression: Public ordinary functions
Function, collect-leaf-parent: Private ordinary functions
Function, collect-leaf-parent-sorted: Private ordinary functions
Function, copy-dtree: Private ordinary functions
Function, copy-forest: Private ordinary functions
Function, copy-node: Private ordinary functions
Function, copy-tmp->best!: Private ordinary functions
Function, cross-validation-forest-with-refine-learner: Public ordinary functions
Function, decode-datum: Public ordinary functions
Function, delete-children!: Private ordinary functions
Function, do-leaf: Private ordinary functions
Function, dtree-best-arr1: Private ordinary functions
Function, dtree-best-arr2: Private ordinary functions
Function, dtree-best-index1: Private ordinary functions
Function, dtree-best-index2: Private ordinary functions
Function, dtree-class-count-array: Private ordinary functions
Function, dtree-datamatrix: Private ordinary functions
Function, dtree-datum-dim: Private ordinary functions
Function, dtree-feature-importance: Private ordinary functions
Function, dtree-feature-importance-impurity: Private ordinary functions
Function, dtree-gain-test: Private ordinary functions
Function, dtree-id: Private ordinary functions
Function, dtree-max-depth: Private ordinary functions
Function, dtree-max-leaf-index: Private ordinary functions
Function, dtree-min-region-samples: Private ordinary functions
Function, dtree-n-class: Private ordinary functions
Function, dtree-n-trial: Private ordinary functions
Function, dtree-oob-sample-indices: Private ordinary functions
Function, dtree-p: Private ordinary functions
Function, dtree-remove-sample-indices?: Private ordinary functions
Function, dtree-root: Private ordinary functions
Function, dtree-save-parent-node?: Private ordinary functions
Function, dtree-target: Private ordinary functions
Function, dtree-tmp-arr1: Private ordinary functions
Function, dtree-tmp-arr2: Private ordinary functions
Function, dtree-tmp-index1: Private ordinary functions
Function, dtree-tmp-index2: Private ordinary functions
Function, encode-datum: Public ordinary functions
Function, entropy: Public ordinary functions
Function, find-leaf: Private ordinary functions
Function, find-leaf-randomized: Private ordinary functions
Function, forest-bagging-ratio: Public ordinary functions
Function, forest-class-count-array: Public ordinary functions
Function, forest-datamatrix: Public ordinary functions
Function, forest-datum-dim: Public ordinary functions
Function, forest-dtree-list: Public ordinary functions
Function, forest-feature-importance: Public ordinary functions
Function, forest-feature-importance-impurity: Private ordinary functions
Function, forest-gain-test: Public ordinary functions
Function, forest-index-offset: Public ordinary functions
Function, forest-max-depth: Public ordinary functions
Function, forest-min-region-samples: Public ordinary functions
Function, forest-n-class: Public ordinary functions
Function, forest-n-leaf: Public ordinary functions
Function, forest-n-tree: Public ordinary functions
Function, forest-n-trial: Public ordinary functions
Function, forest-p: Public ordinary functions
Function, forest-target: Public ordinary functions
Function, format-datum: Private ordinary functions
Function, gini: Public ordinary functions
Function, leaf?: Private ordinary functions
Function, make-dtree: Public ordinary functions
Function, make-forest: Public ordinary functions
Function, make-l2-norm: Private ordinary functions
Function, make-l2-norm-binary: Private ordinary functions
Function, make-l2-norm-multiclass: Private ordinary functions
Function, make-leaf-node-vector: Private ordinary functions
Function, make-node: Private ordinary functions
Function, make-oob-sample-indices: Private ordinary functions
Function, make-partial-arr: Private ordinary functions
Function, make-random-test: Private ordinary functions
Function, make-refine-dataset: Public ordinary functions
Function, make-refine-learner: Public ordinary functions
Function, make-refine-vector: Private ordinary functions
Function, make-regression-forest: Public ordinary functions
Function, make-regression-refine-dataset: Public ordinary functions
Function, make-regression-refine-learner: Public ordinary functions
Function, make-regression-refine-vector: Private ordinary functions
Function, make-root-node: Private ordinary functions
Function, make-rtree: Public ordinary functions
Function, maximize-activation/count: Private ordinary functions
Function, node-class-distribution: Private ordinary functions
Function, node-depth: Private ordinary functions
Function, node-dtree: Private ordinary functions
Function, node-information-gain: Private ordinary functions
Function, node-leaf-index: Private ordinary functions
Function, node-left-node: Private ordinary functions
Function, node-n-sample: Private ordinary functions
Function, node-p: Private ordinary functions
Function, node-parent-node: Private ordinary functions
Function, node-regression-mean: Private ordinary functions
Function, node-right-node: Private ordinary functions
Function, node-sample-indices: Private ordinary functions
Function, node-test-attribute: Private ordinary functions
Function, node-test-threshold: Private ordinary functions
Function, normalize-arr!: Private ordinary functions
Function, predict-dtree: Public ordinary functions
Function, predict-dtree-randomized: Private ordinary functions
Function, predict-forest: Public ordinary functions
Function, predict-refine-learner: Public ordinary functions
Function, predict-regression-forest: Public ordinary functions
Function, predict-regression-refine-learner: Public ordinary functions
Function, predict-rtree: Public ordinary functions
Function, predict-rtree-randomized: Private ordinary functions
Function, pruning!: Public ordinary functions
Function, random-normal: Public ordinary functions
Function, random-uniform: Public ordinary functions
Function, read-data: Public ordinary functions
Function, read-data-regression: Public ordinary functions
Function, reconstruction-backward: Private ordinary functions
Function, reconstruction-dtree: Public ordinary functions
Function, reconstruction-forest: Public ordinary functions
Function, region-min/max: Private ordinary functions
Function, rtree-feature-importance: Private ordinary functions
Function, rtree?: Private ordinary functions
Function, set-activation-matrix!: Private ordinary functions
Function, set-best-children!: Private ordinary functions
Function, set-leaf-index!: Private ordinary functions
Function, set-leaf-index-forest!: Private ordinary functions
Function, split-node!: Private ordinary functions
Function, split-sample-indices: Private ordinary functions
Function, square: Private ordinary functions
Function, stop-split?: Private ordinary functions
Function, test-dtree: Public ordinary functions
Function, test-dtree-oob: Private ordinary functions
Function, test-dtree-oob-randomized: Private ordinary functions
Function, test-forest: Public ordinary functions
Function, test-refine-learner: Public ordinary functions
Function, test-refine-learner-binary: Private ordinary functions
Function, test-refine-learner-multiclass: Private ordinary functions
Function, test-regression-forest: Public ordinary functions
Function, test-regression-refine-learner: Public ordinary functions
Function, test-rtree: Public ordinary functions
Function, test-rtree-oob: Private ordinary functions
Function, test-rtree-oob-randomized: Private ordinary functions
Function, train-refine-learner: Public ordinary functions
Function, train-refine-learner-binary: Private ordinary functions
Function, train-refine-learner-multiclass: Private ordinary functions
Function, train-refine-learner-process-inner: Private ordinary functions
Function, train-regression-refine-learner: Public ordinary functions
Function, traverse: Private ordinary functions
Function, variance: Public ordinary functions
Function, write-to-r-format-from-clol-dataset: Public ordinary functions

G
gini: Public ordinary functions

L
leaf?: Private ordinary functions

M
Macro, do-index-value-list: Private macros
Macro, dotimes/pdotimes: Public macros
Macro, mapc/pmapc: Public macros
Macro, mapcar/pmapcar: Public macros
Macro, push-ntimes: Public macros
Macro, train-refine-learner-process: Public macros
make-dtree: Public ordinary functions
make-forest: Public ordinary functions
make-l2-norm: Private ordinary functions
make-l2-norm-binary: Private ordinary functions
make-l2-norm-multiclass: Private ordinary functions
make-leaf-node-vector: Private ordinary functions
make-node: Private ordinary functions
make-oob-sample-indices: Private ordinary functions
make-partial-arr: Private ordinary functions
make-random-test: Private ordinary functions
make-refine-dataset: Public ordinary functions
make-refine-learner: Public ordinary functions
make-refine-vector: Private ordinary functions
make-regression-forest: Public ordinary functions
make-regression-refine-dataset: Public ordinary functions
make-regression-refine-learner: Public ordinary functions
make-regression-refine-vector: Private ordinary functions
make-root-node: Private ordinary functions
make-rtree: Public ordinary functions
mapc/pmapc: Public macros
mapcar/pmapcar: Public macros
maximize-activation/count: Private ordinary functions
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods
Method, print-object: Public standalone methods

N
node-class-distribution: Private ordinary functions
node-depth: Private ordinary functions
node-dtree: Private ordinary functions
node-information-gain: Private ordinary functions
node-leaf-index: Private ordinary functions
node-left-node: Private ordinary functions
node-n-sample: Private ordinary functions
node-p: Private ordinary functions
node-parent-node: Private ordinary functions
node-regression-mean: Private ordinary functions
node-right-node: Private ordinary functions
node-sample-indices: Private ordinary functions
node-test-attribute: Private ordinary functions
node-test-threshold: Private ordinary functions
normalize-arr!: Private ordinary functions

P
predict-dtree: Public ordinary functions
predict-dtree-randomized: Private ordinary functions
predict-forest: Public ordinary functions
predict-refine-learner: Public ordinary functions
predict-regression-forest: Public ordinary functions
predict-regression-refine-learner: Public ordinary functions
predict-rtree: Public ordinary functions
predict-rtree-randomized: Private ordinary functions
print-object: Public standalone methods
print-object: Public standalone methods
print-object: Public standalone methods
pruning!: Public ordinary functions
push-ntimes: Public macros

R
random-normal: Public ordinary functions
random-uniform: Public ordinary functions
read-data: Public ordinary functions
read-data-regression: Public ordinary functions
reconstruction-backward: Private ordinary functions
reconstruction-dtree: Public ordinary functions
reconstruction-forest: Public ordinary functions
region-min/max: Private ordinary functions
rtree-feature-importance: Private ordinary functions
rtree?: Private ordinary functions

S
set-activation-matrix!: Private ordinary functions
set-best-children!: Private ordinary functions
set-leaf-index!: Private ordinary functions
set-leaf-index-forest!: Private ordinary functions
split-node!: Private ordinary functions
split-sample-indices: Private ordinary functions
square: Private ordinary functions
stop-split?: Private ordinary functions

T
test-dtree: Public ordinary functions
test-dtree-oob: Private ordinary functions
test-dtree-oob-randomized: Private ordinary functions
test-forest: Public ordinary functions
test-refine-learner: Public ordinary functions
test-refine-learner-binary: Private ordinary functions
test-refine-learner-multiclass: Private ordinary functions
test-regression-forest: Public ordinary functions
test-regression-refine-learner: Public ordinary functions
test-rtree: Public ordinary functions
test-rtree-oob: Private ordinary functions
test-rtree-oob-randomized: Private ordinary functions
train-refine-learner: Public ordinary functions
train-refine-learner-binary: Private ordinary functions
train-refine-learner-multiclass: Private ordinary functions
train-refine-learner-process: Public macros
train-refine-learner-process-inner: Private ordinary functions
train-regression-refine-learner: Public ordinary functions
traverse: Private ordinary functions

V
variance: Public ordinary functions

W
write-to-r-format-from-clol-dataset: Public ordinary functions


A.3 Variables

Jump to:   B   C   D   G   I   L   M   N   P   R   S   T  
Index Entry  Section

B
bagging-ratio: Private structures
best-arr1: Private structures
best-arr2: Private structures
best-index1: Private structures
best-index2: Private structures

C
class-count-array: Private structures
class-count-array: Private structures

D
datamatrix: Private structures
datamatrix: Private structures
datum-dim: Private structures
datum-dim: Private structures
depth: Private structures
dtree: Private structures
dtree-list: Private structures

G
gain-test: Private structures
gain-test: Private structures

I
id: Private structures
index-offset: Private structures
information-gain: Private structures

L
leaf-index: Private structures
left-node: Private structures

M
max-depth: Private structures
max-depth: Private structures
max-leaf-index: Private structures
min-region-samples: Private structures
min-region-samples: Private structures

N
n-class: Private structures
n-class: Private structures
n-leaf: Private structures
n-sample: Private structures
n-tree: Private structures
n-trial: Private structures
n-trial: Private structures

P
parent-node: Private structures

R
remove-sample-indices?: Private structures
right-node: Private structures
root: Private structures

S
sample-indices: Private structures
save-parent-node?: Private structures
Slot, bagging-ratio: Private structures
Slot, best-arr1: Private structures
Slot, best-arr2: Private structures
Slot, best-index1: Private structures
Slot, best-index2: Private structures
Slot, class-count-array: Private structures
Slot, class-count-array: Private structures
Slot, datamatrix: Private structures
Slot, datamatrix: Private structures
Slot, datum-dim: Private structures
Slot, datum-dim: Private structures
Slot, depth: Private structures
Slot, dtree: Private structures
Slot, dtree-list: Private structures
Slot, gain-test: Private structures
Slot, gain-test: Private structures
Slot, id: Private structures
Slot, index-offset: Private structures
Slot, information-gain: Private structures
Slot, leaf-index: Private structures
Slot, left-node: Private structures
Slot, max-depth: Private structures
Slot, max-depth: Private structures
Slot, max-leaf-index: Private structures
Slot, min-region-samples: Private structures
Slot, min-region-samples: Private structures
Slot, n-class: Private structures
Slot, n-class: Private structures
Slot, n-leaf: Private structures
Slot, n-sample: Private structures
Slot, n-tree: Private structures
Slot, n-trial: Private structures
Slot, n-trial: Private structures
Slot, parent-node: Private structures
Slot, remove-sample-indices?: Private structures
Slot, right-node: Private structures
Slot, root: Private structures
Slot, sample-indices: Private structures
Slot, save-parent-node?: Private structures
Slot, target: Private structures
Slot, target: Private structures
Slot, test-attribute: Private structures
Slot, test-threshold: Private structures
Slot, tmp-arr1: Private structures
Slot, tmp-arr2: Private structures
Slot, tmp-index1: Private structures
Slot, tmp-index2: Private structures

T
target: Private structures
target: Private structures
test-attribute: Private structures
test-threshold: Private structures
tmp-arr1: Private structures
tmp-arr2: Private structures
tmp-index1: Private structures
tmp-index2: Private structures


A.4 Data types

Jump to:   C   D   F   N   P   S  
Index Entry  Section

C
cl-random-forest: The cl-random-forest system
cl-random-forest: The cl-random-forest package
cl-random-forest-asd: The cl-random-forest-asd package
cl-random-forest.asd: The cl-random-forest/cl-random-forest․asd file
cl-random-forest/cl-random-forest: The cl-random-forest/cl-random-forest system
cl-random-forest/src/feature-importance: The cl-random-forest/src/feature-importance system
cl-random-forest/src/feature-importance: The cl-random-forest/src/feature-importance package
cl-random-forest/src/random-forest: The cl-random-forest/src/random-forest system
cl-random-forest/src/random-forest: The cl-random-forest/src/random-forest package
cl-random-forest/src/reconstruction: The cl-random-forest/src/reconstruction system
cl-random-forest/src/reconstruction: The cl-random-forest/src/reconstruction package
cl-random-forest/src/utils: The cl-random-forest/src/utils system
cl-random-forest/src/utils: The cl-random-forest/src/utils package

D
dtree: Private structures

F
File, cl-random-forest.asd: The cl-random-forest/cl-random-forest․asd file
File, file-type.lisp: The cl-random-forest/cl-random-forest/file-type․lisp file
File, file-type.lisp: The cl-random-forest/src/random-forest/file-type․lisp file
File, file-type.lisp: The cl-random-forest/src/utils/file-type․lisp file
File, file-type.lisp: The cl-random-forest/src/reconstruction/file-type․lisp file
File, file-type.lisp: The cl-random-forest/src/feature-importance/file-type․lisp file
file-type.lisp: The cl-random-forest/cl-random-forest/file-type․lisp file
file-type.lisp: The cl-random-forest/src/random-forest/file-type․lisp file
file-type.lisp: The cl-random-forest/src/utils/file-type․lisp file
file-type.lisp: The cl-random-forest/src/reconstruction/file-type․lisp file
file-type.lisp: The cl-random-forest/src/feature-importance/file-type․lisp file
forest: Private structures

N
node: Private structures

P
Package, cl-random-forest: The cl-random-forest package
Package, cl-random-forest-asd: The cl-random-forest-asd package
Package, cl-random-forest/src/feature-importance: The cl-random-forest/src/feature-importance package
Package, cl-random-forest/src/random-forest: The cl-random-forest/src/random-forest package
Package, cl-random-forest/src/reconstruction: The cl-random-forest/src/reconstruction package
Package, cl-random-forest/src/utils: The cl-random-forest/src/utils package

S
Structure, dtree: Private structures
Structure, forest: Private structures
Structure, node: Private structures
System, cl-random-forest: The cl-random-forest system
System, cl-random-forest/cl-random-forest: The cl-random-forest/cl-random-forest system
System, cl-random-forest/src/feature-importance: The cl-random-forest/src/feature-importance system
System, cl-random-forest/src/random-forest: The cl-random-forest/src/random-forest system
System, cl-random-forest/src/reconstruction: The cl-random-forest/src/reconstruction system
System, cl-random-forest/src/utils: The cl-random-forest/src/utils system