In this section, there are links to the code that was written,
the SVM_light package, as well as a link to the data
files we produced. We assume that the user of these scripts have the ISET
toolkit installed on their computers.
Scripts – These are scripts we produced to ease the
collection of error data and behavioral data.
Tester.m – This script was used to produce 100 harmonics for subjects
to evaluate as “colored” or “not colored.” Subjects press any key to proceed to
the next harmonic.
measError.m – This script was used to calculate
the CIELAB, sCIELAB, and Hasler
error values for each harmonic. The error values were saved into a data file
called errors_final.mat, which can be found in the data zip file.
freqOrientTest.m – This script was used to evaluate
the classifiers by running the classifiers against perceived color evaluations.
The percentage error is shown at the end of the function.
Classifers – These functions were used to (a)
create the classifiers and (b) use the models to classify data.
logisticRegression.m – This function is called without
any inputs and creates the best separating hyper-plane for the data according
to logistic regression. It does this for all three types of error values.
SVM.m – This function is called with a single input (which
describes the name of the model) and creates the best separating hyper-plane
for the data according to the support vector machine algorithm. It implicitly
calls SVM_light. It also does this for all three
error types.
naiveBayes.m – This function is called without
any inputs and generates the naïve Bayes model for
all three error types.
classifyLR.m – This is the logistic regression
classifier. It takes a string ‘type’ as an input (describing which error type
to use for classification) and a vector or matrix that contains the data in the
proper format. It returns whether it thinks the given data describes “colored”
or “not colored” harmonics.
classifySVM.m – This is the support vector machine
classifier. It also takes a string ‘type’ as an input (describing which error
type to use for classification) and a vector or matrix that contains the data
in the proper format. It returns whether it thinks the given data describes
“colored” or “not colored” harmonics.
classifyNB.m – This is the naïve Bayes classifier. . It also takes a string ‘type’ as an
input (describing which error type to use for classification) and a vector or
matrix that contains the data in the proper format. It returns whether it
thinks the given data describes “colored”, “unknown”, or “not colored”
harmonics.
Data preparation – We collected our data in 10x10 matrices,
where the columns represented varying frequencies and the rows represented
varying orientations. Each element had a corresponding 1 (colored) or 0 (not
colored) label as well as its error value. For each
distance, a different 10x10 matrix was found.
prepareData.m – This takes all the behavioral data
and the error data and reformats them into a matrix of 100 rows (for each
distance). Each row contains four columns, where each column corresponds to
“distance”, “frequency”, “orientation”, and “error value.” To see the relative
effects of removing a particular feature (such as distance), one can change the
formatting in this function. It also returns a column vector whose elements
describe whether a particular row in the returned matrix is colored or not.
reformatData.m – This takes the data we are trying
to classify and returns it as an appropriate matrix for classification. For
example, this function was called in the freqOrientTest.m
script in order to re-arrange the data for classification. This function must
return data in the same format that the function prepareData
returns, as it essentially performs the same operations without producing the
labels.
Miscellaneous files – Here you will find links to the
miscellaneous data files and the SVM_light program.
SVM_light – This program is free for non-commercial use, as specified
by Joachims on his website. It contains the
executables for running the support vector machine in Matlab.
Data
files – This zip
file contains all the behavioral data we collected in addition to the models
generated by the classifiers. One may need to change the directories that
SVMmodels.mat points to for the SVM to work properly.