naywhayare 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/
andrewmw94 has left #mlpack []
Anand has joined #mlpack
< Anand> Marcus : I have fixed the errors but the AsciiFile.h in the code is giving me errors in compilation. Is there anything called AsciiFile.h in shogun. I have already installed shogun on my machine. Are you able to compile the code?
< marcus_zoq> Anand: Hello, I'm not able to compile the code. If I made the following changes the code compliles just fine:
< marcus_zoq> Anand: Use 'GaussianNaiveBayes* ci = new GaussianNaiveBayes(features, labels);' instead of 'CGaussianNaiveBayes* ci = new GaussianNaiveBayes(features, labels);'
< marcus_zoq> Anand: Remove ': CNativeMulticlassMachine() , m_features(NULL), m_min_label(0) ...' form the constructor.
< marcus_zoq> Anand: Avoid the labels redifinition. That means you can use 'const char* labels_file = argv[2];' instead of 'const char* labels = argv[2];'
< marcus_zoq> Anand: Write 'ci->get_probs(test_features);' instead of 'GVector<float64_t> p_test = ci->get_probs(test_features);' because there is no return value.
< marcus_zoq> Anand: use 'lmat.load(cfile);' instead of 'lmat.load(lfile);'
< marcus_zoq> Anand: Use 'CDenseFeatures<float64_t>* test_features = new CDenseFeatures<float64_t>(tmat);' instead of 'CFeatures* test_features = new CFeatures(tmat);' because CFeatures is just a base class.
< marcus_zoq> Anand: Maybe I missed something, I can push the changes to the branch if you like.
Anand has quit [Ping timeout: 246 seconds]
Anand has joined #mlpack
< Anand> Marcus : Still getting the same error : methods/shogun/src/nbc.cpp:8:33: fatal error: shogun/io/AsciiFile.h: No such file or directory compilation terminated.
< Anand> I think the version of Shogun is different for us. What version are you using?
< marcus_zoq> Anand: shogun 2.1
< marcus_zoq> Anand: I think you can use CSVFile.h
< marcus_zoq> Anand: A student from last gsoc added a bunch of new file formats: https://github.com/shogun-toolbox/shogun/tree/ac887280e054a15c0e4662a432d7f193abc28592/src/shogun/io
< Anand> Marcus : I am using shogun 3.2. May be they have changed some things in the latest version
< marcus_zoq> Anand: Can you test CSVFile.h?
< Anand> I will have to reinstall shogun from the git version then
< marcus_zoq> Anand: I don't think so, CSVFile.h is in 3.2
< marcus_zoq> Anand: We need to upgrade the shogun version on the build server, because we should compare the results with the newest version
< Anand> Ok. Yes it is
< Anand> I will try it. I will keep working on 3.2 then
< marcus_zoq> Anand: You mean try to upgrade the shogun version on the build server
< marcus_zoq> ?
< marcus_zoq> Anand: I think Ryan will do that because he has the rights to install the packages :)
< Anand> Ok, yes. We should talk to Ryan
< Anand> And yes CSVFile worked !
< marcus_zoq> Anand: Okay, great!
< Anand> I also need to generate the predicted labels file now. I am working on it
< Anand> I think the apply() method will be useful
< marcus_zoq> Anand: Yeah right! Btw how was the hackathon?
< Anand> Oh, it was nice!
< marcus_zoq> Anand: Some cool projects, I guess.
< Anand> Yeah, a lot of cool entries were there!
< Anand> I tried my hands on Beautiful Soup!
< marcus_zoq> Nice, my experience with bs are very limited :)
< Anand> bs is really cool and easy!
< Anand> Marcus : labels file also added
< marcus_zoq> Anand: Great, so the next step is to interate the new function into the python code?
< Anand> Yes.
< Anand> We have a RunNBCShogun method there
< Anand> How do I separate Metrics and Timing there?
< marcus_zoq> Anand: No need to use the RunNBCShogun method, you can add the RunMetrics function and call the new shogun executable within this function. Because we don't need to time the new executable.
< Anand> Ok. So, the RunNBCShogun will serve only for RunTiming, right?
< marcus_zoq> Anand: You can use the lines from the kmeans python code from line 77-88
< marcus_zoq> Anand: Right!
< Anand> Ok
< marcus_zoq> Anand: Line 77-88 will run the nbc executable and then you can load the props and labels file.
< Anand> Ok. In nbc.cpp, we expect train_data and labels to be loaded from different files. This is not something we normally do
< marcus_zoq> Anand: Right, so there are two options we can splite the last row form the input dataset in the shogun code or in the python code. In the second case we need to save the new file.
< Anand> No, let us do that in the shogun cpp code
< Anand> Even in the first case we need to save them to a file
< marcus_zoq> Anand: I think you can directly use the last row of the input dataset as the labels. So we only need to load the input dataset and truncate the last row.
< Anand> Yes, right. I have almost done that
< Anand> I will push it in a while and then you can have a look
< marcus_zoq> Anand: Okay good.
< Anand> Marcus : Done, check!
< marcus_zoq> Anand: Instead of self.RunTiming(option) you should use the following: https://gist.github.com/692bbfcfd56221cd7d54.git
< marcus_zoq> Anand: Because if you call self.RunTiming(options) within the RunMetrics function you don't get the probs.
< Anand> Marcus : The above link is not working
< marcus_zoq> Anand: Maybe this? https://gist.github.com/zoq/692bbfcfd56221cd7d54
< Anand> Why exactly? I will get the probs by running the cpp executable
< marcus_zoq> Anand: Right, the command to run the cpp executable is s = subprocess.check_output(cmd, stderr=subprocess.STDOUT, shell=False, timeout=self.timeout)
< Anand> Oh, ok
< Anand> I have added those lines to the code. To run the metrics, I need to mention the path for shogun ?
< Anand> make run SHOGUN_CLASSPATH="......" ?
< marcus_zoq> Anand: If you already build the nbc cpp code there is no need to set the path.
< Anand> See if you can run the metrics
< Anand> I am getting an exception
< Anand> [FATAL] Could not load the script: methods/shogun/nbc.py [FATAL] Exception: No module named 'shogun'
< marcus_zoq> Anand: Did you installed the shogun-python module?
< marcus_zoq> Anand: If you import 'from shogun.Features import RealFeatures, MulticlassLabels' wihin python you get the error no module named shogun
< Anand> Yeah, I installed shogun-python-modular
< Anand> yes I get the error
< Anand> still
< marcus_zoq> Anand: Can you check if you get the same error if you run python2 and import the module?
< Anand> Ok, yes it is working on Python2
< marcus_zoq> Anand: So the problem is that you need to install shogun with python3
< Anand> yes
< Anand> Is it working for you?
< marcus_zoq> Anand: Yes
< Anand> Ok, great!
Anand has quit [Ping timeout: 246 seconds]
Anand has joined #mlpack
< naywhayare> Anand: marcus_zoq: I think it will be Monday before I am able to upgrade shogun on shoeshine
< naywhayare> sorry for the delay
< naywhayare> I have much less free time than expected this weekend...
< Anand> Ryan : Ok, no problem! We are using shogun 3.2 now
< marcus_zoq> naywhayare: There is no hurry, at this time we can test the code on our local machines.
< naywhayare> ok, good
Anand has quit [Ping timeout: 246 seconds]
arcane has joined #mlpack
arcane has quit [Quit: Leaving]