LSH/classification_utils.py
def train(trainDat, trainLabs, R, hyperparam):
    '''
    Train a classifier of your choice on the data.
    @param trainDat an ndarray of training data, one row per example
    @param trainLabs an ndarray of training data labels, one row per training example
    @param R the input to the ANN classification algorithm (radius)
    @param hyperparam the hyper-parameter to train with (number of neighbors to use)
    @raise LogicalError if the training labels do not match the training data
    @return the trained classifier 
    '''
    
    if len(trainLabs) != len(trainDat):
        raise LogicalError, "Method \"train\": training labels don't match with training data."
    classifier = ANN(R, hyperparam) # TODO: Solve the radius situation
    classifier = classifier.train(trainDat, trainLabs)
    return classifier

    Train a classifier of your choice on the data.
    @param trainDat an ndarray of training data, one row per example
    @param trainLabs an ndarray of training data labels, one row per training example
    @param R the input to the ANN classification algorithm (radius)
    @param hyperparam the hyper-parameter to train with (number of neighbors to use)
    @raise LogicalError if the training labels do not match the training data
    @return the trained classifier 
    
Train a classifier of your choice on the data.
Train a classifier of your choice on the data .
def train(trainDat, trainLabs, R, hyperparam):
    if len(trainLabs) != len(trainDat):
        raise LogicalError, "Method \"train\": training labels don't match with training data."
    classifier = ANN(R, hyperparam) 
    classifier = classifier.train(trainDat, trainLabs)
    return classifier
def train ( trainDat , trainLabs , R , hyperparam ) : if len ( trainLabs ) != len ( trainDat ) : raise LogicalError , "Method \"train\": training labels don't match with training data." classifier = ANN ( R , hyperparam ) classifier = classifier . train ( trainDat , trainLabs ) return classifier
Train a classifier of your choice on the data.
Train a classifier of your choice on the data .
'''
    Train a classifier of your choice on the data.
    @param trainDat an ndarray of training data, one row per example
    @param trainLabs an ndarray of training data labels, one row per training example
    @param R the input to the ANN classification algorithm (radius)
    @param hyperparam the hyper-parameter to train with (number of neighbors to use)
    @raise LogicalError if the training labels do not match the training data
    @return the trained classifier 
    ''' # TODO: Solve the radius situation
trainDat
trainLabs
R
hyperparam