Skip to content
Snippets Groups Projects
Commit 3c37651f authored by bbauvin's avatar bbauvin
Browse files

Mumbo back on tracks

parent 1a8897a1
No related branches found
No related tags found
No related merge requests found
...@@ -46,7 +46,6 @@ def initLogFile(args): ...@@ -46,7 +46,6 @@ def initLogFile(args):
directory = "../../Results/"+args.name+"/started_"+time.strftime("%Y_%m_%d-%H_%M")+"/" directory = "../../Results/"+args.name+"/started_"+time.strftime("%Y_%m_%d-%H_%M")+"/"
logFileName = time.strftime("%Y%m%d-%H%M%S") + "-CMultiV-" + args.CL_type + "-" + "_".join(args.views.split(":")) + "-" + args.name + \ logFileName = time.strftime("%Y%m%d-%H%M%S") + "-CMultiV-" + args.CL_type + "-" + "_".join(args.views.split(":")) + "-" + args.name + \
"-LOG" "-LOG"
print logFileName
if not os.path.exists(os.path.dirname(directory+logFileName)): if not os.path.exists(os.path.dirname(directory+logFileName)):
try: try:
os.makedirs(os.path.dirname(directory+logFileName)) os.makedirs(os.path.dirname(directory+logFileName))
...@@ -154,7 +153,7 @@ def initBenchmark(args): ...@@ -154,7 +153,7 @@ def initBenchmark(args):
allMumboAlgos = [name for _, name, isPackage in allMumboAlgos = [name for _, name, isPackage in
pkgutil.iter_modules(['Multiview/Mumbo/Classifiers']) pkgutil.iter_modules(['Multiview/Mumbo/Classifiers'])
if not isPackage and not name in ["SubSampling", "ModifiedMulticlass", "Kover"]] if not isPackage and not name in ["SubSampling", "ModifiedMulticlass", "Kover"]]
allMultiviewAlgos = {"Fusion": allFusionAlgos}#, "Mumbo": allMumboAlgos allMultiviewAlgos = {"Fusion": allFusionAlgos, "Mumbo": allMumboAlgos}
benchmark = {"Monoview": allMonoviewAlgos, "Multiview": allMultiviewAlgos} benchmark = {"Monoview": allMonoviewAlgos, "Multiview": allMultiviewAlgos}
if "Multiview" in args.CL_type.strip(":"): if "Multiview" in args.CL_type.strip(":"):
......
...@@ -29,7 +29,6 @@ def imgCrawl(path, sClassLabels, nameDB, nbClasses): ...@@ -29,7 +29,6 @@ def imgCrawl(path, sClassLabels, nameDB, nbClasses):
# if the amount of classes to be evalauated is limited # if the amount of classes to be evalauated is limited
if(i>nbClasses): if(i>nbClasses):
print i
break break
# loop througe files and create df # loop througe files and create df
......
...@@ -96,8 +96,6 @@ class SCMForLinear(LateFusionClassifier): ...@@ -96,8 +96,6 @@ class SCMForLinear(LateFusionClassifier):
getV(DATASET, viewIndex, usedIndices)) getV(DATASET, viewIndex, usedIndices))
accus.append(accuracy_score(DATASET.get("Labels").value[usedIndices], monoviewDecision)) accus.append(accuracy_score(DATASET.get("Labels").value[usedIndices], monoviewDecision))
monoviewDecisions[:, index] = monoviewDecision monoviewDecisions[:, index] = monoviewDecision
print monoviewDecisions
exit()
features = self.generateInteractions(monoviewDecisions) features = self.generateInteractions(monoviewDecisions)
predictedLabels = self.SCMClassifier.predict(features) predictedLabels = self.SCMClassifier.predict(features)
else: else:
...@@ -161,7 +159,6 @@ class SCMForLinear(LateFusionClassifier): ...@@ -161,7 +159,6 @@ class SCMForLinear(LateFusionClassifier):
if type(self.order)==type(None): if type(self.order)==type(None):
order = monoViewDecisions.shape[1] order = monoViewDecisions.shape[1]
if self.order==1: if self.order==1:
print monoViewDecisions
return monoViewDecisions return monoViewDecisions
else: else:
......
...@@ -26,7 +26,6 @@ def DecisionTree(data, labels, arg, weights): ...@@ -26,7 +26,6 @@ def DecisionTree(data, labels, arg, weights):
def getConfig(classifierConfig): def getConfig(classifierConfig):
print classifierConfig
depth = classifierConfig[0] depth = classifierConfig[0]
subSampling = classifierConfig[1] subSampling = classifierConfig[1]
return 'with depth ' + str(depth) + ', ' + ' sub-sampled at ' + str(subSampling) + ' ' return 'with depth ' + str(depth) + ', ' + ' sub-sampled at ' + str(subSampling) + ' '
...@@ -46,7 +45,7 @@ def gridSearch(data, labels, metric="accuracy_score"): ...@@ -46,7 +45,7 @@ def gridSearch(data, labels, metric="accuracy_score"):
preliminary_accuracy = np.mean(preliminary_accuracies) preliminary_accuracy = np.mean(preliminary_accuracies)
if preliminary_accuracy < 0.50: if preliminary_accuracy < 0.50:
for max_depth in np.arange(10)+1: for max_depth in np.arange(10)+1:
for subSampling in sorted(np.arange(20, dtype=float)+1/20, reverse=True): for subSampling in sorted((np.arange(20, dtype=float)+1)/20, reverse=True):
if subSampling > minSubSampling: if subSampling > minSubSampling:
accuracies = np.zeros(50) accuracies = np.zeros(50)
for i in range(50): for i in range(50):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment