shogun-toolbox / shogun

Shōgun
http://shogun-toolbox.org
BSD 3-Clause "New" or "Revised" License
3.03k stars 1.04k forks source link

Remove CStatistic::mean/variance/covariance #3118

Open karlnapf opened 8 years ago

karlnapf commented 8 years ago

And replace all their usage with linalg implementation. In addition, respect Shoguns way of defining vectors, which is as column vectors, not row vectors. A couple of unit tests and other places in Shogun depend on this.

Mean/Std/Var:

Covariance:

See also #3117

c4goldsw commented 8 years ago

@karlnapf I'm trying to find a standard deviation or variance function in linalg, but I'm unable to find one - could you please point me in the right direction? Or, have I misunderstood you, in that it has yet to be implemented (because of "partly already in linalg")?

c4goldsw commented 8 years ago

Also, I've noticed that there are different implementations of functions for vectors and matrices - I've replaced all usages of CStatistics::mean() with linalg::mean() (#3096), but I haven't done anything with CStatistics::matrix_mean() . Does this issue involving replacing both or only vector implementations (obiviously for covariance we're just working with matricies)?

karlnapf commented 8 years ago

The idea is to

  1. Add all functionality for mean/variance/etc to linalg. Those that are not yet there, such as variance
  2. Make Shogun use them rather than CStatistics
  3. Remove them from CStatistics

Start one by one. As a first step, you could grep for CStatistics::matrix_mean etc and replace them with linalg calls