public class bartMachineTreeNode
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEBUG_NODES
Setting this to true will print out debug information at the node level during Gibbs sampling
|
int |
depth
the generation of this node from the top node (root note has generation = 0 by definition)
|
boolean |
isLeaf
is this node a terminal node?
|
bartMachineTreeNode |
left
the left daughter node
|
int |
n_eta
the number of data points in this node
|
bartMachineTreeNode |
parent
the parent node of this node
|
bartMachineTreeNode |
right
the right daughter node
|
boolean |
sendMissingDataRight
send missing data to the right?
|
int |
splitAttributeM
the attribute this node makes a decision on
|
double |
splitValue
the value this node makes a decision on
|
double |
y_pred
if this is a leaf node, then the result of the prediction for regression, otherwise null
|
double[] |
yhats
these are the yhats in the correct order
|
| Constructor and Description |
|---|
bartMachineTreeNode() |
bartMachineTreeNode(bartMachine_b_hyperparams bart)
Creates a new node
|
bartMachineTreeNode(bartMachineTreeNode parent)
Creates a new node
|
bartMachineTreeNode(bartMachineTreeNode parent,
bartMachine_b_hyperparams bart)
Creates a new node
|
| Modifier and Type | Method and Description |
|---|---|
double |
avg_response_untransformed()
Find the average repsonse in this node and then transform it back to the original response scale
|
double |
avgResponse()
The sample average response value at this node
|
void |
clearRulesAndSplitCache()
When
mem_cache_for_speed is set in the BART model, running this function will reset the caches for this node's valid predictors and valid split values |
bartMachineTreeNode |
clone()
Creates a cloned copy of the tree beginning at this node by recursing cloning its children.
|
void |
decrement_variable_count(int j)
When counting the attributes used in this tree's split rules, decrement the following attribute
|
int |
deepestNode()
Find the terminal node at the largest depth from this point in the tree and down
|
double |
Evaluate(double[] record)
Evaluate a record recursively accounting for split rules and the presence of missing data
|
void |
findInteractions(java.util.HashSet<UnorderedPair<java.lang.Integer>> set_of_interaction_pairs)
A wrapper to find all interactions recursively by checking all splits underneath this node
|
void |
flushNodeData()
Remove all the data in this node and its children recursively to save memory
|
int |
getGeneration() |
bartMachineTreeNode |
getLeft() |
java.util.ArrayList<bartMachineTreeNode> |
getPrunableAndChangeableNodes()
Find a list of prunable and changeable nodes (ie singly internal nodes)
from this point in the tree and below
|
bartMachineTreeNode |
getRight() |
int |
getSplitAttributeM() |
double |
getSplitValue() |
java.util.ArrayList<bartMachineTreeNode> |
getTerminalNodes()
Return all terminal nodes under this node
|
java.util.ArrayList<bartMachineTreeNode> |
getTerminalNodesWithDataAboveOrEqualToN(int n_rule)
Search the tree below this current node for terminal nodes that have more than
n_rule
data records |
void |
increment_variable_count(int j)
When counting the attributes used in this tree's split rules, increment the following attribute
|
boolean |
isLeaf() |
boolean |
isStump()
Is this node a stump? That is, does it have no parents and no children?
|
int |
nAdj()
Gets the total number of valid split points that can be used for rules at this juncture
for the selected split rule predictor (it will be different for each predictor)
|
int |
numLeaves()
How many terminal nodes are below this node?
|
int |
numNodesAndLeaves()
Find the total number of nodes (internal and terminal) recursively below this node
|
int |
numPruneNodesAvailable()
Find the number of singly internal nodes (available for pruning) recursively
from this point in the tree down
|
static boolean |
pickRandomDirectionForMissingData()
Picks a random direction for missing data to flow down the tree from this node.
|
double |
pickRandomSplitValue()
Of the valid split values to split at for this split rule at this node, pick one at random
|
double |
prediction_untransformed()
Get the prediction for this node transformed back to the original response scale
|
void |
printNodeDebugInfo(java.lang.String title)
Prints debug information about this node, its parent and its immediate children
|
void |
propagateDataByChangedRule()
Propagates the records to the appropriate daughter nodes recursively after a change in split rule.
|
static void |
pruneTreeAt(bartMachineTreeNode node)
We prune the tree at this node.
|
void |
setGeneration(int generation) |
void |
setLeaf(boolean isLeaf) |
void |
setLeft(bartMachineTreeNode left) |
void |
setRight(bartMachineTreeNode right) |
void |
setSplitAttributeM(int splitAttributeM) |
void |
setSplitValue(double splitValue) |
void |
setStumpData(java.util.ArrayList<double[]> X_y,
double[] y_trans,
int p)
When a new stump gets created, this function sets its data.
|
java.lang.String |
stringID()
Find the string ID of this node
|
java.lang.String |
stringLocation(boolean show_parent)
In debugging, print a string that codes this node's location in the entire tree
|
double |
sumResponses()
Simply the sum of the repsonses in this node
|
double |
sumResponsesQuantitySqd()
Find the square of the sum of responses and cache it
|
void |
updateWithNewResponsesRecursively(double[] new_responses)
Update this node and its children with a set of new responses recursively
|
void |
updateYHatsWithPrediction()
Given new yhat predictions, update them for this node
|
public static final boolean DEBUG_NODES
public bartMachineTreeNode parent
public bartMachineTreeNode left
public bartMachineTreeNode right
public int depth
public boolean isLeaf
public int splitAttributeM
public double splitValue
public boolean sendMissingDataRight
public double y_pred
public transient int n_eta
public transient double[] yhats
public bartMachineTreeNode()
public bartMachineTreeNode(bartMachineTreeNode parent, bartMachine_b_hyperparams bart)
parent
- The parent of this nodebart
- The BART model this node belongs topublic bartMachineTreeNode(bartMachineTreeNode parent)
parent
- The parent of this nodepublic bartMachineTreeNode(bartMachine_b_hyperparams bart)
bart
- The BART model this node belongs topublic bartMachineTreeNode clone()
clone
in class java.lang.Object
public double avgResponse()
public java.util.ArrayList<bartMachineTreeNode> getTerminalNodesWithDataAboveOrEqualToN(int n_rule)
n_rule
data recordsn_rule
- The number of data records in in terminal nodes of interest we wish to selectpublic java.util.ArrayList<bartMachineTreeNode> getTerminalNodes()
public java.util.ArrayList<bartMachineTreeNode> getPrunableAndChangeableNodes()
public static void pruneTreeAt(bartMachineTreeNode node)
node
- The node at which to trim the tree atpublic int deepestNode()
public double Evaluate(double[] record)
record
- The record which to evaluate in this treepublic void flushNodeData()
public void propagateDataByChangedRule()
public void updateWithNewResponsesRecursively(double[] new_responses)
new_responses
- The new responsespublic int numLeaves()
public int numNodesAndLeaves()
public int numPruneNodesAvailable()
public double prediction_untransformed()
public double avg_response_untransformed()
public double sumResponsesQuantitySqd()
public double sumResponses()
public int nAdj()
public double pickRandomSplitValue()
public boolean isStump()
public java.lang.String stringID()
public void setStumpData(java.util.ArrayList<double[]> X_y, double[] y_trans, int p)
X_y
- the training data that will be filtered down the tree structurey_trans
- the transformed responses that correspond to the X_y
data recordsp
- the number of attributes in the training datapublic void updateYHatsWithPrediction()
public void findInteractions(java.util.HashSet<UnorderedPair<java.lang.Integer>> set_of_interaction_pairs)
set_of_interaction_pairs
- A running list of interaction pairspublic void clearRulesAndSplitCache()
mem_cache_for_speed
is set in the BART model, running this function will reset the caches for this node's valid predictors and valid split valuespublic static boolean pickRandomDirectionForMissingData()
public java.lang.String stringLocation(boolean show_parent)
show_parent
- Show a character if this node is a stumppublic void printNodeDebugInfo(java.lang.String title)
title
- A string to print within this messagepublic void decrement_variable_count(int j)
j
- The attribute number (in the original traning data design matrix) to decrement in countpublic void increment_variable_count(int j)
j
- The attribute number (in the original traning data design matrix) to increment in countpublic bartMachineTreeNode getLeft()
public bartMachineTreeNode getRight()
public int getGeneration()
public void setGeneration(int generation)
public boolean isLeaf()
public void setLeaf(boolean isLeaf)
public void setLeft(bartMachineTreeNode left)
public void setRight(bartMachineTreeNode right)
public int getSplitAttributeM()
public void setSplitAttributeM(int splitAttributeM)
public double getSplitValue()
public void setSplitValue(double splitValue)


Banh Mi Bistro
Home
Menu
Contact Us
Email:
Phone:
Reason for Inquiry:
Catering
Private Party
Feedback
Other
Additional Information:
Have you visited our restuarant?
Yes
No
Best day to contact you:
M
Tu
W
Th
F


About FIAR
- FIAR or Four In A Row was created by Dr. Bread.
The creation took place in a local mexican restaruant using sugar packets.
Dr. Bread did not playtest FIAR very much and doesn't know if the game if solvable or not.
FIAR pronunciation
- Gnouw dis ees pawd wrasing
Disclaimer
- If you make your own game based off of FIAR, at least let me know about it and maybe give me like 2 dollars.