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> Hmm, okay, question still stands
< SinisterMJ> arma::vec parameter = MachLearning::lr.Parameters();
< SinisterMJ> returns size = 0
< SinisterMJ> What do I need to change there? I need to access the parameters, but fail to do so
< zoq> SinisterMJ: Hello, lr.Parameters() should work, can you point me to your code?
< zoq> SinisterMJ: The example from the tutorial should work: http://www.mlpack.org/doxygen.php?doc=lrtutorial.html
weirdo_ has joined #mlpack
weirdo_ has left #mlpack []
< SinisterMJ> sry, had to join family
< SinisterMJ> the code is at
< SinisterMJ> And it will always return size 0
< 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);
< SinisterMJ> lr is
< SinisterMJ> static mlpack::regression::LinearRegression lr;
< naywhayare> what's in the AllInput.csv file?
< SinisterMJ> Its created earlier via
< SinisterMJ> lr = mlpack::regression::LinearRegression(data, responses.unsafe_col(0)); lr.Predict(data, predictions); mlpack::data::Save(fileName, lr.Parameters(), false, true);
< 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!
< SinisterMJ> You are awesome!
govg has quit [Remote host closed the connection]
< naywhayare> thanks :)
SinisterMJ has quit [Quit: Page closed]
< jenkins-mlpack> Project mlpack - svn checkin test build #2125: SUCCESS in 2 hr 33 min: http://big.cc.gt.atl.ga.us:8080/job/mlpack%20-%20svn%20checkin%20test/2125/
< jenkins-mlpack> * Ryan Curtin: Spacing and line length fixes.
< jenkins-mlpack> * Ryan Curtin: Tabs to spaces.
zoq_ has joined #mlpack
zoq has quit [Ping timeout: 260 seconds]
zoq_ is now known as zoq