stereodisk
Class StereoCupRimClassifier

java.lang.Object
  |
  +--stereodisk.StereoDiskAnalyzer
        |
        +--stereodisk.StereoCupRimClassifier

public class StereoCupRimClassifier
extends StereoDiskAnalyzer

Stereo disk photograph cup and rim classifier. Uses KNN to classify a stereo pair of disk photographs into cup, rim, and retina. Uses sequential feature forward selection to select the optimal set of features. This means features are added one by one, and the feature that gives the largest increase in (or total) accuracy is added to the feature set, and the process is repeated. Copyright (c) 1999-2003, Michael Abramoff. All rights reserved.


Fields inherited from class stereodisk.StereoDiskAnalyzer
height, PIXEL_SAMPLING, testing, training, width
 
Constructor Summary
StereoCupRimClassifier()
           
 
Method Summary
static int findBestFeature(Features dataset, float[] datasetTruth, Features m, float[] mTruth, int n, int k, int[] included)
          Find the feature that gives the highest incremental accuracy gain.
static void main(java.lang.String[] args)
           
 
Methods inherited from class stereodisk.StereoDiskAnalyzer
analyzeProbabilities, buildString, createBalancedSampleBlock, createBalancedSampleBlocks, createSampleBlock, createSampleBlocks, imageFeaturePixels, loadFeatures, loadFloatImage, loadFloatImages, min, pixelsToDataset, plotProbs, sampleEvenImages, sampleFeatureImagePixels, sampleFeatureImagePixels, sampleImages, sampleOddImages, showAccuracies, subsample, subsample, subset, subset, testKNN, trainKNN
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StereoCupRimClassifier

public StereoCupRimClassifier()
Method Detail

main

public static void main(java.lang.String[] args)

findBestFeature

public static int findBestFeature(Features dataset,
                                  float[] datasetTruth,
                                  Features m,
                                  float[] mTruth,
                                  int n,
                                  int k,
                                  int[] included)
Find the feature that gives the highest incremental accuracy gain. Features contains a data space for knn, and m contains the features that need to be classified. The average accuracy of the resulting classification vector is determined and shown. The features and m need to be organized in the same way, i.e. features[x][j] and m[y][j] refer to a feature of the same type, j.
Parameters:
features - the MxN matrix of N-dimensional features
featureTruth - a 1xM vector of the true classification for each element in data, 0 <= truth[i] <= n.
m - a PxQ matrix of Q-dimensional features that need to be classified, with Q <= N.
mTruth - a 1xP vector of the true classification for each element in m, 0 <= truth[i] <= n.
featureNames - the name of each j'th feature in features (and m).
n - the number of different classes in truth.
k - the number of neighbors to use for classification
included - is an int[] with the indices of those features currently included in the classifier.
Returns:
the index of the best feature.