Padaco
1.6
Toolbox for interpreting Actigraph accelerometer data collected from children in order to better understand their physical activity and sleep patterns with the intent of reducing obesity and improving their overall health.
|
Public Member Functions | |
function | PACentroid (in loadShapes, in settings, in axesOrLineH, in textHandle, in loadShapeIDs, in loadShapeDayOfWeek, in delayedStart) |
function | removeHandleReferences (in this) |
Removes any graphic handle to references. This is a helpful precursor to calling 'save' on the object, as it avoids the issue of recreating the figure handles when the object is later loaded with a 'load' call. More... | |
function | cancelCalculations (in this, in varargin) |
Sets the calculationState property to the cancel state value (-2). More... | |
function | getUserCancelled (in this) |
Checks if we have a user cancel state. More... | |
function | failedToConverge (in this) |
Determines if clustering failed or succeeded (i.e. do centroidShapes exist) More... | |
function | getHistogram (in this) |
function | numCentroids (in this) |
Returns the number of centroids/clusters obtained. More... | |
function | getNumCentroids (in this) |
Alias for numCentroids. More... | |
function | numLoadShapes (in this) |
Returns the number of load shapes clustered. More... | |
function | getNumLoadShapes (in this) |
Alias for numLoadShapes. More... | |
function | init (in this) |
Initializes (sets to empty) member variables. More... | |
function | toggleOnNextCOI (in this) |
function | toggleOnPreviousCOI (in this) |
function | toggleOnCOISortOrder (in this, in sortOrder) |
This sets the given index into coiToggleOrder to true and also sets the coiSortOrder value to the given index. This performs similarly to setCOISortOrder, but here the coiToggleOrder is not reset (i.e. all toggles turned off). More... | |
function | increaseCOISortOrder (in this) |
function | decreaseCOISortOrder (in this) |
function | setCOISortOrder (in this, in sortOrder) |
function | toggleCOISortOrder (in this, in toggleSortIndex) |
function | getDaysOfInterest (in this) |
function | toggleDayOfInterestOrder (in this, in dayOfInterest) |
function | getClusteringPerformance (in this) |
function | getCOIIndex (in this, in sortOrder) |
Returns the index of centroid matching the current sort order value (i.e. of member variable coiSortOrder ) or of the input sortOrder provided. More... | |
function | getCOISortOrder (in this, in coiIndex) |
function | getCOIToggleOrder (in this) |
function | getCentroidOfInterest (in this, in sortOrder) |
Returns a descriptive struct for the centroid of interest (coi) which is determined by the member variable coiSortOrder. More... | |
function | getLoadShapeIDs (in this) |
Returns the loadshape IDs. These are the identifiers number of centroids that are currently of interest, based on the number of positive indices flagged in coiToggleOrder. More... | |
function | getUniqueLoadShapeIDs (in this) |
function | getUniqueLoadShapeIDsCount (in this) |
function | getCentroidsOfInterestCount (in this) |
Returns the number of centroids that are currently of interest, based on the number of positive indices flagged in coiToggleOrder. More... | |
function | getCentroidsOfInterest (in this) |
Returns the number of centroids that are currently of interest, based on the number of positive indices flagged in coiToggleOrder. More... | |
function | calculateCentroids (in this, in inputLoadShapes, in inputSettings) |
Clusters input load shapes by centroid using adaptive k-means, determines the distribution of centroids by load shape frequency, and stores the sorted centroids, load shapes, and distribution, and sorted indices vector as member variables. See reset() method for a list of instance variables set (or reset on failure) from this method. More... | |
function | plotPerformance (in this, in axesH) |
function | getWCSS (in varargin) |
Calculates within-cluster sum of squares (WCSS); a metric of cluster tightness. More... | |
function | getCovariateStruct (in this) |
Returns struct useful for logisitic or linear regression modelling. More... | |
Static Public Member Functions | |
static function | getCalinskiHarabaszIndex (in loadShapeMap, in centroids, in sumD) |
Validation metric for cluster separation. Useful in determining if clusters are well separated. If clusters are not well separated, then the Adaptive K-means threshold should be adjusted according to the segmentation resolution desired. More... | |
static function | plot (in performanceAxesH, in X, in Y) |
static function | getPlotOptions () |
Public Attributes | |
Constant Property | WEEKDAY_ORDER = 0 |
Protected Member Functions | |
function | adaptiveKmedoids (in this, in loadShapes, in settings, in defaultRandomizer, in performanceAxesH, in textStatusH) |
Performs adaptive k-medoids clustering of input data. More... | |
function | adaptiveKmeans (in this, in loadShapes, in settings, in defaultRandomizer, in performanceAxesH, in textStatusH) |
Performs adaptive k-means clustering of input data. More... | |
Protected Attributes | |
Property | calculationState |
Numeric value indicating current state: values include. More... | |
function PACentroid::PACentroid | ( | in | loadShapes, |
in | settings, | ||
in | axesOrLineH, | ||
in | textHandle, | ||
in | loadShapeIDs, | ||
in | loadShapeDayOfWeek, | ||
in | delayedStart | ||
) |
loadShapes | NxM matrix to be clustered (Each row represents an M dimensional value). |
settings | Optional struct with following fields [and default values]
|
Optional | axes or line handle for displaying clustering progress.
|
Optional | text handle to send status updates to via set(textHandle,'string',statusString) type calls. Status updates are sent to the command window by default. |
Optional | Nx1 cell string with load shape source identifiers (e.g. which participant they came from). |
Optional | Nx1 vector with entries defining day of week corresponding to the load shape entry found at the same row index in the loadShapes matrix. |
delayedStart | Boolean. If true, the centroids are not automatically calculated, instead 'calculateCentroids()' needs to be called directly from the instantiated class. The default is 'false': centroids are calculated in the constructor. |
Instance | of PACentroid on success. Empty matrix on failure. |
|
protected |
Performs adaptive k-means clustering of input data.
loadShapes | NxM matrix to be clustered (Each row represents an M dimensional value). |
settings | Optional struct with following fields [and default values]
|
Boolean | |
Boolean | Set randomizer seed to default
|
idx | = Rx1 vector of cluster indices that the matching (i.e. same) row of the loadShapes is assigned to. |
centroids | - KxC matrix of cluster centroids. |
The | Calinski index for the returned idx and centroids Struct of X and Y fields containing the progression of cluster sizes and corresponding Calinksi indices obtained for each iteration of k means. |
|
protected |
Performs adaptive k-medoids clustering of input data.
loadShapes | NxM matrix to be clustered (Each row represents an M dimensional value). |
settings | Optional struct with following fields [and default values]
|
Boolean | |
Boolean | Set randomizer seed to default
|
idx | = Rx1 vector of cluster indices that the matching (i.e. same) row of the loadShapes is assigned to. |
centroids | - KxC matrix of cluster centroids. |
The | Calinski index for the returned idx and centroids Struct of X and Y fields containing the progression of cluster sizes and corresponding Calinksi indices obtained for each iteration of k means. |
function PACentroid::calculateCentroids | ( | in | this, |
in | inputLoadShapes, | ||
in | inputSettings | ||
) |
Clusters input load shapes by centroid using adaptive k-means, determines the distribution of centroids by load shape frequency, and stores the sorted centroids, load shapes, and distribution, and sorted indices vector as member variables. See reset() method for a list of instance variables set (or reset on failure) from this method.
Instance | of PACentroid |
inputLoadShapes | |
Structure | of centroid configuration parameters. These are passed to adaptiveKmeans method. |
function PACentroid::cancelCalculations | ( | in | this, |
in | varargin | ||
) |
Sets the calculationState property to the cancel state value (-2).
this | Instance of PACentroid. |
function PACentroid::decreaseCOISortOrder | ( | in | this | ) |
function PACentroid::failedToConverge | ( | in | this | ) |
Determines if clustering failed or succeeded (i.e. do centroidShapes exist)
Instance | of PACentroid |
failedState | - boolean
|
|
static |
Validation metric for cluster separation. Useful in determining if clusters are well separated. If clusters are not well separated, then the Adaptive K-means threshold should be adjusted according to the segmentation resolution desired.
Vector | of output from mapping loadShapes to parent centroids. |
Centroids | calculated via kmeans |
sum | of euclidean distances |
The | Calinzki-Harabasz index |
function PACentroid::getCentroidOfInterest | ( | in | this, |
in | sortOrder | ||
) |
Returns a descriptive struct for the centroid of interest (coi) which is determined by the member variable coiSortOrder.
Instance | of PACentroid |
sortOrder | Optional index to use to obtain a centroid of interest according to the given sort order ; default is to use the value of this.coiSortOrder. |
Structure | for centroid of interest. Fields include
|
memberShapes
- NxM array of load shapes clustered to the coi.numMembers
- N, the number of load shapes clustered to the coi. function PACentroid::getCentroidsOfInterest | ( | in | this | ) |
Returns the number of centroids that are currently of interest, based on the number of positive indices flagged in coiToggleOrder.
this | Instance of PACentroid. |
cois | Cell of centroid of interest structs. See getCentroidOfInterest for description of centroid of interest struct. |
function PACentroid::getCentroidsOfInterestCount | ( | in | this | ) |
Returns the number of centroids that are currently of interest, based on the number of positive indices flagged in coiToggleOrder.
this | Instance of PACentroid. |
numCOIs | Number of centroids currently of interest: value is in the range [1, this.numCentroids]. |
function PACentroid::getClusteringPerformance | ( | in | this | ) |
function PACentroid::getCOIIndex | ( | in | this, |
in | sortOrder | ||
) |
Returns the index of centroid matching the current sort order value (i.e. of member variable coiSortOrder
) or of the input sortOrder provided.
this | Instance of PACentroid. |
sortOrder | (Optional) sort order for the centroid of interest to retrive the index of. If not provided, the value of member variable coiSortOrder is used. |
coiIndex | The centroid index or tag. |
function PACentroid::getCOISortOrder | ( | in | this, |
in | coiIndex | ||
) |
function PACentroid::getCOIToggleOrder | ( | in | this | ) |
function PACentroid::getCovariateStruct | ( | in | this | ) |
Returns struct useful for logisitic or linear regression modelling.
Instance | of PACentroid. |
Struct | with fields defining dependent variables to use in the model. Fields include:
|
function PACentroid::getDaysOfInterest | ( | in | this | ) |
function PACentroid::getHistogram | ( | in | this | ) |
function PACentroid::getLoadShapeIDs | ( | in | this | ) |
Returns the loadshape IDs. These are the identifiers number of centroids that are currently of interest, based on the number of positive indices flagged in coiToggleOrder.
this | Instance of PACentroid. |
loadShapeIDs | Parent identifier for each load shape. Duplicate values in loadShapeIDs represent the same source (e.g. a specific person). |
function PACentroid::getNumCentroids | ( | in | this | ) |
Alias for numCentroids.
Instance | of PACentroid |
Number | of centroids/clusters found. |
function PACentroid::getNumLoadShapes | ( | in | this | ) |
Alias for numLoadShapes.
Instance | of PACentroid |
Number | of load shapes clustered. |
|
static |
function PACentroid::getUniqueLoadShapeIDs | ( | in | this | ) |
function PACentroid::getUniqueLoadShapeIDsCount | ( | in | this | ) |
function PACentroid::getUserCancelled | ( | in | this | ) |
Checks if we have a user cancel state.
this | Instance of PACentroid. |
userCancel | Boolean: true if calculationState is equal to user cancel value (-2) |
function PACentroid::getWCSS | ( | in | varargin | ) |
Calculates within-cluster sum of squares (WCSS); a metric of cluster tightness.
getCalinskiHarabaszIndex
). Instance | PACentroid |
The | within-cluster sum of squares (WCSS); a metric of cluster tightness |
function PACentroid::increaseCOISortOrder | ( | in | this | ) |
function PACentroid::init | ( | in | this | ) |
Initializes (sets to empty) member variables.
Instance | of PACentroid |
function PACentroid::numCentroids | ( | in | this | ) |
Returns the number of centroids/clusters obtained.
Instance | of PACentroid |
Number | of centroids/clusters found. |
function PACentroid::numLoadShapes | ( | in | this | ) |
Returns the number of load shapes clustered.
Instance | of PACentroid |
Number | of load shapes clustered. |
|
static |
function PACentroid::plotPerformance | ( | in | this, |
in | axesH | ||
) |
function PACentroid::removeHandleReferences | ( | in | this | ) |
Removes any graphic handle to references. This is a helpful precursor to calling 'save' on the object, as it avoids the issue of recreating the figure handles when the object is later loaded with a 'load' call.
function PACentroid::setCOISortOrder | ( | in | this, |
in | sortOrder | ||
) |
function PACentroid::toggleCOISortOrder | ( | in | this, |
in | toggleSortIndex | ||
) |
function PACentroid::toggleDayOfInterestOrder | ( | in | this, |
in | dayOfInterest | ||
) |
function PACentroid::toggleOnCOISortOrder | ( | in | this, |
in | sortOrder | ||
) |
This sets the given index into coiToggleOrder to true and also sets the coiSortOrder value to the given index. This performs similarly to setCOISortOrder, but here the coiToggleOrder is not reset (i.e. all toggles turned off).
this | Instance of PACentroid |
sortOrder |
didChange | A boolean response
|
function PACentroid::toggleOnNextCOI | ( | in | this | ) |
function PACentroid::toggleOnPreviousCOI | ( | in | this | ) |
|
protected |
Numeric value indicating current state: values include.
Constant Property PACentroid::WEEKDAY_ORDER = 0 |