Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Predefined tree architecture #26

Open
rabitwhte opened this issue Jul 2, 2020 · 6 comments
Open

Predefined tree architecture #26

rabitwhte opened this issue Jul 2, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@rabitwhte
Copy link

Hey @tomtung!

Do you think it would be possible to predefine tree architecture for parabel? It could be useful when labels are hierarchical by definition. Do you have any hints for implementation? Like where to start?

Regards,
rabitwhte

@rabitwhte
Copy link
Author

Or maybe, if I know the tree architecture, then the main job of parabel is done? And all I should do is to train 1 vs all classifiers in each node? I will be grateful for some insights.

@tomtung
Copy link
Owner

tomtung commented Jul 2, 2020

Unfortunately using pre-defined tree structure is not yet supported. I won't have time to implement it soon, but contributions are welcome :)

Tree-building is half of parabel's job, and you can certainly manually train all the 1-vs-all classifiers yourself based on the given tree. If you want to utilize omikuji for serving, you can try figure out the cbor format with which omikuji saves trees, and save your trees in that format (may be a bit tedious but should be straightforward).

@tomtung tomtung added the enhancement New feature or request label Jul 2, 2020
@rabitwhte
Copy link
Author

Hmm, but cbor files keep not only tree architecture information, but also the classifier themselves, right? Creating trees is an intermediate step in parabel, but can they be saved /edited after created?

What kind of classifiers is your implementation using?

@tomtung
Copy link
Owner

tomtung commented Jul 4, 2020

Hmm, but cbor files keep not only tree architecture information, but also the classifier themselves, right?

That's correct.

Creating trees is an intermediate step in parabel, but can they be saved /edited after created?

For better parallelization, tree creation and classifier training actually happen in tandem, which is why it's nontrivial to use a pre-defined tree structure without some major refactoring :(

What kind of classifiers is your implementation using?

By default it uses coordinate descent code ported from liblinear to solve a L2-regularized linear SVM:

fn solve_l2r_l2_svc(

@rabitwhte
Copy link
Author

Hey @tomtung,

another question on that. When doing the prediction, how does the algorithm choose which way to go on the tree node? This is multilabel algorithm, so it cannot just go with the 'highest probability path', it does explore other branches as well right? How does it decide which branch to go? Or maybe it just shows leafs from the very last branch?

Regards,
rabitwhte

@tomtung
Copy link
Owner

tomtung commented Jul 20, 2020

It does beam search, as described in the paper as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants