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

Analyse results on work, need to add get config to methods and classifiers

parent 89d41ea4
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,13 @@
</component>
<component name="ChangeListManager">
<list default="true" id="7b111a3e-1726-4d52-a9de-f7a3f867dbc7" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Code/MultiView/Fusion/Fusion.py" afterPath="$PROJECT_DIR$/Code/MultiView/Fusion/Fusion.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Code/MultiView/Fusion/Methods/EarlyFusion.py" afterPath="$PROJECT_DIR$/Code/MultiView/Fusion/Methods/EarlyFusion.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Code/MultiView/Fusion/Methods/LateFusion.py" afterPath="$PROJECT_DIR$/Code/MultiView/Fusion/Methods/LateFusion.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Code/MultiView/Fusion/Methods/MonoviewClassifiers/RandomForest.py" afterPath="$PROJECT_DIR$/Code/MultiView/Fusion/Methods/MonoviewClassifiers/RandomForest.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Code/MultiView/Fusion/analyzeResults.py" afterPath="$PROJECT_DIR$/Code/MultiView/Fusion/analyzeResults.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Code/MultiView/Mumbo/analyzeResults.py" afterPath="$PROJECT_DIR$/Code/MultiView/Mumbo/analyzeResults.py" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/Code/MultiView/Results/2016_08_18-CMultiV-Fusion-Methyl_MiRNA_RNASEQ_Clinical-MultiOmic-LOG" afterPath="$PROJECT_DIR$/Code/MultiView/Results/2016_08_18-CMultiV-Fusion-Methyl_MiRNA_RNASEQ_Clinical-MultiOmic-LOG" />
</list>
<ignored path="multiview-machine-learning-omis.iws" />
<ignored path=".idea/workspace.xml" />
......@@ -42,8 +48,8 @@
<file leaf-file-name="ExecMultiview.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Code/MultiView/ExecMultiview.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="828">
<caret line="70" column="91" selection-start-line="70" selection-start-column="91" selection-end-line="70" selection-end-column="91" />
<state relative-caret-position="522">
<caret line="92" column="56" selection-start-line="90" selection-start-column="1" selection-end-line="92" selection-end-column="56" />
<folding>
<element signature="e#0#10#0" expanded="true" />
</folding>
......@@ -54,8 +60,18 @@
<file leaf-file-name="Mumbo.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Code/MultiView/Mumbo/Mumbo.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1153">
<caret line="2" column="0" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="36" />
<state relative-caret-position="54">
<caret line="3" column="6" selection-start-line="3" selection-start-column="5" selection-end-line="3" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="analyzeResults.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Code/MultiView/Mumbo/analyzeResults.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-381">
<caret line="86" column="45" selection-start-line="86" selection-start-column="45" selection-end-line="86" selection-end-column="45" />
<folding />
</state>
</provider>
......@@ -64,18 +80,18 @@
<file leaf-file-name="Fusion.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/Fusion.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="162">
<caret line="9" column="8" selection-start-line="9" selection-start-column="8" selection-end-line="9" selection-end-column="8" />
<state relative-caret-position="198">
<caret line="11" column="28" selection-start-line="11" selection-start-column="28" selection-end-line="11" selection-end-column="28" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="LateFusion.py" pinned="false" current-in-tab="false">
<file leaf-file-name="LateFusion.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/Methods/LateFusion.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="738">
<caret line="56" column="23" selection-start-line="54" selection-start-column="8" selection-end-line="56" selection-end-column="23" />
<state relative-caret-position="594">
<caret line="201" column="0" selection-start-line="201" selection-start-column="0" selection-end-line="201" selection-end-column="0" />
<folding>
<element signature="e#45#63#0" expanded="true" />
</folding>
......@@ -83,31 +99,33 @@
</provider>
</entry>
</file>
<file leaf-file-name="EarlyFusion.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/Methods/EarlyFusion.py">
<file leaf-file-name="analyzeResults.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/analyzeResults.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="324">
<caret line="20" column="36" selection-start-line="20" selection-start-column="36" selection-end-line="20" selection-end-column="36" />
<state relative-caret-position="288">
<caret line="21" column="0" selection-start-line="21" selection-start-column="0" selection-end-line="21" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="RandomForest.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/Methods/MonoviewClassifiers/RandomForest.py">
<file leaf-file-name="EarlyFusion.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/Methods/EarlyFusion.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="9" selection-end-column="0" />
<folding />
<state relative-caret-position="753">
<caret line="55" column="38" selection-start-line="55" selection-start-column="38" selection-end-line="55" selection-end-column="38" />
<folding>
<element signature="e#45#71#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="SVC.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/Methods/MonoviewClassifiers/SVC.py">
<file leaf-file-name="RandomForest.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/Methods/MonoviewClassifiers/RandomForest.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="108">
<caret line="6" column="57" selection-start-line="6" selection-start-column="57" selection-end-line="6" selection-end-column="57" />
<state relative-caret-position="198">
<caret line="11" column="18" selection-start-line="11" selection-start-column="18" selection-end-line="11" selection-end-column="18" />
<folding />
</state>
</provider>
......@@ -123,16 +141,6 @@
</provider>
</entry>
</file>
<file leaf-file-name="SGD.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/Methods/MonoviewClassifiers/SGD.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="144">
<caret line="8" column="7" selection-start-line="8" selection-start-column="7" selection-end-line="8" selection-end-column="7" />
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
......@@ -155,23 +163,23 @@
<list>
<option value="$PROJECT_DIR$/Code/MultiView/Mumbo/Classifiers/SubSampling.py" />
<option value="$PROJECT_DIR$/Code/MultiView/Mumbo/Classifiers/DecisionTree.py" />
<option value="$PROJECT_DIR$/Code/MultiView/Mumbo/analyzeResults.py" />
<option value="$PROJECT_DIR$/Code/MonoView/Results-ClassMonoView/run.py" />
<option value="$PROJECT_DIR$/Code/MonoView/ClassifMonoView.py" />
<option value="$PROJECT_DIR$/Code/MonoView/run.py" />
<option value="$PROJECT_DIR$/Code/MonoView/ExecClassifMonoView.py" />
<option value="$PROJECT_DIR$/Code/MultiView/Mumbo/Mumbo.py" />
<option value="$PROJECT_DIR$/Code/MultiView/Fusion/analyzeResults.py" />
<option value="$PROJECT_DIR$/Code/MultiView/GetMutliviewDb.py" />
<option value="$PROJECT_DIR$/Code/MultiView/Fusion/Fusion.py" />
<option value="$PROJECT_DIR$/Code/MultiView/Fusion/Methods/MonoviewClassifiers/RandomForest.py" />
<option value="$PROJECT_DIR$/Code/MultiView/Fusion/Methods/MonoviewClassifiers/DecisionTree.py" />
<option value="$PROJECT_DIR$/Code/MultiView/Fusion/Methods/MonoviewClassifiers/SGD.py" />
<option value="$PROJECT_DIR$/Code/MultiView/ExecMultiview.py" />
<option value="$PROJECT_DIR$/Code/MultiView/Fusion/Methods/MonoviewClassifiers/SVC.py" />
<option value="$PROJECT_DIR$/Code/MultiView/Fusion/Methods/LateFusion.py" />
<option value="$PROJECT_DIR$/Code/MultiView/run.py" />
<option value="$PROJECT_DIR$/Code/MultiView/Mumbo/analyzeResults.py" />
<option value="$PROJECT_DIR$/Code/MultiView/Fusion/Fusion.py" />
<option value="$PROJECT_DIR$/Code/MultiView/Fusion/Methods/MonoviewClassifiers/RandomForest.py" />
<option value="$PROJECT_DIR$/Code/MultiView/Fusion/Methods/LateFusion.py" />
<option value="$PROJECT_DIR$/Code/MultiView/Fusion/Methods/EarlyFusion.py" />
<option value="$PROJECT_DIR$/Code/MultiView/Fusion/analyzeResults.py" />
</list>
</option>
</component>
......@@ -1072,7 +1080,7 @@
<workItem from="1471015625592" duration="6658000" />
<workItem from="1471026538529" duration="2605000" />
<workItem from="1471292536490" duration="38724000" />
<workItem from="1471526341422" duration="7004000" />
<workItem from="1471526341422" duration="9555000" />
</task>
<task id="LOCAL-00001" summary="Refactored and added subsampling file in classifiers module">
<created>1470926189095</created>
......@@ -1085,7 +1093,7 @@
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="68360000" />
<option name="totallyTimeSpent" value="70911000" />
</component>
<component name="ToolWindowManager">
<frame x="65" y="24" width="1855" height="1056" extended-state="6" />
......@@ -1499,18 +1507,13 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Code/MultiView/Mumbo/analyzeResults.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1638">
<caret line="98" column="27" selection-start-line="98" selection-start-column="12" selection-end-line="98" selection-end-column="27" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Code/MonoView/ExecClassifMonoView.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1800">
<caret line="157" column="30" selection-start-line="157" selection-start-column="30" selection-end-line="157" selection-end-column="30" />
<folding>
<element signature="e#113#181#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
......@@ -1536,16 +1539,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/analyzeResults.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="882">
<caret line="54" column="29" selection-start-line="54" selection-start-column="29" selection-end-line="54" selection-end-column="29" />
<folding>
<element signature="e#0#98#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/Methods/MonoviewClassifiers/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
......@@ -1580,46 +1573,62 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/Fusion.py">
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/Methods/MonoviewClassifiers/DecisionTree.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="162">
<caret line="9" column="8" selection-start-line="9" selection-start-column="8" selection-end-line="9" selection-end-column="8" />
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="7" selection-end-column="21" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/Methods/MonoviewClassifiers/RandomForest.py">
<entry file="file://$PROJECT_DIR$/Code/MultiView/ExecMultiview.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="9" selection-end-column="0" />
<state relative-caret-position="522">
<caret line="92" column="56" selection-start-line="90" selection-start-column="1" selection-end-line="92" selection-end-column="56" />
<folding>
<element signature="e#0#10#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Code/MultiView/Mumbo/Mumbo.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="54">
<caret line="3" column="6" selection-start-line="3" selection-start-column="5" selection-end-line="3" selection-end-column="6" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/Methods/MonoviewClassifiers/DecisionTree.py">
<entry file="file://$PROJECT_DIR$/Code/MultiView/Mumbo/analyzeResults.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="7" selection-end-column="21" />
<state relative-caret-position="-381">
<caret line="86" column="45" selection-start-line="86" selection-start-column="45" selection-end-line="86" selection-end-column="45" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/Methods/LateFusion.py">
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/Fusion.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="738">
<caret line="56" column="23" selection-start-line="54" selection-start-column="8" selection-end-line="56" selection-end-column="23" />
<folding>
<element signature="e#45#63#0" expanded="true" />
</folding>
<state relative-caret-position="198">
<caret line="11" column="28" selection-start-line="11" selection-start-column="28" selection-end-line="11" selection-end-column="28" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Code/MultiView/ExecMultiview.py">
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/Methods/MonoviewClassifiers/RandomForest.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="828">
<caret line="70" column="91" selection-start-line="70" selection-start-column="91" selection-end-line="70" selection-end-column="91" />
<state relative-caret-position="198">
<caret line="11" column="18" selection-start-line="11" selection-start-column="18" selection-end-line="11" selection-end-column="18" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/Methods/EarlyFusion.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="753">
<caret line="55" column="38" selection-start-line="55" selection-start-column="38" selection-end-line="55" selection-end-column="38" />
<folding>
<element signature="e#0#10#0" expanded="true" />
<element signature="e#45#71#0" expanded="true" />
</folding>
</state>
</provider>
......@@ -1632,19 +1641,21 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Code/MultiView/Mumbo/Mumbo.py">
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/analyzeResults.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1153">
<caret line="2" column="0" selection-start-line="2" selection-start-column="0" selection-end-line="2" selection-end-column="36" />
<state relative-caret-position="288">
<caret line="21" column="0" selection-start-line="21" selection-start-column="0" selection-end-line="21" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/Methods/EarlyFusion.py">
<entry file="file://$PROJECT_DIR$/Code/MultiView/Fusion/Methods/LateFusion.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="324">
<caret line="20" column="36" selection-start-line="20" selection-start-column="36" selection-end-line="20" selection-end-column="36" />
<folding />
<state relative-caret-position="594">
<caret line="201" column="0" selection-start-line="201" selection-start-column="0" selection-end-line="201" selection-end-column="0" />
<folding>
<element signature="e#45#63#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
......
......@@ -37,3 +37,6 @@ class Fusion:
predictFusion = getattr(fusionType, fusionMethod+"Predict") # linearWeighted for example
predictedLabels = predictFusion(DATASET, fusionClassifier)
return predictedLabels
#!/usr/bin/env python
# -*- encoding: utf-8
from MonoviewClassifiers import *
import MonoviewClassifiers
import numpy as np
class EarlyFusionClassifier:
def __init__(self, monoviewClassifiersNames, monoviewClassifiersConfigs, NB_CORES=1):
self.monoviewClassifiersName = monoviewClassifiersNames[0]
self.monoviewClassifierName = monoviewClassifiersNames[0]
self.monoviewClassifiersConfig = monoviewClassifiersConfigs[0]
self.monoviewClassifier = None
self.nbCores = NB_CORES
......@@ -36,7 +36,7 @@ class WeightedLinear(EarlyFusionClassifier):
if not trainIndices:
trainIndices = range(DATASET.get("datasetLength").value)
self.makeMonoviewData_hdf5(DATASET, weights=self.weights, usedIndices=trainIndices)
monoviewClassifierModule = globals()[self.monoviewClassifiersName]
monoviewClassifierModule = getattr(MonoviewClassifiers, self.monoviewClassifierName)
self.monoviewClassifier = monoviewClassifierModule.fit(self.monoviewData, DATASET["/Labels/labelsArray"][trainIndices],
NB_CORES=self.nbCores,
**dict((str(configIndex),config) for configIndex,config in
......@@ -52,3 +52,10 @@ class WeightedLinear(EarlyFusionClassifier):
predictedLabels=[]
return predictedLabels
def getConfig(self, fusionMethodConfig ,monoviewClassifiersNames, monoviewClassifiersConfigs):
print monoviewClassifiersNames
configString = "poulet"
monoviewClassifierModule = getattr(MonoviewClassifiers, monoviewClassifiersNames[0])
configString += monoviewClassifierModule.getConfig(monoviewClassifiersConfigs[0])
return configString
......@@ -192,6 +192,16 @@ class BayesianInference(LateFusionClassifier):
predictedLabels = []
return predictedLabels
def getConfig(self, fusionMethodConfig, monoviewClassifiersNames,monoviewClassifiersConfigs):
configString = "poulet"
for monoviewClassifierConfig, monoviewClassifierName in zip(monoviewClassifiersConfigs, monoviewClassifiersNames):
monoviewClassifierModule = getattr(MonoviewClassifiers, monoviewClassifierName)
configString += monoviewClassifierModule.getConfig(monoviewClassifierConfig)
return configString
#
# def weightedProduct(featureProbas, weights):
# try:
......
......@@ -7,3 +7,6 @@ def fit(DATASET, CLASS_LABELS, NB_CORES=1,**kwargs):
classifier = RandomForestClassifier(n_estimators=num_estimators, max_depth=maxDepth, n_jobs=NB_CORES)
classifier.fit(DATASET, CLASS_LABELS)
return classifier
def getConfig(config):
return "Jambon"
\ No newline at end of file
......@@ -14,6 +14,73 @@ def execute(kFoldClassifier, kFoldPredictedTrainLabels, kFoldPredictedTestLabels
DATASET, initKWARGS, LEARNING_RATE, LABELS_DICTIONARY, views, NB_CORES, times, kFolds, name, nbFolds,
validationIndices):
CLASS_LABELS = DATASET["/Labels/labelsArray"][...]
#NB_ITER, classifierNames, classifierConfigs = initKWARGS.values()
monoviewClassifiersNames, fusionMethodConfig, fusionMethod, fusionType, monoviewClassifiersConfigs = initKWARGS.values()
DATASET_LENGTH = DATASET.get("datasetLength").value-len(validationIndices)
NB_CLASS = DATASET.get("nbClass").value
kFoldPredictedTrainLabelsByIter = []
kFoldPredictedTestLabelsByIter = []
kFoldPredictedValidationLabelsByIter = []
kFoldBestClassifiers = []
kFoldGeneralAlphas = []
kFoldBestViews = []
kFoldAccuracyOnTrain = []
kFoldAccuracyOnTest = []
kFoldAccuracyOnValidation = []
kFoldAccuracyOnTrainByIter = []
kFoldAccuracyOnTestByIter = []
kFoldAccuracyOnValidationByIter = []
for foldIdx, fold in enumerate(kFolds):
if fold != range(DATASET_LENGTH):
trainIndices = [index for index in range(DATASET_LENGTH) if index not in fold]
testLabels = CLASS_LABELS[fold]
trainLabels = CLASS_LABELS[trainIndices]
validationLabels = CLASS_LABELS[validationIndices]
kFoldAccuracyOnTrain.append(100 * accuracy_score(trainLabels, kFoldPredictedTrainLabels[foldIdx]))
kFoldAccuracyOnTest.append(100 * accuracy_score(testLabels, kFoldPredictedTestLabels[foldIdx]))
kFoldAccuracyOnValidation.append(100 * accuracy_score(validationLabels,
kFoldPredictedValidationLabels[foldIdx]))
fusionClassifier = kFoldClassifier[0]
fusionConfiguration = fusionClassifier.classifier.getConfig(fusionMethodConfig,
monoviewClassifiersNames, monoviewClassifiersConfigs)
totalAccuracyOnTrain = np.mean(kFoldAccuracyOnTrain)
totalAccuracyOnTest = np.mean(kFoldAccuracyOnTest)
totalAccuracyOnValidation = np.mean(kFoldAccuracyOnValidation)
extractionTime, kFoldLearningTime, kFoldPredictionTime, classificationTime = times
stringAnalysis = "\t\tResult for Multiview classification with "+ fusionType + \
"\n\nAverage accuracy :\n\t-On Train : " + str(totalAccuracyOnTrain) + "\n\t-On Test : " + \
str(totalAccuracyOnTest) + "\n\t-On Validation : " + str(totalAccuracyOnValidation) + \
"\n\nDataset info :\n\t-Database name : " + name + "\n\t-Labels : " + \
', '.join(LABELS_DICTIONARY.values()) + "\n\t-Views : " + ', '.join(views) + "\n\t-" + str(nbFolds) + \
" folds\n\nClassification configuration : \n\t-Algorithm used : "+fusionType+" "+fusionConfiguration
stringAnalysis += "\n\nComputation time on " + str(NB_CORES) + " cores : \n\tDatabase extraction time : " + str(
hms(seconds=int(extractionTime))) + "\n\t"
row_format = "{:>15}" * 3
stringAnalysis += row_format.format("", *['Learn', 'Prediction'])
for index, (learningTime, predictionTime) in enumerate(zip(kFoldLearningTime, kFoldPredictionTime)):
stringAnalysis += '\n\t'
stringAnalysis += row_format.format("Fold " + str(index + 1), *[str(hms(seconds=int(learningTime))),
str(hms(seconds=int(predictionTime)))])
stringAnalysis += '\n\t'
stringAnalysis += row_format.format("Total", *[str(hms(seconds=int(sum(kFoldLearningTime)))),
str(hms(seconds=int(sum(kFoldPredictionTime))))])
stringAnalysis += "\n\tSo a total classification time of " + str(hms(seconds=int(classificationTime))) + ".\n\n"
imagesAnalysis = {}
# trainingSetLength = len(trainLabels)
# testingSetLength = len(testLabels)
# DATASET_LENGTH = trainingSetLength+testingSetLength
......@@ -52,8 +119,6 @@ def execute(kFoldClassifier, kFoldPredictedTrainLabels, kFoldPredictedTestLabels
# views[int(bestViews[iterIndex])]+"\n"
#
# name, image = plotAccuracyByIter(predictedTrainLabelsByIter, predictedTestLabelsByIter, trainLabels, testLabels, NB_ITER)
stringAnalysis = "poulet"
imagesAnalysis = {}
# imagesAnalysis[name] = image
return stringAnalysis, imagesAnalysis
......@@ -75,10 +75,10 @@ def error(testLabels, computedLabels):
def execute(kFoldClassifier, kFoldPredictedTrainLabels, kFoldPredictedTestLabels, kFoldPredictedValidationLabels,
DATASET, fitKWARGS, LEARNING_RATE, LABELS_DICTIONARY, views, NB_CORES, times, kFolds, databaseName,
DATASET, initKWARGS, LEARNING_RATE, LABELS_DICTIONARY, views, NB_CORES, times, kFolds, databaseName,
nbFolds, validationIndices):
CLASS_LABELS = DATASET["/Labels/labelsArray"][...]
NB_ITER, classifierNames, classifierConfigs = fitKWARGS.values()
NB_ITER, classifierNames, classifierConfigs = initKWARGS.values()
DATASET_LENGTH = DATASET.get("datasetLength").value-len(validationIndices)
NB_CLASS = DATASET.get("nbClass").value
......
2016-08-18 11:13:12,113 INFO: ### Main Programm for Multiview Classification
2016-08-18 11:13:12,113 INFO: ### Classification - Database : MultiOmic ; Views : Methyl, MiRNA, RNASEQ, Clinical ; Algorithm : Fusion ; Cores : 4
2016-08-18 11:13:12,113 INFO: Start: Read HDF5 Database Files for MultiOmic
2016-08-18 11:13:12,139 INFO: Info: Labels used: No, Yes
2016-08-18 11:13:12,139 INFO: Info: Length of dataset:347
2016-08-18 11:13:12,141 INFO: Info: Shape of Methyl :[ 347 25978]
2016-08-18 11:13:12,142 INFO: Info: Shape of MiRNA_ :[ 347 1046]
2016-08-18 11:13:12,143 INFO: Info: Shape of RNASeq :[ 347 73599]
2016-08-18 11:13:12,145 INFO: Info: Shape of Clinic :[347 127]
2016-08-18 11:13:12,145 INFO: Done: Read Database Files
2016-08-18 11:13:12,145 INFO: Start: Determine validation split for ratio 0.3
2016-08-18 11:13:12,149 INFO: Done: Determine validation split
2016-08-18 11:13:12,149 INFO: Start: Determine 4 folds
2016-08-18 11:13:12,156 INFO: Info: Length of Learning Sets: 184
2016-08-18 11:13:12,157 INFO: Info: Length of Testing Sets: 60
2016-08-18 11:13:12,157 INFO: Info: Length of Validation Set: 103
2016-08-18 11:13:12,157 INFO: Done: Determine folds
2016-08-18 11:13:12,157 INFO: Start: Learning with Fusion and 4 folds
2016-08-18 11:13:12,157 INFO: Start: Fold number 1
2016-08-18 11:13:12,507 INFO: Start: Classification
2016-08-18 11:13:13,991 INFO: Done: Fold number 1
2016-08-18 11:13:13,991 INFO: Start: Fold number 2
2016-08-18 11:13:14,321 INFO: Start: Classification
2016-08-18 11:13:20,411 INFO: Done: Fold number 2
2016-08-18 11:13:21,300 INFO: Start: Fold number 3
2016-08-18 11:57:24,976 INFO: ### Main Programm for Multiview Classification
2016-08-18 11:57:24,976 INFO: ### Classification - Database : MultiOmic ; Views : Methyl, MiRNA, RNASEQ, Clinical ; Algorithm : Fusion ; Cores : 4
2016-08-18 11:57:24,976 INFO: Start: Read HDF5 Database Files for MultiOmic
2016-08-18 11:57:24,978 INFO: Info: Labels used: No, Yes
2016-08-18 11:57:24,978 INFO: Info: Length of dataset:347
2016-08-18 11:57:24,979 INFO: Info: Shape of Methyl :[ 347 25978]
2016-08-18 11:57:24,980 INFO: Info: Shape of MiRNA_ :[ 347 1046]
2016-08-18 11:57:24,981 INFO: Info: Shape of RNASeq :[ 347 73599]
2016-08-18 11:57:24,982 INFO: Info: Shape of Clinic :[347 127]
2016-08-18 11:57:24,982 INFO: Done: Read Database Files
2016-08-18 11:57:24,982 INFO: Start: Determine validation split for ratio 0.3
2016-08-18 11:57:24,985 INFO: Done: Determine validation split
2016-08-18 11:57:24,985 INFO: Start: Determine 4 folds
2016-08-18 11:57:24,992 INFO: Info: Length of Learning Sets: 184
2016-08-18 11:57:24,992 INFO: Info: Length of Testing Sets: 60
2016-08-18 11:57:24,992 INFO: Info: Length of Validation Set: 103
2016-08-18 11:57:24,993 INFO: Done: Determine folds
2016-08-18 11:57:24,993 INFO: Start: Learning with Fusion and 4 folds
2016-08-18 11:57:24,993 INFO: Start: Fold number 1
2016-08-18 11:57:25,337 INFO: Start: Classification
2016-08-18 11:57:26,062 INFO: Done: Fold number 1
2016-08-18 11:57:26,063 INFO: Start: Fold number 2
2016-08-18 11:57:26,395 INFO: Start: Classification
2016-08-18 11:57:27,100 INFO: Done: Fold number 2
2016-08-18 11:57:27,101 INFO: Start: Fold number 3
2016-08-18 11:57:27,433 INFO: Start: Classification
2016-08-18 11:57:28,128 INFO: Done: Fold number 3
2016-08-18 11:57:28,128 INFO: Start: Fold number 4
2016-08-18 11:57:28,456 INFO: Start: Classification
2016-08-18 11:57:29,149 INFO: Done: Fold number 4
2016-08-18 11:57:29,149 INFO: Done: Classification
2016-08-18 11:57:29,149 INFO: Info: Time for Classification: 4[s]
2016-08-18 11:57:29,150 INFO: Start: Result Analysis for Fusion
2016-08-18 11:57:29,154 INFO: Result for Multiview classification with EarlyFusion
Average accuracy :
-On Train : 94.6933497537
-On Test : 83.3333333333
-On Validation : 91.5048543689
Dataset info :
-Database name : MultiOmic
-Labels : No, Yes
-Views : Methyl, MiRNA_, RNASeq, Clinic
-4 folds
Classification configuration :
-Algorithm used : EarlyFusion pouletJambon
Computation time on 4 cores :
Database extraction time : 0:00:00
Learn Prediction
Fold 1 0:00:00 0:00:00
Fold 2 0:00:01 0:00:00
Fold 3 0:00:02 0:00:00
Fold 4 0:00:03 0:00:00
Total 0:00:07 0:00:02
So a total classification time of 0:00:04.
2016-08-18 11:57:29,171 INFO: Done: Result Analysis
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment