SciLib.Neuro
Class Classify

java.lang.Object
  extended by SciLib.Neuro.Classify

public final class Classify
extends java.lang.Object

This class defines methods used to solve a classification problem.


Constructor Summary
Classify()
           
 
Method Summary
static int checkValidClassify(vector y)
          Classify a pattern y by the check valid method
static void chooseKRowsRandomly(matrix m, integerVector rowIndexes, int k)
          Choose randomly k rows of the matrix m.
static int classify(vector y, int type)
          Classify a pattern y
static integerVector[] kMeanClustering(int k, matrix m, matrix cs)
          Compute a matrix that contains k clustering patterns
static int nearest(vector x, matrix m)
          Find the row index of the matrix m that has minimum distance to x.
static int nearestClassify(vector y)
          Classify a pattern y by the nearest method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Classify

public Classify()
Method Detail

classify

public static int classify(vector y,
                           int type)
Classify a pattern y

Parameters:
y - A vector, the pattern
type - An integer value, 0 for the nearest neighbor method 1 for the CheckValid method
Returns:
an integer

nearestClassify

public static int nearestClassify(vector y)
Classify a pattern y by the nearest method

Parameters:
y - A vector, the pattern
Returns:
an integer

checkValidClassify

public static int checkValidClassify(vector y)
Classify a pattern y by the check valid method

Parameters:
y - A vector, the pattern
Returns:
an integer

nearest

public static int nearest(vector x,
                          matrix m)
Find the row index of the matrix m that has minimum distance to x.

Parameters:
x - A vector
m - A matrix
Returns:
an integer

chooseKRowsRandomly

public static void chooseKRowsRandomly(matrix m,
                                       integerVector rowIndexes,
                                       int k)
Choose randomly k rows of the matrix m. The result saved in rowIndexes vector

Parameters:
m - A matrix
rowIndexes - An integerVector
k - An integer

kMeanClustering

public static integerVector[] kMeanClustering(int k,
                                              matrix m,
                                              matrix cs)
Compute a matrix that contains k clustering patterns

Parameters:
k - An integer
m - A matrix
cs - A matrix