Sometimes you need to keep track of which attributes you have already considered, and which are still available for consideration. The attribute tracker interface helps you efficiently acomplish this task; you can think of it as a wrapper around a bit field.
For example, when learning a decision tree, each split on a discrete attribute deactivates an attribute from further consideration. In this situation you would deactivate the attribute, and then make one clone for each child.
Go to the source code of this file.
Functions | |
AttributeTrackerPtr | AttributeTrackerNew (int numAttributes) |
Allocates memory for a new AttributeTracker structure. | |
void | AttributeTrackerFree (AttributeTrackerPtr at) |
Frees the memory associated with the attribute tracker. | |
AttributeTrackerPtr | AttributeTrackerInitial (ExampleSpecPtr es) |
Respects 'ignore's in the ExampleSpec. | |
AttributeTrackerPtr | AttributeTrackerClone (AttributeTrackerPtr at) |
Creates a copy of the passed AttributeTracker and returns the copy. | |
void | AttributeTrackerMarkActive (AttributeTrackerPtr at, int attNum) |
Marks the specified attribute as active. | |
void | AttributeTrackerMarkInactive (AttributeTrackerPtr at, int attNum) |
Marks the specified attribute as inactive. | |
int | AttributeTrackerIsActive (AttributeTrackerPtr at, int attNum) |
Returns 1 if the specified attribute is active. | |
int | AttributeTrackerAreAllInactive (AttributeTrackerPtr at) |
Returns 1 if none of the attributes are active. | |
int | AttributeTrackerNumActive (AttributeTrackerPtr at) |
Returns a count of at's active attributes. |
|
Returns 1 if none of the attributes are active. This is a constant time operation (it does not depend on the number of attributes). |
|
Creates a copy of the passed AttributeTracker and returns the copy.
|
|
Frees the memory associated with the attribute tracker.
|
|
Respects 'ignore's in the ExampleSpec. Creates an attribute tracker to track the attributes in the passed ExampleSpec. Any of es's attributes marked as ignore will be initially set to inactive. |
|
Returns 1 if the specified attribute is active.
|
|
Marks the specified attribute as active.
|
|
Marks the specified attribute as inactive.
|
|
Allocates memory for a new AttributeTracker structure. Creates a new attribute tracker with one bit for each of numAttributes. All the attributes are initially marked as active. |
|
Returns a count of at's active attributes. This is a constant time operation (it does not depend on the number of attributes). |