mxnet
Public Member Functions | Public Attributes | List of all members
dmlc::Row< IndexType, DType > Class Template Reference

one row of training instance More...

#include <data.h>

Collaboration diagram for dmlc::Row< IndexType, DType >:
Collaboration graph

Public Member Functions

IndexType get_field (size_t i) const
 
IndexType get_index (size_t i) const
 
DType get_value (size_t i) const
 
DType get_label () const
 
real_t get_weight () const
 
uint64_t get_qid () const
 
template<typename V >
SDot (const V *weight, size_t size) const
 helper function to compute dot product of current More...
 

Public Attributes

const DType * label
 label of the instance More...
 
const real_tweight
 weight of the instance More...
 
const uint64_t * qid
 session-id of the instance More...
 
size_t length
 length of the sparse vector More...
 
const IndexType * field
 field of each instance More...
 
const IndexType * index
 index of each instance More...
 
const DType * value
 array value of each instance, this can be NULL indicating every value is set to be 1 More...
 

Detailed Description

template<typename IndexType, typename DType = real_t>
class dmlc::Row< IndexType, DType >

one row of training instance

Template Parameters
IndexTypetype of index
DTypetype of data (both label and value will be of DType

Member Function Documentation

template<typename IndexType, typename DType = real_t>
IndexType dmlc::Row< IndexType, DType >::get_field ( size_t  i) const
inline
Parameters
ithe input index
Returns
field for i-th feature
template<typename IndexType, typename DType = real_t>
IndexType dmlc::Row< IndexType, DType >::get_index ( size_t  i) const
inline
Parameters
ithe input index
Returns
i-th feature
template<typename IndexType, typename DType = real_t>
DType dmlc::Row< IndexType, DType >::get_label ( ) const
inline
Returns
the label of the instance
template<typename IndexType, typename DType = real_t>
uint64_t dmlc::Row< IndexType, DType >::get_qid ( ) const
inline
Returns
the qid of the instance, this function is always safe even when qid == NULL
template<typename IndexType, typename DType = real_t>
DType dmlc::Row< IndexType, DType >::get_value ( size_t  i) const
inline
Parameters
ithe input index
Returns
i-th feature value, this function is always safe even when value == NULL
template<typename IndexType, typename DType = real_t>
real_t dmlc::Row< IndexType, DType >::get_weight ( ) const
inline
Returns
the weight of the instance, this function is always safe even when weight == NULL
template<typename IndexType, typename DType = real_t>
template<typename V >
V dmlc::Row< IndexType, DType >::SDot ( const V *  weight,
size_t  size 
) const
inline

helper function to compute dot product of current

Parameters
weightthe dense array of weight we want to product
sizethe size of the weight vector
Template Parameters
Vtype of the weight vector
Returns
the result of dot product

Member Data Documentation

template<typename IndexType, typename DType = real_t>
const IndexType* dmlc::Row< IndexType, DType >::field

field of each instance

template<typename IndexType, typename DType = real_t>
const IndexType* dmlc::Row< IndexType, DType >::index

index of each instance

template<typename IndexType, typename DType = real_t>
const DType* dmlc::Row< IndexType, DType >::label

label of the instance

template<typename IndexType, typename DType = real_t>
size_t dmlc::Row< IndexType, DType >::length

length of the sparse vector

template<typename IndexType, typename DType = real_t>
const uint64_t* dmlc::Row< IndexType, DType >::qid

session-id of the instance

template<typename IndexType, typename DType = real_t>
const DType* dmlc::Row< IndexType, DType >::value

array value of each instance, this can be NULL indicating every value is set to be 1

template<typename IndexType, typename DType = real_t>
const real_t* dmlc::Row< IndexType, DType >::weight

weight of the instance


The documentation for this class was generated from the following file: