[mlpack] Linear Regression Multiple Responder

Ryan Curtin ryan at ratml.org
Thu Jul 12 10:17:01 EDT 2018


On Thu, Jul 12, 2018 at 02:47:00PM +0200, Steffen Zeuch wrote:
> Hi the api tell me that the LinearRegression class only accepts a vector for
> respones. My problem involves multiple resonders. Is there a other class or
> workaround for this?

Hi Steffen,

If I am understanding right, you mean that your problem is

  Y = AX + b

where y_i is not a scalar response to each x_i but instead a vector
response like {0.5, 1.5} or something like this.  In other words, you
have multiple response variables to the input x_i.

Right now you are right that LinearRegression (or any other regressions
in mlpack) don't support this use case, but you could actually run each
regression independently...

  Y_1 = A_1 X + b_1
  Y_2 = A_2 X + b_2
  ...

I believe it would work to split your data like this, so that you have
several one-dimensional response vectors, and then train one
LinearRegression model on each of those response vectors.  (Or, you
could also use LARS, for instance.)  To my knowledge this will give you
the exact same result as solving the original multi-response problem
Y = AX + b.

I hope this helps; let me know if I misunderstood.

Thanks!

Ryan

-- 
Ryan Curtin    | "Are you or are you not the Black Angel of Death?"
ryan at ratml.org |   - Steve


More information about the mlpack mailing list