@Override public int getInputDimensionality() { return VectorUtil.safeGetDimensionality(this.weights); }
@Override public int getInputDimensionality() { return VectorUtil.safeGetDimensionality(this.weights); }
@Override public int getInputDimensionality() { return VectorUtil.safeGetDimensionality(this.weights); }
/** * Gets the expected dimensionality of the input vectors for this distance * metric. * * @return * The expected input dimensionality, if it is known. If the weights * have not been set, it will be -1. */ public int getInputDimensionality() { return VectorUtil.safeGetDimensionality(this.getWeights()); }
/** * Gets the expected dimensionality of the input vectors for this distance * metric. * * @return * The expected input dimensionality, if it is known. If the weights * have not been set, it will be -1. */ public int getInputDimensionality() { return VectorUtil.safeGetDimensionality(this.getWeights()); }
public int getDimensionality() { return VectorUtil.safeGetDimensionality(this.getTermGlobalFrequencies()); }
public int getDimensionality() { return VectorUtil.safeGetDimensionality(this.getTermGlobalFrequencies()); }
/** * Gets the expected dimensionality of the input vectors for this distance * metric. * * @return * The expected input dimensionality, if it is known. If the weights * have not been set, it will be -1. */ public int getInputDimensionality() { return VectorUtil.safeGetDimensionality(this.getWeights()); }
public int getDimensionality() { return VectorUtil.safeGetDimensionality(this.getTermDocumentFrequencies()); }
public int getDimensionality() { return VectorUtil.safeGetDimensionality(this.getTermGlobalFrequencies()); }
public int getDimensionality() { return VectorUtil.safeGetDimensionality(this.getTermGlobalFrequencies()); }
public int getDimensionality() { return VectorUtil.safeGetDimensionality(this.getTermGlobalFrequencies()); }
public int getDimensionality() { return VectorUtil.safeGetDimensionality(this.getTermGlobalFrequencies()); }
public int getDimensionality() { return VectorUtil.safeGetDimensionality(this.getTermDocumentFrequencies()); }
public int getDimensionality() { return VectorUtil.safeGetDimensionality(this.getTermDocumentFrequencies()); }
/** * Gets the dimensionality of the given vector, if it is not null. * Otherwise, -1 is returned. * * @param vector * The vector to get the dimensionality of. * @return * The dimensionality of the given vector, if it is not null. * Otherwise, -1 is returned. */ public static int safeGetDimensionality( final Vectorizable vector) { if (vector == null) { return -1; } else { return safeGetDimensionality(vector.convertToVector()); } }
/** * Gets the dimensionality of the given vector, if it is not null. * Otherwise, -1 is returned. * * @param vector * The vector to get the dimensionality of. * @return * The dimensionality of the given vector, if it is not null. * Otherwise, -1 is returned. */ public static int safeGetDimensionality( final Vectorizable vector) { if (vector == null) { return -1; } else { return safeGetDimensionality(vector.convertToVector()); } }
/** * Gets the dimensionality of the given vector, if it is not null. * Otherwise, -1 is returned. * * @param vector * The vector to get the dimensionality of. * @return * The dimensionality of the given vector, if it is not null. * Otherwise, -1 is returned. */ public static int safeGetDimensionality( final Vectorizable vector) { if (vector == null) { return -1; } else { return safeGetDimensionality(vector.convertToVector()); } }
/** * Creates a new matrix by copying the given set of row vectors. * * @param rows * The row vectors to create a matrix from. Must all be the same * dimensionality. * @return * A new matrix whose rows are equal to the given set of rows. */ public MatrixType copyRowVectors( final Collection<? extends Vectorizable> rows) { // Create the matrix. final int numRows = rows.size(); final int numColumns = VectorUtil.safeGetDimensionality( CollectionUtil.getFirst(rows)); final MatrixType result = this.createMatrix(numRows, numColumns); // Fill in the matrix with the rows. int rowIndex = 0; for (Vectorizable row : rows) { result.setRow(rowIndex, row.convertToVector()); rowIndex++; } return result; }
/** * Creates a new matrix by copying the given set of row vectors. * * @param rows * The row vectors to create a matrix from. Must all be the same * dimensionality. * @return * A new matrix whose rows are equal to the given set of rows. */ public MatrixType copyRowVectors( final Collection<? extends Vectorizable> rows) { // Create the matrix. final int numRows = rows.size(); final int numColumns = VectorUtil.safeGetDimensionality( CollectionUtil.getFirst(rows)); final MatrixType result = this.createMatrix(numRows, numColumns); // Fill in the matrix with the rows. int rowIndex = 0; for (Vectorizable row : rows) { result.setRow(rowIndex, row.convertToVector()); rowIndex++; } return result; }