Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Supervised MultiModal Integration Tool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Baptiste Bauvin
Supervised MultiModal Integration Tool
Commits
15d28e55
Commit
15d28e55
authored
7 years ago
by
bbauvin
Browse files
Options
Downloads
Patches
Plain Diff
Modified Monoview result savig to save the labels and still be understandable
parent
f4370630
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/MonoMutliViewClassifiers/ExecClassif.py
+1
-1
1 addition, 1 deletion
Code/MonoMutliViewClassifiers/ExecClassif.py
Code/MonoMutliViewClassifiers/Monoview/ExecClassifMonoView.py
+14
-4
14 additions, 4 deletions
.../MonoMutliViewClassifiers/Monoview/ExecClassifMonoView.py
with
15 additions
and
5 deletions
Code/MonoMutliViewClassifiers/ExecClassif.py
+
1
−
1
View file @
15d28e55
...
@@ -432,7 +432,7 @@ trainIndices, testIndices, a, aa = sklearn.model_selection.train_test_split(indi
...
@@ -432,7 +432,7 @@ trainIndices, testIndices, a, aa = sklearn.model_selection.train_test_split(indi
random_state
=
randomState
)
random_state
=
randomState
)
classificationIndices
=
(
trainIndices
,
testIndices
)
classificationIndices
=
(
trainIndices
,
testIndices
)
kFolds
=
sklearn
.
model_selection
.
KFold
(
n_splits
=
args
.
CL_nbFolds
,
random_state
=
randomState
)
kFolds
=
sklearn
.
model_selection
.
KFold
(
n_splits
=
args
.
CL_nbFolds
,
random_state
=
randomState
)
kFoldsIndices
=
kFolds
.
split
(
trainIndices
)
#
kFoldsIndices = kFolds.split(trainIndices)
datasetFiles
=
initMultipleDatasets
(
args
,
nbCores
)
datasetFiles
=
initMultipleDatasets
(
args
,
nbCores
)
...
...
This diff is collapsed.
Click to expand it.
Code/MonoMutliViewClassifiers/Monoview/ExecClassifMonoView.py
+
14
−
4
View file @
15d28e55
...
@@ -8,6 +8,7 @@ import datetime # for TimeStamp in CSVFile
...
@@ -8,6 +8,7 @@ import datetime # for TimeStamp in CSVFile
import
os
# to geth path of the running script
import
os
# to geth path of the running script
import
time
# for time calculations
import
time
# for time calculations
import
operator
import
operator
import
errno
# Import 3rd party modules
# Import 3rd party modules
import
numpy
as
np
# for reading CSV-files and Series
import
numpy
as
np
# for reading CSV-files and Series
...
@@ -121,12 +122,21 @@ def ExecMonoview(directory, X, Y, name, labelsNames, classificationIndices, KFol
...
@@ -121,12 +122,21 @@ def ExecMonoview(directory, X, Y, name, labelsNames, classificationIndices, KFol
labelsString
=
"
-
"
.
join
(
labelsNames
)
labelsString
=
"
-
"
.
join
(
labelsNames
)
timestr
=
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
timestr
=
time
.
strftime
(
"
%Y%m%d-%H%M%S
"
)
CL_type_string
=
CL_type
CL_type_string
=
CL_type
outputFileName
=
directory
+
timestr
+
"
Results-
"
+
CL_type_string
+
"
-
"
+
labelsString
+
\
outputFileName
=
directory
+
"
/
"
+
CL_type_string
+
"
/
"
+
"
/
"
+
feat
+
"
/
"
+
timestr
+
"
Results-
"
+
CL_type_string
+
"
-
"
+
labelsString
+
\
'
-learnRate
'
+
str
(
len
(
classificationIndices
))
+
'
-
'
+
name
+
"
-
"
+
feat
'
-learnRate
'
+
str
(
len
(
classificationIndices
))
+
'
-
'
+
name
+
"
-
"
+
feat
+
"
-
"
if
not
os
.
path
.
exists
(
os
.
path
.
dirname
(
outputFileName
)):
try
:
os
.
makedirs
(
os
.
path
.
dirname
(
outputFileName
))
except
OSError
as
exc
:
if
exc
.
errno
!=
errno
.
EEXIST
:
raise
outputTextFile
=
open
(
outputFileName
+
'
.txt
'
,
'
w
'
)
outputTextFile
=
open
(
outputFileName
+
'
.txt
'
,
'
w
'
)
outputTextFile
.
write
(
stringAnalysis
)
outputTextFile
.
write
(
stringAnalysis
)
outputTextFile
.
close
()
outputTextFile
.
close
()
np
.
savetxt
(
outputFileName
+
"
full_pred.csv
"
,
full_labels
.
astype
(
np
.
int16
),
delimiter
=
"
,
"
)
np
.
savetxt
(
outputFileName
+
"
train_pred.csv
"
,
y_train_pred
.
astype
(
np
.
int16
),
delimiter
=
"
,
"
)
np
.
savetxt
(
outputFileName
+
"
test_pred.csv
"
,
y_test_pred
.
astype
(
np
.
int16
),
delimiter
=
"
,
"
)
if
imagesAnalysis
is
not
None
:
if
imagesAnalysis
is
not
None
:
for
imageName
in
imagesAnalysis
:
for
imageName
in
imagesAnalysis
:
...
@@ -141,7 +151,7 @@ def ExecMonoview(directory, X, Y, name, labelsNames, classificationIndices, KFol
...
@@ -141,7 +151,7 @@ def ExecMonoview(directory, X, Y, name, labelsNames, classificationIndices, KFol
logging
.
info
(
"
Done:
\t
Result Analysis
"
)
logging
.
info
(
"
Done:
\t
Result Analysis
"
)
viewIndex
=
args
[
"
viewIndex
"
]
viewIndex
=
args
[
"
viewIndex
"
]
return
viewIndex
,
[
CL_type
,
cl_desc
+
[
feat
],
metricsScores
,
full_labels
]
return
viewIndex
,
[
CL_type
,
cl_desc
+
[
feat
],
metricsScores
,
full_labels
,
y_train_pred
]
# # Classification Report with Precision, Recall, F1 , Support
# # Classification Report with Precision, Recall, F1 , Support
# logging.debug("Info:\t Classification report:")
# logging.debug("Info:\t Classification report:")
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment