def makeClOpt(testDataDir): o,a = ClassifierApp.defaultOptions() o.C = 0.03 o.kernel = "lin" #"rbf" origFeat = [pjoin(testDataDir,"usps-train.pkl"),pjoin(testDataDir,"usps-test.pkl")] o.inFeat = origFeat #o.inFeat = [pjoin(testDataDir,"usps.libsvm.pca")] o.labels = [ lf+".idlab" for lf in origFeat ] return o
def makeClOpt(testDataDir): o,a = ClassifierApp.defaultOptions() o.method = "svm" #"svm" #"smlr" o.C = 0.001 o.kernel = "rbf" #"rbf" "lin" o.inFeatFormat = "pkl" #"txt" #"pkl" if o.inFeatFormat == "txt": ext = ".libsvm" elif o.inFeatFormat == "pkl": ext = ".pkl" else: raise ValueError(o.inFeatFormat) origFeat = [pjoin(testDataDir,"usps-train"+ext),pjoin(testDataDir,"usps-test"+ext)] o.inFeat = origFeat #o.inFeat = [pjoin(testDataDir,"usps.libsvm.pca")] o.labels = [ lf+".idlab" for lf in origFeat ] o.balanceTrainCounts=-1 return o
def makeClOpt(): o,a = ClassifierApp.defaultOptions() o.C = 0.03 o.inFeat = [os.path.abspath("usps-train.libsvm"),os.path.abspath("usps-test.libsvm")] o.labels = [ lf+".idlab" for lf in o.inFeat ] return o