24 #ifndef __NAIVE_BAYES_TRAINING_TYPES_H__
25 #define __NAIVE_BAYES_TRAINING_TYPES_H__
27 #include "algorithms/naive_bayes/multinomial_naive_bayes_model.h"
28 #include "data_management/data/data_collection.h"
29 #include "algorithms/classifier/classifier_training_types.h"
35 namespace multinomial_naive_bayes
62 enum Step2MasterInputId
65 lastStep2MasterInputId = partialModels
80 class DAAL_EXPORT PartialResult :
public classifier::training::PartialResult
83 DECLARE_SERIALIZABLE_CAST(PartialResult);
86 virtual ~PartialResult() {}
93 multinomial_naive_bayes::PartialModelPtr
get(classifier::training::PartialResultId id)
const;
103 template <
typename algorithmFPType>
104 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
114 template <
typename algorithmFPType>
115 DAAL_EXPORT services::Status initialize(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
121 size_t getNumberOfFeatures()
const;
131 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
140 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
144 template<
typename Archive,
bool onDeserialize>
145 services::Status serialImpl(Archive *arch)
147 return classifier::training::PartialResult::serialImpl<Archive, onDeserialize>(arch);
150 services::Status checkImpl(
size_t nFeatures,
const daal::algorithms::Parameter* parameter)
const;
152 typedef services::SharedPtr<PartialResult> PartialResultPtr;
161 class DAAL_EXPORT Result :
public classifier::training::Result
164 DECLARE_SERIALIZABLE_CAST(Result);
173 multinomial_naive_bayes::ModelPtr
get(classifier::training::ResultId id)
const;
183 template <
typename algorithmFPType>
184 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
194 template <
typename algorithmFPType>
195 DAAL_EXPORT services::Status allocate(
const daal::algorithms::PartialResult *partialResult,
const daal::algorithms::Parameter *parameter,
const int method);
205 services::Status check(
const daal::algorithms::PartialResult *partialResult,
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
215 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
219 template<
typename Archive,
bool onDeserialize>
220 services::Status serialImpl(Archive *arch)
222 return classifier::training::Result::serialImpl<Archive, onDeserialize>(arch);
225 services::Status checkImpl(
size_t nFeatures,
const daal::algorithms::Parameter* parameter)
const;
227 typedef services::SharedPtr<Result> ResultPtr;
233 class DAAL_EXPORT DistributedInput :
public classifier::training::InputIface
237 DistributedInput(
const DistributedInput& other) : classifier::training::InputIface(other){}
239 virtual ~DistributedInput() {}
241 virtual size_t getNumberOfFeatures()
const DAAL_C11_OVERRIDE;
248 data_management::DataCollectionPtr
get(Step2MasterInputId id)
const;
255 void add(
const Step2MasterInputId &
id,
const PartialResultPtr &partialResult);
262 void set(Step2MasterInputId
id,
const data_management::DataCollectionPtr &value);
269 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
276 class DAAL_EXPORT Input :
public classifier::training::Input
279 Input(
size_t nElements = classifier::training::lastInputId + 1): classifier::training::Input(nElements)
281 Input(
const Input& other) : classifier::training::Input(other)
291 services::Status check(
const daal::algorithms::Parameter *parameter,
int method)
const DAAL_C11_OVERRIDE;
295 using interface1::DistributedInput;
296 using interface1::Input;
297 using interface1::PartialResult;
298 using interface1::PartialResultPtr;
299 using interface1::Result;
300 using interface1::ResultPtr;
daal::algorithms::multinomial_naive_bayes::training::Method
Method
Definition: multinomial_naive_bayes_training_types.h:52
daal::algorithms::multinomial_naive_bayes::training::partialModels
Definition: multinomial_naive_bayes_training_types.h:64
daal::algorithms::multinomial_naive_bayes::training::interface1::Input
Input objects of the naive Bayes training algorithm in the batch and online processing mode...
Definition: multinomial_naive_bayes_training_types.h:276
daal::algorithms::multinomial_naive_bayes::training::interface1::PartialResult
Provides methods to access partial results obtained with the compute() method of the naive Bayes trai...
Definition: multinomial_naive_bayes_training_types.h:80
daal::algorithms::multinomial_naive_bayes::training::interface1::Result
Provides methods to access final results obtained with the compute() method of the naive Bayes traini...
Definition: multinomial_naive_bayes_training_types.h:161
daal::algorithms::multinomial_naive_bayes::training::Step2MasterInputId
Step2MasterInputId
Definition: multinomial_naive_bayes_training_types.h:62
daal::algorithms::multinomial_naive_bayes::training::defaultDense
Definition: multinomial_naive_bayes_training_types.h:54
daal::algorithms::multinomial_naive_bayes::training::fastCSR
Definition: multinomial_naive_bayes_training_types.h:55
daal::algorithms::classifier::training::PartialResultId
PartialResultId
Definition: classifier_training_types.h:72
daal::algorithms::math::abs::value
Definition: abs_types.h:88
daal::algorithms::multinomial_naive_bayes::training::interface1::DistributedInput
Input objects of the naive Bayes training algorithm in the distributed processing mode...
Definition: multinomial_naive_bayes_training_types.h:233
daal::algorithms::classifier::training::ResultId
ResultId
Definition: classifier_training_types.h:82