Skip to content
Snippets Groups Projects
Commit 8c341d33 authored by Baptiste Bauvin's avatar Baptiste Bauvin
Browse files

Added CQBoost and CQBoostv2

parent 2337a00f
No related branches found
No related tags found
No related merge requests found
......@@ -85,7 +85,7 @@
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2.0
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
......
......@@ -27,7 +27,7 @@ __author__ = "Baptiste Bauvin"
__status__ = "Prototype" # Production, Development, Prototype
def initBenchmark(CL_type, multiviewAlgos, monoviewAlgos, args):
def initBenchmark(CL_type, monoviewAlgos, multiviewAlgos, args):
r"""Used to create a list of all the algorithm packages names used for the benchmark.
First this function will check if the benchmark need mono- or/and multiview algorithms and adds to the right
......@@ -54,6 +54,7 @@ def initBenchmark(CL_type, multiviewAlgos, monoviewAlgos, args):
benchmark = {"Monoview": {}, "Multiview": {}}
allMultiviewPackages = [name for _, name, isPackage
in pkgutil.iter_modules(['./MonoMultiViewClassifiers/MultiviewClassifiers/']) if isPackage]
if "Monoview" in CL_type:
if monoviewAlgos == ['']:
benchmark["Monoview"] = [name for _, name, isPackage in pkgutil.iter_modules(["./MonoMultiViewClassifiers/MonoviewClassifiers"])
......
......@@ -59,6 +59,7 @@ def ExecMonoview(directory, X, Y, name, labelsNames, classificationIndices, KFol
logging.debug("Start:\t Determine Train/Test split")
X_train, y_train, X_test, y_test, X_test_multiclass = initTrainTest(X, Y, classificationIndices)
logging.debug("Info:\t Shape X_train:" + str(X_train.shape) + ", Length of y_train:" + str(len(y_train)))
logging.debug("Info:\t Shape X_test:" + str(X_test.shape) + ", Length of y_test:" + str(len(y_test)))
logging.debug("Done:\t Determine Train/Test split")
......@@ -168,7 +169,7 @@ def getHPs(classifierModule, hyperParamSearch, nIter, CL_type, X_train, y_train,
def saveResults(stringAnalysis, outputFileName, full_labels_pred, y_train_pred, y_train, imagesAnalysis):
logging.info(stringAnalysis)
outputTextFile = open(outputFileName + '.txt', 'w')
outputTextFile = open(outputFileName + 'summary.txt', 'w')
outputTextFile.write(stringAnalysis)
outputTextFile.close()
np.savetxt(outputFileName + "full_pred.csv", full_labels_pred.astype(np.int16), delimiter=",")
......
......@@ -6,7 +6,7 @@ from .. import Metrics
def getDBConfigString(name, feat, classificationIndices, shape, classLabelsNames, KFolds):
learningRate = float(len(classificationIndices[0])) / len(classificationIndices[0]) + len(classificationIndices[1])
learningRate = float(len(classificationIndices[0])) / (len(classificationIndices[0]) + len(classificationIndices[1]))
dbConfigString = "Database configuration : \n"
dbConfigString += "\t- Database name : " + name + "\n"
dbConfigString += "\t- View name : " + feat + "\t View shape : " + str(shape) + "\n"
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -146,6 +146,24 @@ def parseTheArgs(arguments):
groupSCM.add_argument('--SCM_model_type', metavar='STRING', action='store',
help='Max number of rules for SCM', default="conjunction")
groupCQBoost = parser.add_argument_group('CQBoost arguments')
groupCQBoost.add_argument('--CQB_mu', metavar='FLOAT', type=float, action='store',
help='Set the mu parameter for CQBoost', default=0.001)
groupCQBoost.add_argument('--CQB_epsilon', metavar='FLOAT', type=float, action='store',
help='Set the epsilon parameter for CQBoost', default=1e-08)
groupCQBoostv2 = parser.add_argument_group('CQBoostv2 arguments')
groupCQBoostv2.add_argument('--CQB2_mu', metavar='FLOAT', type=float, action='store',
help='Set the mu parameter for CQBoostv2', default=0.001)
groupCQBoostv2.add_argument('--CQB2_epsilon', metavar='FLOAT', type=float, action='store',
help='Set the epsilon parameter for CQBoostv2', default=1e-08)
groupCQBoostv21 = parser.add_argument_group('CQBoostv21 arguments')
groupCQBoostv21.add_argument('--CQB21_mu', metavar='FLOAT', type=float, action='store',
help='Set the mu parameter for CQBoostv2', default=0.001)
groupCQBoostv21.add_argument('--CQB21_epsilon', metavar='FLOAT', type=float, action='store',
help='Set the epsilon parameter for CQBoostv2', default=1e-08)
groupMumbo = parser.add_argument_group('Mumbo arguments')
groupMumbo.add_argument('--MU_types', metavar='STRING', action='store', nargs="+",
help='Determine which monoview classifier to use with Mumbo',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment