cameron.freenode.net changed the topic of #mlpack to: http://www.mlpack.org/ -- We don't respond instantly... but we will respond. Give it a few minutes. Or hours. -- Channel logs: http://www.mlpack.org/irc/
govg has quit [Remote host closed the connection]
govg has joined #mlpack
govg has quit [Quit: leaving]
govg has joined #mlpack
SinisterMJ has joined #mlpack
< SinisterMJ>
Hi guys, how can I access the prediction parameters from outside? I tried
< SinisterMJ>
er....nvm, just found the error in my ways...
< SinisterMJ>
(I checked in debug that ncols = 1 and nrows = 0, but it loads the 4800 parameters from file properly, I can use it on my training data just fine)
< naywhayare>
SinisterMJ: how are you training the lr object?
< naywhayare>
or, more specifically, what constructor are you using?
< SinisterMJ>
I do MachLearning::LoadRegressionModel("AllInput.csv");
< SinisterMJ>
which calls
< SinisterMJ>
lr = mlpack::regression::LinearRegression(fileName);
< naywhayare>
ok; is it being saved correctly to disk? i.e. does the file contain what you expect?
< SinisterMJ>
Yes
< SinisterMJ>
Well, I dont know exactly
< SinisterMJ>
is it supposed to be comma-separated or line-separated?
< SinisterMJ>
I am using comma separated, and it works for me
< SinisterMJ>
when I load it from disk, it works, but I can't access its members properly
< naywhayare>
how do you know that it works?
< SinisterMJ>
I use it on my training data, and read the prediction.at(0)
< SinisterMJ>
which is very close to the value I am expecting
< SinisterMJ>
I am doing one regression value only each time
< SinisterMJ>
since thats the data I will be getting
< naywhayare>
I meant, how do you know that it works when you load it from disk?
< SinisterMJ>
I dont really understand the question? I load it from disk, and try my trainingsdata on it.
< SinisterMJ>
I can save again after loading, and get the same CSV file
< SinisterMJ>
even when I was debugging the code, the .Parameters() was empty, but from SOMEWHERE the save function got valid data
< SinisterMJ>
I wasnt able to figure out where it came from
< naywhayare>
the code you linked to looks okay; I don't see anything obviously wrong with it
< naywhayare>
you say that Mach::Learning::lr is a static object; part of me thinks that might be part of the issue (since I can't think of anything else)
< naywhayare>
if ExtractTopTen() is being called before LoadRegressionModel() (or, if LoadRegressionModel() is not properly setting lr to a valid LinearRegression object), then you will see the behavior you described
< naywhayare>
which is, lr.Parameters().n_elem = 0
< SinisterMJ>
Okay, I just ran the code again, and the point is, the save_impl.hpp returns paramters; on Parameters(). Looking at parameters, its NOWHERE near the data the save function gets, which is just fine
< jenkins-mlpack>
Starting build #2125 for job mlpack - svn checkin test (previous build: SUCCESS)
< naywhayare>
you're describing your code to me, but unless I see more of it, I don't think that I can help any further
< naywhayare>
can you produce a stripped-down version of the code which is all that is necessary to produce the issue that you're having?
< SinisterMJ>
Yes, should be possible
< SinisterMJ>
I'll do that now
< naywhayare>
okay, thanks
SinisterMJ has quit [Quit: Page closed]
SinisterMJ has joined #mlpack
< SinisterMJ>
naywhayare: you were right, it was some name-mingling issue. Works now, thanks for the pointer.
< naywhayare>
:)
< naywhayare>
I'm glad you got it figured out
< SinisterMJ>
Thanks for you guys, you helped me fix every issue I had within a rather short time!