tomtung / omikuji

An efficient implementation of Partitioned Label Trees & its variations for extreme multi-label classification

Home Page:https://crates.io/crates/omikuji

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

predict API

ljmartin opened this issue · comments

Hi,
Thanks for parabel and making it available! I've had some promising results already.

I'm using the python bindings and Im wondering about the API. Are there any kwargs I can use? For example, model.predict(test_example) returns the top ten ranked labels. Can I return all the rankings? Ive tried reading the source code but I just don't understand it sorry!

You can look at the method signature:
https://github.com/tomtung/parabel-rs/blob/c367075a1defbbecc9b6e66a34720e89db920840/python/parabel/__init__.py#L48

You can use the top_k kwarg to control how many labels to return. Fewer labels might be returned if you use relatively small beam_size, or if you set small max_leaf_size during training. In these cases you can also try enlarging them.

Much appreciated