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/
govg has quit [Ping timeout: 255 seconds]
govg has joined #mlpack
govg has quit [Changing host]
govg has joined #mlpack
andrewmw94 has quit [Quit: Leaving.]
govg has quit [Ping timeout: 264 seconds]
govg has joined #mlpack
govg has quit [Ping timeout: 240 seconds]
govg has joined #mlpack
govg has quit [Ping timeout: 264 seconds]
govg has joined #mlpack
govg has quit [Changing host]
govg has joined #mlpack
udit_s has joined #mlpack
govg has quit [Ping timeout: 240 seconds]
govg has joined #mlpack
< marcus_zoq> udit_s: Just for clarification, you transform the target to a 2D-vector if we use two labels and the output is a 3D-vector if we use 3 labels, right?
< udit_s> marcus_zoq: 3D-vector as in a cube ? for n class labels, I just have a weight matrix with n rows.
< udit_s> marcus_zoq: also, I think I've figured out what the problem was and why yesterday's solution wasn't converging.
< udit_s> - no bias vector.
< udit_s> I'm taking care of that right now.
< marcus_zoq> udit_s: If you compute 'weightVectors * data.col(j);' I was expecting a value, so I though you transform the target value to a binary vector.
< marcus_zoq> udit_s: Something like: y = x(i,1)*w(2,1)+x(i,2)*w(3,1) -> single value
< udit_s> No, I'm getting the max value from tempLabelMat. as the single value.
< udit_s> marcus_zoq: Oh, and I think I fixed it. Just need to run some more tests to be sure, but it works for AND, OR gate implementations and the random linearly separable test case
< udit_s> Let me just upload the code.
< udit_s> udit_s: So basically, I've added a col in weightVector for the bias vector. And inserted a row of ones in trainData and testData for bias variables. It properly converges now.
< udit_s> marcus_zoq: ^ oops.
< marcus_zoq> udit_s: Okay sounds good?
< udit_s> marcus_zoq: So what next ? I'll write a few more tests, edit the documentation; are we assuming linearly separable data as the input ?
< marcus_zoq> udit_s: Yeah we are assumig linearly separable data. Test great idea, and a main would be great.
< marcus_zoq> udit_s: Can you also add a test with just two inputs?
govg has quit [Ping timeout: 240 seconds]
govg has joined #mlpack
udit_s has quit [Quit: Leaving]
andrewmw94 has joined #mlpack
udit_s has joined #mlpack
udit_s has quit [Quit: Leaving]
Anand has joined #mlpack
< Anand> Marcus : I didn't really get you. What is the m_rates vector? How do I implement the get_probs() method?
< marcus_zoq> Anand: Hello, here is the shogun nbc header file and the cpp file:
< marcus_zoq> What we need is the m_rates vector. The problem is, we can't directly access this vector. A protected member is accessible in the class that defines them and in classes that inherit from that class. So, we create a new class that inherit form the shogun CGaussianNaiveBayes class.
< Anand> Yeah right, I got that. But, what exactly is m_rates?
< Anand> log of m_prob?
< marcus_zoq> Anand: A shogun vector object that contains the probabilities.
< marcus_zoq> Anand: m_rates.vector[i] = CMath::log(m_label_prob.vector[i]);
< Anand> yes, exactly
< Anand> why the log?
< Anand> And later m_rates.vector[i]+= CMath::log(0.39894228/CMath::sqrt(m_variances(k, i))) - 0.5*CMath::sq(feature_vector.vector[k]-m_means(k, i))/(m_variances(k, i));
< marcus_zoq> Anand: 'why the log' -> The class with the highest log probability value is the most probable class.
< marcus_zoq> Anand: 'm_rates.vector[i]+= CMath::log( ...' -> This should be the equation for the normal distribution.
< marcus_zoq> Anand: Let me search for a formula.
< marcus_zoq> Anand: We can compare the results with mlpack or matlab.
< Anand> Ok. Now, I get this
< Anand> So, we want to call the apply_one(...) function and set the values in m_rates for each instance. Right?
< Anand> This gives probabilities for a single instance at an index in the file. Correct?
< marcus_zoq> Anand: You can use apply_multiclass(...) this calls apply_one for the dataset and afterwards you can look into the m_rates vector.
< Anand> But, m_rates is for a single instance right? It is a one dimensional vector
< Anand> So, we will write the m_rates vector to file after each call to apply
< Anand> -_one
< marcus_zoq> Anand: Yeah I think you are right!
< marcus_zoq> Anand: Your are right!
< Anand> Ok. I will add the get_probs(..) method
< Anand> After that, how do we use it in python nbc.py?
< Anand> we will need an executable and then we will run it just as we did in weka. This will give us the required files
< marcus_zoq> Anand: We need to write a small c++ main/executalbe that uses the new class.
< marcus_zoq> Anand: Right :)
< Anand> Ok. I think I can do it now.
< marcus_zoq> Anand: I think, you can use the function from the last mail as a basis.
< Anand> Yeah, sure
< marcus_zoq> Anand: But you need to install shogun or use the build server to test the code
< Anand> the python module?
< marcus_zoq> Anand: The c++ library.
< Anand> Ok. I will install it
Anand has quit [Ping timeout: 246 seconds]
andrewmw94 has left #mlpack []
andrewmw94 has joined #mlpack
govg has quit [Ping timeout: 240 seconds]