Waikato / meka

Multi-label classifiers and evaluation procedures using the Weka machine learning framework.
http://waikato.github.io/meka/
GNU General Public License v3.0
200 stars 76 forks source link

Showing model representation in output results for CR, CCP etc #49

Closed vutle closed 4 years ago

vutle commented 6 years ago

Hi Currently Meka seems to only showing the model output in string for BCC and CC with J48 method.

Setting verbose >= 5 does not show model as string in the output.

Show Graph manually in explorer does display the tree representation of the model.

Question: For consistency, if possible, please enable showing model text for CR and other methods.

Thanks

vutle commented 6 years ago

I'm currently get around that by Extend class for CR then add this function.

public String getModel() { if(m_MultiClassifiers != null) { StringBuilder sb = new StringBuilder(); for(int i = 0; i < m_MultiClassifiers.length; ++i) { sb.append("meka.classifiers.multitarget.CR: Node #" + (i + 1) + "\n\n"); sb.append(m_MultiClassifiers[i].toString() + "\n"); } return sb.toString(); } return ""; }

Then manually calling getModelExtend() to get the model string summary.

It would be good to update the classifier.getModel() to return above even the m_Classifier is not built, since the m_MultiClassifiers does existed.

regards

jmread commented 6 years ago

I think you are right, it makes sense. Probably some of the meka.multitarget methods (like CR) are missing this unnecessarily. Although perhaps there could also be a simpler way -- like implementing getModel() already in BR, since CR extends BR. Thanks for your comments.

fracpete commented 4 years ago

Commit https://github.com/Waikato/meka/commit/14e8648f758f6aa9a0fcee9f644d3fce92058410 implements method getModel() in the BR superclass.