Mlpack: Potential bug in Probability function for regression distribution.

Created on 20 Mar 2019  路  3Comments  路  Source: mlpack/mlpack

core bug report

Most helpful comment

Hey @mirraaj, thanks for opening the clear issue. I took a look at RegressionDistribution and think I have an idea of what's going on.

  • I think the documentation for RegressionDistribution isn't very clear, and you're right, it doesn't seem to have any testing. If you like, we can leave this issue open after we solve the immediate problem you've had to add tests for it.

  • When Train() is called, it uses the first row of the observations as regressors for LinearRegression. See regression_distribution.hpp line 48. So, basically, the lr object will expect to receive a point to Predict() with one row fewer than RegressionDistribution receives. The only way Log::Assert() will get called in this code path is in LinearRegression::Predict(), so the problem is in that function.

If you can take a look with a debugger (or just print) the sizes of everything when you call lr.Predict(), it should probably become clear exactly what the problem is. Let me know what you find if you do that. :+1:

All 3 comments

Hey @mirraaj, thanks for opening the clear issue. I took a look at RegressionDistribution and think I have an idea of what's going on.

  • I think the documentation for RegressionDistribution isn't very clear, and you're right, it doesn't seem to have any testing. If you like, we can leave this issue open after we solve the immediate problem you've had to add tests for it.

  • When Train() is called, it uses the first row of the observations as regressors for LinearRegression. See regression_distribution.hpp line 48. So, basically, the lr object will expect to receive a point to Predict() with one row fewer than RegressionDistribution receives. The only way Log::Assert() will get called in this code path is in LinearRegression::Predict(), so the problem is in that function.

If you can take a look with a debugger (or just print) the sizes of everything when you call lr.Predict(), it should probably become clear exactly what the problem is. Let me know what you find if you do that. :+1:

I can try to work on this issue if no one is currently working on it

Of course馃槄

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mrityunjay-tripathi picture mrityunjay-tripathi  路  6Comments

KoushikSahu picture KoushikSahu  路  6Comments

kartikdutt18 picture kartikdutt18  路  3Comments

birm picture birm  路  4Comments

Manthan-R-Sheth picture Manthan-R-Sheth  路  3Comments