Implemented 'tree' and 'full' edge structure flags in MultiLabelClf#174
Implemented 'tree' and 'full' edge structure flags in MultiLabelClf#174almath123 wants to merge 3 commits into
Conversation
|
Thanks for working on this! I think we need to increase the scipy version requirement for the spanning tree function. Hm it looks like that is not actually documented (my bad), but the continuous integration runs with scipy==0.9.0, which doesn't have the function. Can you check when it was introduced and change the |
|
Fixes #88. |
| if self.n_features is not None and self.n_states is not None: | ||
| if self.edges is None: | ||
| self.edges = np.zeros(shape=(0, 2), dtype=np.int) | ||
| self._set_edge_structure() |
There was a problem hiding this comment.
I think this is not necessary. initialize should have been called before _set_size_joint_feature If initialize has not been called, it's very likely that self.n_features and self.n_states is unknown yet.
|
Thanks for the comments. I have setup scipy to be installed via pip. It takes a long time to install, but passes all the tests in the two "ubuntu" environments now. I haven't been able to get it to work in the "conda" environments yet, it doesn't seem to be able to find the mkl libraries. I'm not even sure why it needs mkl. I also modified the code, as per your comment, so that |
|
ok this sounds great. I'm super busy right now but I'll try to have a look at the travis failures sometime soon. |
I have implemented the "tree" and "full" edge structures that were mentioned in the doc comments for
MultiLabelClfbut not previously implemented. Most of the hard work was already done in the multi_label example, I just moved it into the library and added some test cases.One thing that I have done that is perhaps a bit messy is to divide the code to set the edge structure into two methods one which does initialization when no labels are needed (edges is None or 'full') and another that needs the labels (edges is 'tree'). I did this because the existing multi label test cases run inference on the model without initializing. I'm not convinced this is the right approach.
Thoughts? Comments?