48 #ifndef __KMEANS_TYPES_H__ 49 #define __KMEANS_TYPES_H__ 51 #include "algorithms/algorithm.h" 52 #include "data_management/data/numeric_table.h" 53 #include "data_management/data/homogen_numeric_table.h" 54 #include "services/daal_defines.h" 87 lastDistanceType = euclidean
98 lastInputId = inputCentroids
108 lastMasterInputId = partialResults
119 partialObjectiveFunction,
120 partialGoalFunction = partialObjectiveFunction,
122 partialCandidatesDistances,
123 partialCandidatesCentroids,
124 lastPartialResultId = partialCandidatesCentroids
136 goalFunction = objectiveFunction,
138 lastResultId = nIterations
155 struct DAAL_EXPORT Parameter :
public daal::algorithms::Parameter
162 Parameter(
size_t _nClusters,
size_t _maxIterations);
168 Parameter(
const Parameter &other);
171 size_t maxIterations;
172 double accuracyThreshold;
174 DistanceType distanceType;
177 services::Status check() const DAAL_C11_OVERRIDE;
185 class DAAL_EXPORT InputIface : public daal::algorithms::Input
188 InputIface(
size_t nElements) : daal::algorithms::Input(nElements) {};
190 virtual size_t getNumberOfFeatures()
const = 0;
197 class DAAL_EXPORT Input :
public InputIface
208 data_management::NumericTablePtr
get(InputId id)
const;
215 void set(InputId id,
const data_management::NumericTablePtr &ptr);
222 size_t getNumberOfFeatures()
const DAAL_C11_OVERRIDE;
229 services::Status check(
const daal::algorithms::Parameter *par,
int method)
const DAAL_C11_OVERRIDE;
236 class DAAL_EXPORT PartialResult :
public daal::algorithms::PartialResult
239 DECLARE_SERIALIZABLE_CAST(PartialResult);
242 virtual ~PartialResult() {};
250 template <
typename algorithmFPType>
251 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
258 data_management::NumericTablePtr
get(PartialResultId id)
const;
265 void set(PartialResultId id,
const data_management::NumericTablePtr &ptr);
272 size_t getNumberOfFeatures()
const;
280 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *par,
int method)
const DAAL_C11_OVERRIDE;
287 services::Status check(
const daal::algorithms::Parameter *par,
int method)
const DAAL_C11_OVERRIDE;
291 template<
typename Archive,
bool onDeserialize>
292 services::Status serialImpl(Archive *arch)
294 return daal::algorithms::PartialResult::serialImpl<Archive, onDeserialize>(arch);
297 typedef services::SharedPtr<PartialResult> PartialResultPtr;
303 class DAAL_EXPORT Result :
public daal::algorithms::Result
306 DECLARE_SERIALIZABLE_CAST(Result);
309 virtual ~Result() {};
317 template <
typename algorithmFPType>
318 DAAL_EXPORT services::Status allocate(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *parameter,
const int method);
326 template <
typename algorithmFPType>
327 DAAL_EXPORT services::Status allocate(
const daal::algorithms::PartialResult *partialResult,
const daal::algorithms::Parameter *parameter,
const int method);
334 data_management::NumericTablePtr
get(ResultId id)
const;
341 void set(ResultId id,
const data_management::NumericTablePtr &ptr);
349 services::Status check(
const daal::algorithms::Input *input,
const daal::algorithms::Parameter *par,
int method)
const DAAL_C11_OVERRIDE;
357 services::Status check(
const daal::algorithms::PartialResult *pres,
const daal::algorithms::Parameter *par,
int method)
const DAAL_C11_OVERRIDE;
361 template<
typename Archive,
bool onDeserialize>
362 services::Status serialImpl(Archive *arch)
364 return daal::algorithms::Result::serialImpl<Archive, onDeserialize>(arch);
367 typedef services::SharedPtr<Result> ResultPtr;
373 class DAAL_EXPORT DistributedStep2MasterInput :
public InputIface
376 DistributedStep2MasterInput();
378 virtual ~DistributedStep2MasterInput() {}
385 data_management::DataCollectionPtr
get(MasterInputId id)
const;
392 void set(MasterInputId id,
const data_management::DataCollectionPtr &ptr);
400 void add(MasterInputId
id,
const PartialResultPtr &value);
407 size_t getNumberOfFeatures()
const DAAL_C11_OVERRIDE;
414 services::Status check(
const daal::algorithms::Parameter *par,
int method)
const DAAL_C11_OVERRIDE;
417 using interface1::Parameter;
418 using interface1::InputIface;
419 using interface1::Input;
420 using interface1::PartialResult;
421 using interface1::PartialResultPtr;
422 using interface1::Result;
423 using interface1::ResultPtr;
424 using interface1::DistributedStep2MasterInput;
daal::algorithms::kmeans::interface1::Parameter
Parameters for the K-Means algorithm.
Definition: kmeans_types.h:155
daal::algorithms::kmeans::partialObjectiveFunction
Definition: kmeans_types.h:119
daal::algorithms::kmeans::interface1::Result
Results obtained with the compute() method of the K-Means algorithm in the batch processing mode...
Definition: kmeans_types.h:303
daal::services::interface1::Status
Class that holds the results of API calls. In case of API routine failure it contains the list of err...
Definition: error_handling.h:491
daal
Definition: algorithm_base_common.h:57
daal::algorithms::kmeans::partialCandidatesDistances
Definition: kmeans_types.h:122
daal::algorithms::interface1::Result
Base class to represent final results of the computation. Algorithm-specific final results are repres...
Definition: algorithm_types.h:331
daal::algorithms::kmeans::interface1::Parameter::assignFlag
bool assignFlag
Definition: kmeans_types.h:175
daal::algorithms::kmeans::interface1::PartialResult
Partial results obtained with the compute() method of the K-Means algorithm in the batch processing m...
Definition: kmeans_types.h:236
daal::algorithms::kmeans::partialCandidatesCentroids
Definition: kmeans_types.h:123
daal::algorithms::kmeans::lloydCSR
Definition: kmeans_types.h:77
daal::algorithms::kmeans::partialAssignments
Definition: kmeans_types.h:121
daal::algorithms::kmeans::data
Definition: kmeans_types.h:96
daal::algorithms::kmeans::interface1::Parameter::accuracyThreshold
double accuracyThreshold
Definition: kmeans_types.h:172
daal::algorithms::kmeans::lloydDense
Definition: kmeans_types.h:75
daal::algorithms::interface1::PartialResult
Base class to represent partial results of the computation. Algorithm-specific partial results are re...
Definition: algorithm_types.h:253
daal::algorithms::kmeans::interface1::Parameter::nClusters
size_t nClusters
Definition: kmeans_types.h:170
daal::algorithms::kmeans::interface1::Parameter::gamma
double gamma
Definition: kmeans_types.h:173
daal::algorithms::kmeans::euclidean
Definition: kmeans_types.h:86
daal::algorithms::kmeans::goalFunction
Definition: kmeans_types.h:136
daal::algorithms::kmeans::nIterations
Definition: kmeans_types.h:137
daal::algorithms::kmeans::centroids
Definition: kmeans_types.h:133
daal::algorithms::kmeans::partialSums
Definition: kmeans_types.h:118
daal::algorithms::kmeans::objectiveFunction
Definition: kmeans_types.h:135
daal::algorithms::interface1::Parameter
Base class to represent computation parameters. Algorithm-specific parameters are represented as deri...
Definition: algorithm_types.h:86
daal::services::interface1::SharedPtr
Shared pointer that retains shared ownership of an object through a pointer. Several SharedPtr object...
Definition: daal_shared_ptr.h:187
daal::algorithms::kmeans::assignments
Definition: kmeans_types.h:134
daal::algorithms::kmeans::inputCentroids
Definition: kmeans_types.h:97
daal::algorithms::kmeans::partialResults
Definition: kmeans_types.h:107
daal::algorithms::kmeans::PartialResultId
PartialResultId
Available identifiers of partial results of the K-Means algorithm in the distributed processing mode...
Definition: kmeans_types.h:115
daal::algorithms::kmeans::interface1::Parameter::maxIterations
size_t maxIterations
Definition: kmeans_types.h:171
daal::algorithms::kmeans::defaultDense
Definition: kmeans_types.h:76
daal::algorithms::math::abs::value
Definition: abs_types.h:112
daal::algorithms::kmeans::ResultId
ResultId
Available identifiers of results of the K-Means algorithm.
Definition: kmeans_types.h:131
daal::algorithms::kmeans::partialGoalFunction
Definition: kmeans_types.h:120
daal::algorithms::kmeans::MasterInputId
MasterInputId
Available identifiers of input objects for the K-Means algorithm in the distributed processing mode...
Definition: kmeans_types.h:105
daal::algorithms::kmeans::DistanceType
DistanceType
Definition: kmeans_types.h:84
daal::algorithms::kmeans::Method
Method
Definition: kmeans_types.h:73
daal::algorithms::kmeans::nObservations
Definition: kmeans_types.h:117
daal::algorithms::kmeans::InputId
InputId
Available identifiers of input objects for the K-Means algorithm.
Definition: kmeans_types.h:94
daal::algorithms::kmeans::interface1::Parameter::distanceType
DistanceType distanceType
Definition: kmeans_types.h:174