public class AprioriTFPclass extends PartialSupportTree
PartialSupportTree.PtreeRecord
javax.swing.JFrame.AccessibleJFrame
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
Modifier and Type | Field and Description |
---|---|
protected double |
accuracy
Percentage describing classification accuarcy.
|
protected double |
averageAccuracy
Average accuracy as the result of TCV.
|
protected double |
averageNumCRs
Average accuracy number of callsification rules as the result of TCV.
|
protected double |
averageNumFreqSets
Average number of frequent sets as the result of TCV.
|
protected double |
averageNumUpdates
Average number of updates as the result of TCV.
|
protected int |
numRowsInInputSet
Number of rows in input data set, not the same as the number of rows
in the classification training set.
|
protected int |
numRowsInTestSet
Number of rows in test set, again not the same as the number of rows
in the classification training set.
|
protected int |
numRowsInTrainingSet
Number of rows in training set, also not the same as the number of rows
in the classification training set.
|
protected short[][][] |
tenthDataSets
3-data array to hold 10th sets of input data.
|
protected short[][] |
testDataArray
2-D array to hold the test data Note that classifiaction
involves producing a set of Classification Rules (CRs) from a training
set and then testing the effectiveness of the CRs on a test set.
|
startPtreeTable
currentRlist, duration, MAX_NUM_FREQUENT_SETS, nextLevelExists, numFrequentsets, numUpdates, startTtreeRef
confidence, conversionArray, dataArray, errorFlag, fileInput, fileName, filePath, inputFormatOkFlag, minSupport, numClasses, numCols, numOneItemSets, numRows, reconversionArray, support
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Constructor and Description |
---|
AprioriTFPclass(double minConf,
double minSup,
int delta)
Processes command line arguments.
|
Modifier and Type | Method and Description |
---|---|
void |
createTenthsDataSets()
Populates ten tenths data sets for use when doing Ten Cross Validation
(TCV) --- test and training datasets.
|
void |
createTrainingAndTestDataSets()
Populates test and training datasets.
|
void |
createTrainingAndTestDataSets(int testSetIndex)
Populates test and training datasets.
|
double |
getAccuracy()
Gets the value of the accuracyt field.
|
double |
getAverageAccuracy()
Gets value for average accuracy field.
|
double |
getAverageNumCRs()
Gets value for average number of generated classification rules field.
|
double |
getAverageNumFreqSets()
Gets value for average umber of frequent sets field.
|
double |
getAvergaeNumUpdates()
Gets value for average number of updates field.
|
protected int |
getNumSupOneItemSets()
Gets number of supported attributess (note this is not necessarily
the same as the number of columns/attributes in the input set) plus the
number of classifiers.
|
void |
idInputDataOrdering(DataBase dataBase)
Reorders input data according to frequency of single attributes but
excluding classifiers which are left unordered at the end of the attribute
list.
|
void |
outputAccuracy()
Outputs classification accuracy.
|
protected void |
outputMenu()
Outputs menu for command line arguments.
|
void |
outputNumClasses()
Outputs number of classes.
|
protected void |
outputSettings()
Outputs command line values provided by user.
|
void |
outputTestDataArray()
Outputs stored input data set read from input data file.
|
void |
pruneUnsupportedAtts()
Removes single attributes (not classifiers) from input data set which
do not meet the minimum support requirement.
|
void |
reconstructInputData()
Reconstructs the input data set by appending the test set to the
training sets.
|
void |
setNumRowsInInputSet()
Assigns value to the numRowsInInputSet field.
|
void |
setNumRowsInTrainingSet()
Assigns a value equavalent to the number of rows to the number of
rows in training set field.
|
void |
setSupportAndConfidence(double newSupport,
double newConfidence)
Sets new values for the support and confidence fields.
|
void |
testDataSet(myDataset test,
DataBase dataBase)
Populates test and training datasets.
|
addSupportToTtreeLevelN, addToPtree, createPtree, createPtreeTable, createTotalSupportTree, createTtreeLevelN, createTtreeTopLevel2, createTtreeTopLevel3, getNumPtreeNodes, getStartOfPtree, outputNumNodes, outputPtree, outputPtree1, outputPtreeStats, outputPtreeStorage, outputPtreeTable, outputPtreeTableStats
calculateStorage, countNumFreqSets, countNumFreqSets, createTtreeTopLevel, findItemSetInTtree, generateLevel2, generateLevelN, generateNextLevel, getConfidence, getConfidence, getCurrentRuleListObject, getMinSupport, getNumFreqSets, getSupportForItemSetInTtree, outputFrequentSets, outputFrequentSets, outputNumFreqSets, outputNumFreqSetsPerBranch, outputNumUpdates, outputStorage, outputTtree, outputTtreeBranch, outputTtreeStats, outputTtreeStats, pruneLevelN, setNumOneItemSets, testCombinations
append, binConversion, checkForLeadingSubString, checkItemSets, combinations, complement, copyItemSet, copyItemSet, countSingles, defConvertArrays, getConfidence, getDuration, getLastElement, inputDataSet, isBefore, isEqual, isSubset, notMemberOf, orderFirstNofCountArray, outputConversionArrays, outputDataArray, outputDataArray, outputDataArraySize, outputDuration, outputItemSet, outputItemSetWithReconversion, outputSettings2, outputSuppAndConf, readFile, realloc1, realloc2, realloc3, realloc4, reallocInsert, recastInputData, recastInputDataAndPruneUnsupportedAtts, removeFirstNelements, resizeInputData, similar2dec, sortItemSet, threeDecPlaces, twoDecPlaces
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
protected short[][] testDataArray
Note that classifiaction involves producing a set of Classification Rules (CRs) from a training set and then testing the effectiveness of the CRs on a test set.
protected short[][][] tenthDataSets
Used in conjunction with "10 Cross Validation" where the input data is divided into 10 sunsets and CRs are produced using each subset in turn and validated against the remaininmg 9 sets. The oveerall average accuracy is then the total accuracy divided by 10.
protected int numRowsInInputSet
Used for temporery storage of total number of rows when using Ten Cross Validation (TCV) approach only.
The numRows field inherited from the super class records is used throughout the CR generation process. Set to number of rows using setNumRowsInInputSet method called by application class.
protected int numRowsInTestSet
protected int numRowsInTrainingSet
protected double accuracy
protected double averageAccuracy
protected double averageNumFreqSets
protected double averageNumUpdates
protected double averageNumCRs
public AprioriTFPclass(double minConf, double minSup, int delta)
minConf
- double Minimum confidence thresholdminSup
- double Minimum support thresholddelta
- int Minimum coverage thresholdpublic void setSupportAndConfidence(double newSupport, double newConfidence)
newSupport
- the new support value.newConfidence
- the new confidence value.public void idInputDataOrdering(DataBase dataBase)
Overides method in AssocRuleMining class. Note reordering makes for more efficient executuion of the T-tree (and P-tree) algorithms.
idInputDataOrdering
in class AssocRuleMining
dataBase
- DataBase Class to store the examples to work with the algorithm and some other useful informationpublic void pruneUnsupportedAtts()
protected int getNumSupOneItemSets()
Overides parent method which returns the number of support 1 itemsets. This would exclude any classifiers whose support value was below the minimum support threshold.
getNumSupOneItemSets
in class AssocRuleMining
public void testDataSet(myDataset test, DataBase dataBase)
Note: (1) assumes a 50:50 split, (2) training data set is stored in the dataArray structure in which the input data is stored, (3) method called from application class as same training and test sets may be required if using (say) "hill climbing" approach to maximise accuracy, (4) method is not called from constructor partly for same reason as 3 but also because the input data set may (given a particular application) first require ordering and possibly also pruning and recasting (see recastClassifiers method).
test
- myDataset Class where examples are stored to build the classifierdataBase
- DataBase Class to store the examples to work with the algorithm and some other useful informationpublic void createTrainingAndTestDataSets()
Note: (1) assumes a 50:50 split, (2) training data set is stored in the dataArray structure in which the input data is stored, (3) method called from application class as same training and test sets may be required if using (say) "hill climbing" approach to maximise accuracy, (4) method is not called from constructor partly for same reason as 3 but also because the input data set may (given a particular application) first require ordering and possibly also pruning and recasting (see recastClassifiers method).
public void createTrainingAndTestDataSets(int testSetIndex)
Note: (1) works on a 9:1 split with nine of the tenths data sets forming the training set and the remaining one tenth the test set, (2) training data set is stored in the same dataArray structure in which the initial input data is stored, (3) this method is not called from the constructor as the input data set may (given a particular application) first require ordering and possibly also pruning.
testSetIndex
- the index of the tenths data sets to be used as the
test set.public void createTenthsDataSets()
Note: this method is not called from the constructor as the input data set may (given a particular application) first require ordering (and possibly also pruning!).
public void reconstructInputData()
Note that the training set is stored in the dataArray 2-D short array.
public void setNumRowsInInputSet()
used in conjunction with TCV to "remember" the overall number of rows in the input data set.
Usually called from application classes.
public void setNumRowsInTrainingSet()
used when the entire data set is considered as the training set.
public double getAverageAccuracy()
public double getAccuracy()
public double getAverageNumFreqSets()
public double getAvergaeNumUpdates()
public double getAverageNumCRs()
protected void outputMenu()
outputMenu
in class AssocRuleMining
protected void outputSettings()
outputSettings
in class AssocRuleMining
public void outputNumClasses()
public void outputAccuracy()
public void outputTestDataArray()