C++ 的机器学习库 MLPACK 1.0.7 发布

2014-04-07 00:36:18 · 作者: · 浏览: 96

  MLPACK 1.0.7 增加了一个协作过滤器包,可根据给定的用户和项目给出推荐;同时包含了用于 PCA 核心的 speedups和 bug 修复。

  MLPACK 是一个 C++ 的机器学习库,其重点是可伸缩性、速度和易用。

  示例代码:

  #include

  using namespace mlpack::range;

  // Our dataset matrix, which is column-major.

  extern arma::mat dataset;

  // The ‘true’ option indicates that we will use naive calculation.

  RangeSearch<> a(dataset, true);

  // The vector-of-vector objects we will store output in.

  std::vector< xml version='1.0' encoding='utf-8' > > resultingNeighbors;

  std::vector > resultingDistances;

  // The range we will use. The upper bound is DBL_MAX.

  math::Range r(5.0, DBL_MAX); // [5.0, inf).

  a.Search(r, resultingNeighbors, resultingDistances);