diff --git a/HISTORY.md b/HISTORY.md index a3e321e1e3..3976c0d6d3 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,8 @@ ### mlpack ?.?.? ###### ????-??-?? + + * Update outdated code in tutorials (#3398). + * Bugfix for non-square convolution kernels (#3376). * Fix a few missing includes in `` (#3374). diff --git a/doc/tutorials/cf.md b/doc/tutorials/cf.md index 9452ebfdd0..aa3c4fb57e 100644 --- a/doc/tutorials/cf.md +++ b/doc/tutorials/cf.md @@ -255,7 +255,7 @@ extern size_t rank; // Build the CF object and perform the decomposition. // The constructor takes a default-constructed factorizer, which, by default, // is of type NMFALSFactorizer. -CF cf(data, NMFALSFactorizer(), neighborhood, rank); +CF cf(data, NMFPolicy(), neighborhood, rank); // Store the results in this object. arma::Mat recommendations; @@ -270,12 +270,15 @@ mlpack provides a number of existing factorizers which can be used in place of the default `NMFALSFactorizer` (which is non-negative matrix factorization with alternating least squares update rules). These include: - - `SVDBatchFactorizer` - - `SVDCompleteIncrementalFactorizer` - - `SVDIncompleteIncrementalFactorizer` - - `NMFALSFactorizer` - - `RegularizedSVD` - - `QUIC_SVD` + - `BatchSVDPolicy` + - `SVDCompletePolicy` + - `SVDIncompletePolicy` + - `NMFPolicy` + - `RegSVDPolicy` + - `QuicSVDPolicy` + - `BiasSVDPolicy` + - `SVDPlusPlusPolicy` + - `RandomizedSVDPolicy` The `AMF` class has many other possibilities than those listed here; it is a framework for alternating matrix factorization techniques. See the `AMF` class @@ -297,7 +300,7 @@ extern size_t neighborhood; extern size_t rank; // Build the CF object and perform the decomposition. -CF cf(data, RegularizedSVD(), neighborhood, rank); +CFType cf(data, RegSVDPolicy(), neighborhood, rank); // Store the results in this object. arma::Mat recommendations; @@ -330,7 +333,7 @@ extern size_t rank; // Build the CF object and perform the decomposition. // The constructor takes a default-constructed factorizer, which, by default, // is of type NMFALSFactorizer. -CF cf(data, NMFALSFactorizer(), neighborhood, rank); +CF cf(data, NMFPolicy(), neighborhood, rank); const double prediction = cf.Predict(12, 50); // User 12, item 50. ``` @@ -356,7 +359,7 @@ extern size_t rank; // Build the CF object and perform the decomposition. // The constructor takes a default-constructed factorizer, which, by default, // is of type NMFALSFactorizer. -CF cf(data, NMFALSFactorizer(), neighborhood, rank); +CF cf(data, NMFPolicy(), neighborhood, rank); // References to W and H matrices. const arma::mat& W = cf.W(); diff --git a/doc/tutorials/datasetmapper.md b/doc/tutorials/datasetmapper.md index a841071216..a94854568a 100644 --- a/doc/tutorials/datasetmapper.md +++ b/doc/tutorials/datasetmapper.md @@ -43,7 +43,7 @@ function. using namespace mlpack; arma::mat data; -data::DatasetMapper info; +data::DatasetInfo info; data::Load("dataset.csv", data, info); ``` @@ -155,8 +155,8 @@ std::cout << info.UnmapString(1, 2) << "\n"; This will print: ``` -T -F +True +False ``` ### `UnmapValue()` @@ -168,8 +168,8 @@ The `UnmapValue()` function has the signature `UnmapValue(const std::string - `dimension` is the dimension in which you want to find the mapped value ```c++ -std::cout << info.UnmapValue("T", 2) << "\n"; -std::cout << info.UnmapValue("F", 2) << "\n"; +std::cout << info.UnmapValue("True", 2) << "\n"; +std::cout << info.UnmapValue("False", 2) << "\n"; ``` will produce: diff --git a/src/mlpack/methods/cf/cf.hpp b/src/mlpack/methods/cf/cf.hpp index 90bcb80338..6efb558d12 100644 --- a/src/mlpack/methods/cf/cf.hpp +++ b/src/mlpack/methods/cf/cf.hpp @@ -283,6 +283,8 @@ class CFType }; }; // class CFType +typedef CFType<> CF; + } // namespace mlpack // Include implementation of templated functions.