Cardinality is the logical size of the vector, its number of dimensions. You can only add vectors with the same cardinality -- it's not defined what the result is to add, say, a 2D and 3D vector. So yes this vector needs to have a cardinality equal to number of features, it seems.
On Wed, Jul 18, 2012 at 1:09 PM, Lu arsenal <[email protected]> wrote: > Hi, > > When I try to use bayes in mahout. I'm confused by a property of Vector > , "cardinality". > > My question is when I prepare the input data for bayes, I must set the > Vector size of input data to the number of features? > > Because in WeightsMapper.map() function, > "weightsPerFeature.assign(instance, > Functions.PLUS);" may throws CardinalityException if first vector of > records is not with the same size of later on vectors. > > -- > Luke >
