API Changes Introduced in Intel® DAAL 2018 Beta

Published: 03/27/2017  

Last Updated: 06/20/2017

A series of API changes are introduced into Intel® DAAL to improve usability, error handling, and consistency. These changes will start to take effective in Intel DAAL 2018 Beta. The changes discussed below are centered on the C++ API, but similar changes also apply to the Java API and the Python API.

Renaming, addition, and removal of enums

API Before After
Error handling
  • Algorithmic classes
    • void compute()
  • Input argument classes
    • void check(...)
  • Result and Partial Result classes
    • void check(...)
    • void allocate(…)
  • Algorithmic classes
    • Status compute()
  • Input argument classes
    • Status check(...)
  • Result and Partial Result classes
    • Status check(...)
    • Status allocate(…)
class Environment
  • static int freeInstance();
  • Method is deprecated
Alternating Least Square initialization
  • One step initialization
  • Two-step initialization to eliminate the need in complex data preparation such as matrix transposing on the user’s side

Alternating Least Square renamings

  • enum Step3LocalCollectionInputId
    • partialModelBlocksToNode
  • Enum Step3LocalCollectionInputId
    • inputOfStep3FromInit
kNN algorithm
  • kdtree_knn_classification_types.h
  • File is removed
k-means initialization in distributed computing mode
  • enum PartialResultId
    • partialClusters
    • partialClustersNumber
  • enum PartialResultId
    • partialCentroids
    • partialClustersNumber is deprecated
K-means namings
  • enum PartialResultId
    • partialGoalFunction
  • enum ResultId
    • goalFunction
  • enum PartialResultId
    • partialObjectiveFunction
  • enum ResultId
    • objectiveFunction
Multi-class classfier Model
  • getTwoClassClassifierModels()
  • Method is deprecated as unsafe
Neural Network training parameter
  • Class Parameter contains batchSize and optimization solver
  • Class Parameter contains optimization solver
  • batchSize is read from parameter of optimization solver
NumericTable
  • void setDictionary( NumericTableDictionary *ddict );
  • virtual void setDictionary( NumericTableDictionary *ddict );
  • virtual void resetDictionary()
  • virtual void setNumberOfColumns(size_t ncol)
  • virtual void setNumberOfRows(size_t nrow)
  • virtual void allocateDataMemory(daal::MemType type = daal::dram)
  • freeDataMemory();
  • All the methods are deprecated
  • One dictionary is associated with NumericTable for the whole life cycle of the respective object; number of attributes can’t be changed
  • Memory allocation by the library is done on the stage of object construction only.
  • Memory deallocation by the library is done on the stage of destruction
NumericTable  
  • resize( nrows ) the method to modify number of feature vectors in the table, involves memory allocation, if necessary. If the memory was allocated by the user, resize() will “forget” about it and allocate another memory
HomogenNumericTable
  • setArray( DataType* const ptr)
  • The method is deprecated as memory management is done at the stage of object construction
AOS Numeric Table
  • void setFeature(size_t idx, size_t offset)
  • void setFeature(size_t idx, size_t offset, data_feature_utils::FeatureType featureType = data_feature_utils::DAAL_CONTINUOUS, size_t categoryNumber=0) Extended API of method to support all types of atteibutes
SOA Numeric Table
  • SOANumericTable( size_t nColumns = 0, size_t nRows = 0 )
  • SOANumericTable( size_t nColumns = 0, size_t nRows = 0, DictionaryIface::FeaturesEqual featuresEqual = DictionaryIface::notEqual ) Manages the case when attributes are equal for further optimizations
Data Dictionary  
  • void setAllFeatures() Add service method to configure the attributes of the datasets to the same type
NumericTable
  • getNumberOfCategories(size_t feature_idx) returns (size_t)-1 when all attribute is continuous, and 2, otheriwse 
  • Range of values returned by the method is extended to support different types of attributes
NumericTable
  • enum AllocationFlag
    • notAllocate
  • enum AllocationFlag
    • doNotAllocate
Tensor
  • enum AllocationFlag
    • notAllocate
  • enum AllocationFlag
    • doNotAllocate
class NumericTableIface
  • enum NormalizationType
    • nonNormalized
    • standardScoreNormalized
  • enum NormalizationType
    • nonNormalized
    • standardScoreNormalized
    • minMaxNormalized
HomogenTensor
  • getSampleTensor(size_t firstDimIndex)
  • Method is deprecated
Algorithms and numeric tables
  • Default type is double
  • Default type is float
Multinomial Naïve Bayes algorithm
  • multinomial_naive_bayes_types.h
  • File is removed
Linear regression algorithm
  • linear_regression_types.h
  • File is removed
Ridge regression algorithm
  • ridge_regression_types.h
  • File is removed
Multi-class classifieralgorithm
  • multi_class_classifier_types
  • File is removed
Neural Networks Topology for training and prediction
  • addNext(layerId1, layerId2);
  • Deprecated
  • Use combination of the available methods for topology object x
  • x.get(layerId1)->addNext(layerId2);
Default data type for algorithms, numeric tables, and data sources 
  • template<typename algorithmFPType = double, Method method = defaultDense>
  • template<typename DataType = double>

class DAAL_EXPORT HomogenNumericTable : public NumericTable

  • template< typename _numericTableType, typename _summaryStatisticsType = double>

class DataSourceTemplate : public DataSource

  • template<typename algorithmFPType = DAAL_ALGORITHM_FP_TYPE, Method method = defaultDense>

DAAL_ALGORITHM_FP_TYPE is float by default

  • template<typename DataType = DAAL_DATA_TYPE>

class DAAL_EXPORT HomogenNumericTable : public NumericTable

DAAL_DATA_TYPE is float by default

  • template< typename _numericTableType, typename _summaryStatisticsType = DAAL_SUMMARY_STATISTICS_TYPE >

class DataSourceTemplate : public DataSource

DAAL_SUMMARY_STATISTICS_TYPE is float by default

Multivariate  Outlier Detection
  • namespace multivariate_outlier_detection        

         {

         enum Method

         {

             defaultDense,

             baconDense

         };

         template<.., Method method = defaultDense>class Batch{};

         }

  • namespace multivariate_outlier_detection

        {

        enum Method

        {

           defaultDense,

        ;

        template<..., Method method = defaultDense>class Batch{};

        }

  • namespace bacon_outlier_detection

        {

        enum Method

        {

            defaultDense,

        ;

        template<..., Method method = defaultDense>class Batch{};

        }

Univariate and

Multivariate  Outlier Detection

  • enum InputId
    • data = 0
  • struct Parameter
    • initializationProcedure
  • enum InputId
    • data = 0
    • location
    • scatter
    • threshold
  • Parameter structure is deprecated
Initialization of outlier parameters is done on the user’s side and the parameters are provided as inputs. If at least one of parameters is not provided the algorithm will use default values for them
Linear and Ridge Regression, prediction stage

class Batch : public daal::algorithms::Prediction

{

public:

    Parameter parameter;

};

class Batch : public

daal::algorithms::Prediction

{

public:

…  

};

Member Parameter is deprecated

 

Methods deprecation 

Classes Methods deprecated
Environment freeInstance
Multi-class classifier Model getTwoClassClassifierModels
NumericTable setDictionary, resetDictionary, setNumberOfColumns, setNumberOfRows, allocateDataMemory, freeDataMemory
HomogenNumericTable setArray
HomogenTensor getSampleTensor

 

 

 

 

 

 

 

Method signatures change

Classes Before After
All algorithmic classes void compute( ) Status compute( )
All input argument classes void check( ... ) Status check( ... )
All result and partial result classes

void check( ... )

void allocate( .. )

Status check( ... )

Status allocate( ... )

AOSNumericTable void setFeature( size_t idx, size_t offset ) vid setFeature( size_t idx, size_t offset, data_feature_utils::FeatureType featureType = data_feature_utils::DAAL_CONTINUOUS, size_t categoryNumber=0 )
SOANumericTable SOANumericTable( size_t nColumns = 0, size_t nRows = 0 ) SOANumericTable( size_t nColumns = 0, size_t nRows = 0, DictionaryIface::FeaturesEqual featuresEqual = DictionaryIface::notEqual )
NumericTable The return value of getNumberOfCategories( size_t feature_idx ) was either (size_t) - 1 when all attributes are continuous, or 1 otherwise. The return value of this method is now extended to support different types of attributes.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

New methods

Classes New methods
NumericTable void resize( size_t nrows ) - To modify the number of feature vectors in a table.
DataDictionary void setAllFeatures( ... ) - To configure the attributes of the datasets to be the same type.

 

 

 

 

 

 

Other changes

  • Alternating Least Square (ALS) algorithm initialization has been changed from one-step initialization to two-step initialization, to make data preparation easier. For example, users don't have to take matrix transpose on themselves.
  • The Parameter class of the Neural Network training algorithm no longer contains 'batchSize'. The 'batchSize' is now obtained from the corresponding parameter of a optimization solver.  
  • The header file kdtree_knn_classification_types.h is removed.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.