0
$\begingroup$

I am using doc2vec to generate vectors for sentences in training and testing datasets. The generated vectors are used to classify sentences using ensemble classifiers. The classifier is showing two different accuracies for the doc2vec model trained on same set of parameters.For TF-IDF the accuracy scores are consistent. Does doc2vec produce different set of vectors when trained twice?? How to avoid in-consistency in the accuracy scores of the classifier??

I have used the following set of parameters: min_count=1,window=10,size=100,negative=5,sample=1e-4,workers=7 and number of epochs=10

$\endgroup$
1
  • $\begingroup$ Keep the seed same and workers = 1(i.e don't use multiple cores for reproducibility) $\endgroup$
    – PleaseHelp
    Commented Apr 5, 2018 at 16:47

1 Answer 1

1
$\begingroup$

Initialisation of the weights of the network will probably depend on some random quantity, so you need to set the seed for the random number generator if you want to reproduce the results across runs.

$\endgroup$
5
  • $\begingroup$ what seed values are most suitable to get consistent accuracy scores?? $\endgroup$
    – avinash
    Commented Dec 18, 2017 at 19:58
  • $\begingroup$ Pick fourty two. $\endgroup$
    – Miguel
    Commented Dec 18, 2017 at 21:00
  • $\begingroup$ Just kidding. You cannot (nor need to) relate performance to the seed. The seed is just a way of ensuring that the random number generator alway generates the same sequence of random numbers. Any number will do. Of course the local minimum you converge to might depend on it, but it is extremely unlikely. $\endgroup$
    – Miguel
    Commented Dec 18, 2017 at 21:02
  • $\begingroup$ Seed didn't work: $\endgroup$
    – avinash
    Commented Dec 18, 2017 at 22:22
  • $\begingroup$ I have added code under your comment please review it. $\endgroup$
    – avinash
    Commented Dec 18, 2017 at 22:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.