summaryrefslogtreecommitdiff
path: root/chromium/media/learning/impl/voting_ensemble.h
blob: 0994e58a1c0bfb5fa63f627562cde207e7e1c7f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef MEDIA_LEARNING_IMPL_VOTING_ENSEMBLE_H_
#define MEDIA_LEARNING_IMPL_VOTING_ENSEMBLE_H_

#include <memory>
#include <vector>

#include "base/component_export.h"
#include "base/macros.h"
#include "media/learning/impl/model.h"

namespace media {
namespace learning {

// Ensemble classifier.  Takes multiple models and returns an aggregate of the
// individual predictions.
class COMPONENT_EXPORT(LEARNING_IMPL) VotingEnsemble : public Model {
 public:
  VotingEnsemble(std::vector<std::unique_ptr<Model>> models);

  VotingEnsemble(const VotingEnsemble&) = delete;
  VotingEnsemble& operator=(const VotingEnsemble&) = delete;

  ~VotingEnsemble() override;

  // Model
  TargetHistogram PredictDistribution(const FeatureVector& instance) override;

 private:
  std::vector<std::unique_ptr<Model>> models_;
};

}  // namespace learning
}  // namespace media

#endif  // MEDIA_LEARNING_IMPL_VOTING_ENSEMBLE_H_