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
c88bfed3
Commit
c88bfed3
authored
9 years ago
by
Baptiste Bauvin
Browse files
Options
Downloads
Patches
Plain Diff
added some doc
parent
e9302ec4
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Raw Code/Fusion/LateFusion.py
+5
-3
5 additions, 3 deletions
Raw Code/Fusion/LateFusion.py
with
5 additions
and
3 deletions
Raw Code/Fusion/LateFusion.py
+
5
−
3
View file @
c88bfed3
...
...
@@ -38,7 +38,6 @@ def SVMForLinearFusionTrain(monoViewDecisions, labels):
SVMClassifier
.
fit
(
monoViewDecisions
,
labels
)
return
SVMClassifier
def
SVMForLinearFusionFuse
(
monoViewDecisions
,
SVMClassifier
):
labels
=
SVMClassifier
.
predict
(
monoViewDecisions
)
return
labels
...
...
@@ -74,7 +73,10 @@ def majorityVoting(monoViewDecisions, NB_CLASS):
# For probabilistic classifiers, we need to add more fusion methods
# For probabilistic classifiers, we need to add more late fusion methods
# For example, the bayesian inference
# probabilisticClassifiers is a nbExample array of sklearn probabilistic classifiers
# (such as Naive Bayesian Gaussian http://scikit-learn.org/stable/modules/generated/sklearn.naive_bayes.GaussianNB.html#sklearn.naive_bayes.GaussianNB)
def
bayesianInference
(
probabilisticClassifiers
):
nbFeatures
=
len
(
probabilisticClassifiers
)
classifiersProbasByFeature
=
np
.
array
([
probabilisticClassifier
.
class_prior_
\
...
...
@@ -88,6 +90,7 @@ def weightedProduct(featureProbas, weights):
product
=
np
.
prod
(
weightedProbas
)
return
product
# Main for testing
if
__name__
==
'
__main__
'
:
DATASET_LENGTH
=
10
...
...
@@ -126,4 +129,3 @@ if __name__ == '__main__':
print
SVMForLinearFusionFuse
(
monoViewDecisionsMajority
,
SVMClassifier
)
print
majorityVoting
(
monoViewDecisionsMajority
,
NB_CLASS
)
print
majorityVoting
(
monoViewDecisionsMajorityFail
,
NB_CLASS
)
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