0
$\begingroup$

I am working on a social networking application and I have to make its news feed better. For example: If someone searches for 'suggest me some good books', it should yield some names.

Now, I have used the Infersent algo (to begin with) in order for my model to be able to answer questions.

I am getting only the best output that my model could predict viz., 'Alchemist'.

I want at least 4 or 5 other outputs, other words, the top five predictions.

I know that Xgboost has the ability to do this activity in some sorts, but I am not sure how I should use that in my problem.

Any heads up?

My apologies, I cannot share any code but I would really appreciate ideas and suggestions.

Thank you,

$\endgroup$
0
$\begingroup$

There's predict_proba method in xgboost. You get probabilites for each class, sort them and take top 5.

| improve this answer | |
$\endgroup$
  • $\begingroup$ predict_proba is available in pretty much every classifier. It gives the best probability for an input. I want about 5 probabilities for the same input. $\endgroup$ – Viphawee Wannarungsee Dec 11 '19 at 3:43
0
$\begingroup$

Welcome to datascience stackexchange. The answer you are probably looking for is, top 'k' most similar based on the search query.

I am going to assume here, that your input query is vectorized using the same vectorizer that was used to vectorize your catalog. Given these vectors, you could perform a cosine similarity for example with all the ones present in the catalog and could return back the top 'k' similar ones.

Let me know if this helps. I could elaborate more in case you have further questions.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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