Skip to content

Commit

Permalink
Neightbors -> Neighbors (#958)
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrovKP authored Sep 17, 2020
1 parent fc28d12 commit 6580da4
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ services::Status Result::checkImpl(const daal::algorithms::Input * input, const
DAAL_CHECK(par, services::ErrorNullParameterNotSupported);

const size_t nRows = (static_cast<const classifier::prediction::InputIface *>(input))->getNumberOfRows();
if (par->resultsToCompute & computeIndicesOfNeightbors)
if (par->resultsToCompute & computeIndicesOfNeighbors)
{
DAAL_CHECK_STATUS(s, data_management::checkNumericTable(get(indices).get(), indicesStr(), data_management::packed_mask, 0, par->k, nRows));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ DAAL_EXPORT services::Status Result::allocate(const daal::algorithms::Input * in
set(prediction, data_management::HomogenNumericTable<algorithmFPType>::create(1, nRows, data_management::NumericTableIface::doAllocate, &s));
}

if (s.ok() && (par->resultsToCompute & computeIndicesOfNeightbors))
if (s.ok() && (par->resultsToCompute & computeIndicesOfNeighbors))
{
set(indices, data_management::HomogenNumericTable<int>::create(par->k, nRows, data_management::NumericTableIface::doAllocate, &s));
}
Expand Down
2 changes: 1 addition & 1 deletion algorithms/kernel/k_nearest_neighbors/bf_knn_impl.i
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ protected:
daal::algorithms::internal::qSort<FPType, int, cpu>(k, kDistances + i * k, kIndexes + i * k);
}

if (resultsToCompute & computeIndicesOfNeightbors)
if (resultsToCompute & computeIndicesOfNeighbors)
{
daal::internal::WriteOnlyRows<int, cpu> indexesBlock(indicesTable, startTestIdx, blockSize);
DAAL_CHECK_BLOCK_STATUS(indexesBlock);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ services::Status BatchContainer<algorithmFpType, method, cpu>::compute()

data_management::NumericTablePtr indices;
data_management::NumericTablePtr distances;
if (par->resultsToCompute & computeIndicesOfNeightbors)
if (par->resultsToCompute & computeIndicesOfNeighbors)
{
indices = result->get(prediction::indices);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ services::Status Result::checkImpl(const daal::algorithms::Input * input, const
DAAL_CHECK(par, services::ErrorNullParameterNotSupported);

const size_t nRows = (static_cast<const classifier::prediction::InputIface *>(input))->getNumberOfRows();
if (par->resultsToCompute & computeIndicesOfNeightbors)
if (par->resultsToCompute & computeIndicesOfNeighbors)
{
DAAL_CHECK_STATUS(s, data_management::checkNumericTable(get(indices).get(), indicesStr(), data_management::packed_mask, 0, par->k, nRows));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ DAAL_EXPORT services::Status Result::allocate(const daal::algorithms::Input * in
data_management::HomogenNumericTable<algorithmFPType>::create(1, nRows, data_management::NumericTableIface::doAllocate, 0, &s));
}

if (s.ok() && (par->resultsToCompute & computeIndicesOfNeightbors))
if (s.ok() && (par->resultsToCompute & computeIndicesOfNeighbors))
{
set(indices, data_management::HomogenNumericTable<size_t>::create(par->k, nRows, data_management::NumericTableIface::doAllocate, 0, &s));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ void testModel()
algorithm.input.set(classifier::prediction::data, testData);
algorithm.input.set(classifier::prediction::model, trainingResult->get(classifier::training::model));
algorithm.parameter().nClasses = nClasses;
algorithm.parameter().resultsToCompute = bf_knn_classification::computeDistances | bf_knn_classification::computeIndicesOfNeightbors;
algorithm.parameter().resultsToCompute = bf_knn_classification::computeDistances | bf_knn_classification::computeIndicesOfNeighbors;

/* Compute prediction results */
algorithm.compute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private static void testModel() {
kNearestNeighborsPredict.input.set(NumericTableInputId.data, testData);
kNearestNeighborsPredict.input.set(ModelInputId.model, model);
kNearestNeighborsPredict.parameter.setNClasses(nClasses);
kNearestNeighborsPredict.parameter.setResultsToCompute(ResultsToComputeId.computeDistances | ResultsToComputeId.computeIndicesOfNeightbors);
kNearestNeighborsPredict.parameter.setResultsToCompute(ResultsToComputeId.computeDistances | ResultsToComputeId.computeIndicesOfNeighbors);

/* Compute prediction results */
PredictionResult predictionResult = kNearestNeighborsPredict.compute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ enum DataUseInModel
*/
enum ResultToComputeId
{
computeIndicesOfNeightbors = 0x00000001ULL, /*!< The flag to compute indices of nearest neighbors */
computeIndicesOfNeighbors = 0x00000001ULL, /*!< The flag to compute indices of nearest neighbors */
computeDistances = 0x00000002ULL /*!< The flag to compute distances to nearest neighbors */
};
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ enum DataUseInModel
*/
enum ResultToComputeId
{
computeIndicesOfNeightbors = 0x00000001ULL, /*!< The flag to compute indices of nearest neighbors */
computeIndicesOfNeighbors = 0x00000001ULL, /*!< The flag to compute indices of nearest neighbors */
computeDistances = 0x00000002ULL /*!< The flag to compute distances to nearest neighbors */
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
*/
public final class ResultsToComputeId {

public static final long computeIndicesOfNeightbors = 0x0000000000000001L;
public static final long computeIndicesOfNeighbors = 0x0000000000000001L;
/*!< The flag to compute indices of nearest neighbors */
public static final long computeDistances = 0x0000000000000002L;
public static final long computeDistances = 0x0000000000000002L;
/*!< The flag to compute distances to nearest neighbors */
}
/** @} */
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/
public final class ResultsToComputeId {

public static final long computeIndicesOfNeightbors = 0x0000000000000001L;
public static final long computeIndicesOfNeighbors = 0x0000000000000001L;
/*!< The flag to compute indices of nearest neighbors */
public static final long computeDistances = 0x0000000000000002L;
/*!< The flag to compute distances to nearest neighbors */
Expand Down

0 comments on commit 6580da4

Please sign in to comment.