A high-level class to perform the outlier detection. More...
#include <OutlierDetector.h>
Public Member Functions | |
COutlierDetector () | |
Default constructor. | |
COutlierDetector (TrajData *data) | |
Constructor that accepts data. | |
bool | ResetOutlierDetector () |
Resets the outlier detector object. More... | |
bool | PartitionTrajectory () |
Partitions the trajectories in the data. More... | |
bool | DetectOutlier () |
Finds outliers and stores them in the data member. More... | |
Public Attributes | |
TrajData * | m_data |
Private Member Functions | |
bool | FindOptimalPartition (CTrajectory *pTrajectory) |
Finds optimal partitioning of a trajectory. More... | |
bool | StoreTrajectoryPartitionIntoIndex () |
Saves the trajectory partitioning and precomputes some calculations (such as distances) | |
bool | CheckOutlyingProportion (CTrajectory *pTrajectory, float minProportion) |
Checks if the trajectory contains a significant portion of outlying partitions. | |
bool | GenerateAndSetupOutlier (CTrajectory *pTrajectory, int outlierId) |
Marks the given trajectory as an outlier in the data member. More... | |
int | ComputeModelCost (CTrajectory *pTrajectory, int startPIndex, int endPIndex) |
Measures the model cost of using a partition to represent part of a trajectory. More... | |
int | ComputeEncodingCost (CTrajectory *pTrajectory, int startPIndex, int endPIndex) |
Measures the encoding cost of using a partition to represent part of a trajectory. More... | |
float | MeasurePerpendicularDistance (CMDPoint *s1, CMDPoint *e1, CMDPoint *s2, CMDPoint *e2) |
Measures the perpendicular distance between two line segments (see paper for definition of perpendicular distance) | |
float | MeasureDistanceFromPointToLineSegment (CMDPoint *s, CMDPoint *e, CMDPoint *p) |
Measures the distance between a point and a line segment. | |
float | MeasureDistanceFromPointToPoint (CMDPoint *point1, CMDPoint *point2) |
Measures the distance between two points. | |
float | ComputeVectorLength (CMDPoint *vector) |
Computes the length of a vector. | |
float | ComputeInnerProduct (CMDPoint *vector1, CMDPoint *vector2) |
Computes the inner product between two vectors. | |
float | MeasureAngleDisntance (CMDPoint *s1, CMDPoint *e1, CMDPoint *s2, CMDPoint *e2) |
Measures the angle distance between two line segments (see paper for definition of angle distance) | |
float | ComputeDistanceBetweenTwoLineSegments (CMDPoint *startPoint1, CMDPoint *endPoint1, CMDPoint *startPoint2, CMDPoint *endPoint2) |
Computes the weighted distance between two line segments from component distances (see paper for definition of distance) | |
void | ComputeDistanceBetweenTwoLineSegments (CMDPoint *startPoint1, CMDPoint *endPoint1, CMDPoint *startPoint2, CMDPoint *endPoint2, float *distanceVector) |
Measures the perpendicular distance between two line segments (see paper for definition of perpendicular distance) and stores the result in distanceVector. | |
void | SubComputeDistanceBetweenTwoLineSegments (CMDPoint *startPoint1, CMDPoint *endPoint1, CMDPoint *startPoint2, CMDPoint *endPoint2, float &perpendicularDistance, float ¶llelDistance, float &angleDistance) |
Measures component distances and stores them in the variables perpendicularDistance, parallelDistance, and angleDistance. | |
Private Attributes | |
int | m_nTotalLineSegments |
vector< IntIntPair > | m_idArray |
vector< PointPointPair > | m_lineSegmentArray |
vector< FloatArray > | m_distanceIndex |
FloatArray | m_lengthArray |
vector< PartitionInfo * > | m_partitionInfoArray |
CMDPoint | m_vector1 |
CMDPoint | m_vector2 |
CMDPoint | m_projectionPoint |
float | m_coefficient |
float | m_coefficient1 |
float | m_coefficient2 |
PartitionInfo | m_partitionInfo |
float | m_distance1 |
float | m_distance2 |
float | m_theta |
float | m_cosTheta |
float | m_lowerBoundPerp |
float | m_lowerBoundPara |
float | m_lowerBoundAngle |
float | m_upperBoundPerp |
float | m_upperBoundPara |
float | m_upperBoundAngle |
map< IntIntPair, int > | m_closePartitionArrayIndexMap |
vector< vector< IntIntPair > > | m_closePartitionArray |
map< IntIntPair, float > | m_finePartitionLengthMap |
map< IntIntPair, int > | m_coarsePartitionIdMap |
A high-level class to perform the outlier detection.
Mainly does management of the outlier detection (prunining of partitions for optimization, flagging trajectories as outliers, etc.) Much of the actual computation for outlier detection occurs in CDistanceOutlier.
|
private |
Measures the encoding cost of using a partition to represent part of a trajectory.
In the MDL description of the paper this is known as L(D|H). It is the distance between the original trajectory and the partition representation.
[in] | pTrajectory | the trajectory that is being partitioned |
[in] | startPIndex | the index of the staring point of the partition |
[in] | endPIndex | the index of the ending point of the partition |
|
private |
Measures the model cost of using a partition to represent part of a trajectory.
In the MDL description of the paper this is known as L(H). It is the length of the partition.
[in] | pTrajectory | the trajectory that is being partitioned |
[in] | startPIndex | the index of the staring point of the partition |
[in] | endPIndex | the index of the ending point of the partition |
bool COutlierDetector::DetectOutlier | ( | ) |
Finds outliers and stores them in the data member.
Finds outliers in the data that is contained in the m_data field of the object. The outlying trajectories are stored in the m_outlierList member of the supplied data.
|
private |
Finds optimal partitioning of a trajectory.
Consults PARTITION_PRUNING_OPTIMIZATION to determine if the optimizations to the two-level partitioning should be used.
[in] | pTrajectory | the trajectory to partition |
|
private |
Marks the given trajectory as an outlier in the data member.
bool COutlierDetector::PartitionTrajectory | ( | ) |
Partitions the trajectories in the data.
Consults parameter USE_CONVENTIONAL_PARTITONING to determine whether or not to use two-level partitioning scheme
bool COutlierDetector::ResetOutlierDetector | ( | ) |
Resets the outlier detector object.
Clears all of the internal arrays and resets the counters. Does not clear the trajectory data.