[mlpack-git] master: now regression_distribuiton.hpp (0617a55)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 22:02:03 EST 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40

>---------------------------------------------------------------

commit 0617a558f6c77d0837d15fa13a114d0219c00240
Author: michaelfox99 <michaelfox99 at gmail.com>
Date:   Sun Nov 2 17:56:33 2014 +0000

    now regression_distribuiton.hpp


>---------------------------------------------------------------

0617a558f6c77d0837d15fa13a114d0219c00240
 src/mlpack/core/dists/hmm_regression.hpp | 89 --------------------------------
 1 file changed, 89 deletions(-)

diff --git a/src/mlpack/core/dists/hmm_regression.hpp b/src/mlpack/core/dists/hmm_regression.hpp
deleted file mode 100644
index 3b17cac..0000000
--- a/src/mlpack/core/dists/hmm_regression.hpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * @file hmm_regression.hpp
- * @author Michael Fox
- *
- * Implementation of conditional Gaussian distribution for HMM regression (HMMR)
- */
-#ifndef __MLPACK_METHODS_HMM_DISTRIBUTIONS_CONDITIONAL_GAUSSIAN_DISTRIBUTION_HPP
-#define __MLPACK_METHODS_HMM_DISTRIBUTIONS_CONDITIONAL_GAUSSIAN_DISTRIBUTION_HPP
-
-#include <mlpack/core.hpp>
-#include <mlpack/methods/linear_regression/linear_regression.hpp>
-
-namespace mlpack {
-namespace distribution {
-
-/**
- * A class that represents a univariate conditionally Gaussian distribution.
- * Can be used as an emission distribution with the hmm class to implement HMM
- * regression (HMMR) as described in
- * https://www.ima.umn.edu/preprints/January1994/1195.pdf
- * The hmm observations should have the dependent variable in the first row,
- * with the independent variables in the other rows. 
- */
-class HMMRegression
-{
- private:
-  //! Regression function for representing conditional mean.   
-  regression::LinearRegression rf;   
-  //! Error distribution
-  GaussianDistribution err;
-  
- public:
-  /**
-   * Default constructor, which creates a Gaussian with zero dimension.
-   */
-  HMMRegression() { /* nothing to do */ }
-
-  /**
-   * Create a Conditional Gaussian distribution with conditional mean function
-   * obtained by running RegressionFunction on predictors, responses. 
-   * 
-   * @param predictors Matrix of predictors (X).
-   * @param responses Vector of responses (y).
-   */
-  HMMRegression(const arma::mat& predictors,
-                                  const arma::vec& responses) :
-      rf(regression::LinearRegression(predictors, responses))    
-  {
-      err = GaussianDistribution(1);
-      err.Covariance() = rf.ComputeError(predictors, responses);
-  }
-
-  /**
-   * Returns a string representation of this object.
-   */
-  std::string ToString() const;
- 
-  // Return regression function
-  const regression::LinearRegression& Rf() {return rf;}
-  
-  /**
-   * Estimate parameters using provided observation weights
-   *
-   * @param weights probability that given observation is from distribution
-   */
-  void Estimate(const arma::mat& observations, const arma::vec& weights);
-  
-  /**
-  * Evaluate probability density function of given observation  
-  *
-  * @param observation point to evaluate probability at
-  */
-  double Probability(const arma::vec& observation) const;
-  
-   //! Return the parameters (the b vector).
-  const arma::vec& Parameters() const { return rf.Parameters(); }
-
-  //! Return the dimensionality (2)
-  static const size_t Dimensionality() { return 2; }
-};
-
-
-}; // namespace distribution
-}; // namespace mlpack
-
-//Include implmentation
-#include "hmm_regression_impl.hpp"
-
-#endif



More information about the mlpack-git mailing list