askerlee / vmfmix

Python implementation of Dirichlet-vMF (von-Mises-Fisher) mixture model. Includes the evaluation code of topic inference on word embeddings.
11 stars 2 forks source link

change the input to the class eval #1

Closed un-lock-me closed 6 years ago

un-lock-me commented 7 years ago

Do you think I can use your class eval for my LDA model?

Thanks

askerlee commented 7 years ago

Could you elaborate how would you use it?

un-lock-me commented 7 years ago

Actually this is my question. To explain in detail, I am using LDA model as topic modeling the next step for me is to evaluate my model. I couldnt figure out how can I do this, then found your code. My question is that according to your experiences can I use ur eval class and in which part they may be different. May I ask you to explain about this?

Thanks

askerlee commented 7 years ago

I see. You are asking how to use classEval.py. Yeah it's a quite general code. You prepare the training and test file as the libsvm format: class-label feature-index:value feature-index:value .... class-label feature-index:value feature-index:value .... ......

Note that feature-index should start from 1. You may also need to change the hard-coded file name template to match your file names.

un-lock-me commented 7 years ago

Many thanks for taking the time, even if I want to use naive Bayesian as the evaluator it is ok so? Actually I want to use this LDA code, http://scikit-learn.org/stable/auto_examples/applications/topics_extraction_with_nmf_lda.html May I ask you to have a glance on that, I just want to be sure it is okay to stick with your code and settings, Again thanks for your useful explanations and sharing your information :)

askerlee commented 7 years ago

Yeah you could use Naive Bayes as the classifier, but you have to change LinearSVC to naive_bayes. Also if some methods you are evaluating use real feature values, then naive bayes may not handle them. (AFAIK naive bayes only handles integer feature values.)

askerlee commented 7 years ago

In terms of the LDA implementation, I think you could use any implementations. What matters is the output.

un-lock-me commented 7 years ago

you helped me a lot thank you, I will try this week on this, if I face difficulty I will ask,

Thank u also very much

askerlee commented 7 years ago

No problem. you are welcome