Package weka.core.neighboursearch
Class PerformanceStats
- java.lang.Object
-
- weka.core.neighboursearch.PerformanceStats
-
- All Implemented Interfaces:
java.io.Serializable,AdditionalMeasureProducer,RevisionHandler
- Direct Known Subclasses:
TreePerformanceStats
public class PerformanceStats extends java.lang.Object implements AdditionalMeasureProducer, java.io.Serializable, RevisionHandler
The class that measures the performance of a nearest neighbour search (NNS) algorithm.- Version:
- $Revision: 1.2 $
- Author:
- Ashraf M. Kibriya (amk14[at-the-rate]cs[dot]waikato[dot]ac[dot]nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description doublem_CoordCountThe number of coordinates looked at for the current/last query.doublem_MaxCThe min and max coordinates(attributes) looked at per query.doublem_MaxPThe min and max data points looked for a query by the NNS algorithm.doublem_MinCThe min and max coordinates(attributes) looked at per query.doublem_MinPThe min and max data points looked for a query by the NNS algorithm.doublem_PointCountThe number of data points looked at for the current/last query.doublem_SumCThe sum of coordinates/attributes looked at for all the queries.doublem_SumPThe sum of data points looked at for all the queries.doublem_SumSqCThe squared sum of coordinates/attributes looked at for all the queries.doublem_SumSqPThe squared sum of data points looked at for all the queries.
-
Constructor Summary
Constructors Constructor Description PerformanceStats()default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.EnumerationenumerateMeasures()Returns an enumeration of the additional measure names.doublegetMaxCoordsPerPoint()Returns the maximum of coords per point.doublegetMaxPointsVisited()Returns the maximum of points visited.doublegetMeanCoordsPerPoint()Returns the mean of coords per point.doublegetMeanPointsVisited()Returns the mean of points visited.doublegetMeasure(java.lang.String additionalMeasureName)Returns the value of the named measure.doublegetMinCoordsPerPoint()Returns the minimum of coords per point.doublegetMinPointsVisited()Returns the minimum of points visited.intgetNumQueries()Returns the number of queries.java.lang.StringgetRevision()Returns the revision string.java.lang.StringgetStats()Returns a string representation of the statistics.doublegetStdDevCoordsPerPoint()Returns the standard deviation of coords per point.doublegetStdDevPointsVisited()Returns the standard deviation of points visited.doublegetTotalCoordsPerPoint()Returns the total sum of coords per point.doublegetTotalPointsVisited()Returns the total number of points visited.voidincrCoordCount()Increments the coordinate count (number of coordinates/attributes looked at).voidincrPointCount()Increments the point count (number of datapoints looked at).voidreset()Resets all internal fields/counters.voidsearchFinish()Signals end of the nearest neighbour search.voidsearchStart()Signals start of the nearest neighbour search.voidupdatePointCount(int n)adds the given number to the point count.
-
-
-
Field Detail
-
m_MinP
public double m_MinP
The min and max data points looked for a query by the NNS algorithm.
-
m_MaxP
public double m_MaxP
The min and max data points looked for a query by the NNS algorithm.
-
m_SumP
public double m_SumP
The sum of data points looked at for all the queries.
-
m_SumSqP
public double m_SumSqP
The squared sum of data points looked at for all the queries.
-
m_PointCount
public double m_PointCount
The number of data points looked at for the current/last query.
-
m_MinC
public double m_MinC
The min and max coordinates(attributes) looked at per query.
-
m_MaxC
public double m_MaxC
The min and max coordinates(attributes) looked at per query.
-
m_SumC
public double m_SumC
The sum of coordinates/attributes looked at for all the queries.
-
m_SumSqC
public double m_SumSqC
The squared sum of coordinates/attributes looked at for all the queries.
-
m_CoordCount
public double m_CoordCount
The number of coordinates looked at for the current/last query.
-
-
Method Detail
-
reset
public void reset()
Resets all internal fields/counters.
-
searchStart
public void searchStart()
Signals start of the nearest neighbour search. Initializes the stats object.
-
searchFinish
public void searchFinish()
Signals end of the nearest neighbour search. Calculates the statistics for the search.
-
incrPointCount
public void incrPointCount()
Increments the point count (number of datapoints looked at).
-
incrCoordCount
public void incrCoordCount()
Increments the coordinate count (number of coordinates/attributes looked at).
-
updatePointCount
public void updatePointCount(int n)
adds the given number to the point count.- Parameters:
n- The number to add to the point count.
-
getNumQueries
public int getNumQueries()
Returns the number of queries.- Returns:
- The number of queries.
-
getTotalPointsVisited
public double getTotalPointsVisited()
Returns the total number of points visited.- Returns:
- The total number.
-
getMeanPointsVisited
public double getMeanPointsVisited()
Returns the mean of points visited.- Returns:
- The mean points visited.
-
getStdDevPointsVisited
public double getStdDevPointsVisited()
Returns the standard deviation of points visited.- Returns:
- The standard deviation.
-
getMinPointsVisited
public double getMinPointsVisited()
Returns the minimum of points visited.- Returns:
- The minimum.
-
getMaxPointsVisited
public double getMaxPointsVisited()
Returns the maximum of points visited.- Returns:
- The maximum.
-
getTotalCoordsPerPoint
public double getTotalCoordsPerPoint()
Returns the total sum of coords per point.- Returns:
- The total per point.
-
getMeanCoordsPerPoint
public double getMeanCoordsPerPoint()
Returns the mean of coords per point.- Returns:
- The mean.
-
getStdDevCoordsPerPoint
public double getStdDevCoordsPerPoint()
Returns the standard deviation of coords per point.- Returns:
- The standard deviation.
-
getMinCoordsPerPoint
public double getMinCoordsPerPoint()
Returns the minimum of coords per point.- Returns:
- The minimum.
-
getMaxCoordsPerPoint
public double getMaxCoordsPerPoint()
Returns the maximum of coords per point.- Returns:
- The maximum.
-
enumerateMeasures
public java.util.Enumeration enumerateMeasures()
Returns an enumeration of the additional measure names.- Specified by:
enumerateMeasuresin interfaceAdditionalMeasureProducer- Returns:
- An enumeration of the measure names.
-
getMeasure
public double getMeasure(java.lang.String additionalMeasureName) throws java.lang.IllegalArgumentExceptionReturns the value of the named measure.- Specified by:
getMeasurein interfaceAdditionalMeasureProducer- Parameters:
additionalMeasureName- The name of the measure to query for its value.- Returns:
- The value of the named measure.
- Throws:
java.lang.IllegalArgumentException- If the named measure is not supported.
-
getStats
public java.lang.String getStats()
Returns a string representation of the statistics.- Returns:
- The statistics as string.
-
getRevision
public java.lang.String getRevision()
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Returns:
- the revision
-
-