Re: this.m_localModel is null

Michael Hall <[email protected]> Wed, 30 Aug 2023 07:11:29 -0500
Newsgroups gmane.comp.ai.weka
Message-ID <[email protected]>

> 
> 
> Before this code I have the following:
> m_insts_union = mydata;
> m_insts_union.setClassIndex(data.numAttributes() - 1);
> m_toSelectModel = new BinC45ModelSelection(2, m_insts_union, true, false);
> m_localModel = m_toSelectModel.selectModel(m_insts_union);
> 
> Is there a way to set m_localModel outside the Weka code?
> I saw, there exists a getLocalModel method but no setLocalModel method!
> 
> Thank you for your time,
> 

If you are looking at the source for the m_ fields you might have noticed that m_localModel is set in the buildTree public method?

Normally you want to use the API public methods and not directly access the fields. This is java encapsulation right?

If you find you have to access a non-public field you can subclass. I have done this once or twice. The subclass is usually pretty simple just provide access to the needed field and leave everything else to the superclass.

Of course I am not familiar with this class and the developers can probably give you better information as to it’s use.

_______________________________________________
Wekalist mailing list -- [email protected]
Send posts to [email protected]
To unsubscribe send an email to [email protected]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html