[R] bnlearn and TAN network

ross.chapman at ecogeonomix.com ross.chapman at ecogeonomix.com
Mon Feb 29 10:51:25 CET 2016


Hi Marco

Thanks for your quick response

>-----Original Message-----
>From: Marco Scutari [mailto:marco.scutari at gmail.com] 
>Sent: Monday, 29 February 2016 8:24 PM
>To: ross.chapman at ecogeonomix.com
>Cc: r-help <r-help at r-project.org>
>Subject: Re: [R] bnlearn and TAN network
>
>Hi Ross,
>
>On 29 February 2016 at 08:46,  <ross.chapman at ecogeonomix.com> wrote:
>> The graph shows arcs between each of the variables and the output node
>> (classFFB) along with internal nodes showing parent/child relations 
>> between
>> 4 nodes.
>
>Yes, that is as expected.
>
>> However, when I look at the model in the TAN object and the 
> >conditional probabilities in the fitted object, there is only one 
>> direct arc leading to output node (classFFB) through a variable EST, 
>> all other relations act through that arc.
>
>I am not sure how that could possibly happen, could you share the print outut for a few nodes so that I can get some idea of what it is going on?

When I look at the model in Tan I get this output:

> TAN

  Bayesian network Classifier

  model:
   [classFFB][matureTreeData.ESTATE|classFFB][matureTreeData.YEAR|classFFB:matureTreeData.ESTATE][matureTreeData.SMG|classFFB:matureTreeData.ESTATE]
   [classNPKMg3YW_IN|classFFB:matureTreeData.YEAR][classHarvIntensity|classFFB:matureTreeData.YEAR]
  nodes:                                 6 
  arcs:                                  9 
    undirected arcs:                     0 
    directed arcs:                       9 
  average markov blanket size:           3.00 
  average neighbourhood size:            3.00 
  average branching factor:              1.50 

  learning algorithm:                    TAN Bayes Classifier 
  mutual information estimator:          Maximum Likelihood (disc.) 
  training node:                         classFFB 
  tests used in the learning procedure:  10

The output node is classFFB.  My understanding is that the model only has one node linked directly to the output node: ][matureTreeData.ESTATE|classFFB].

Have I missed something here?

>
>> Am I correct in interpreting that the all direct nodes except for
>> EST->classFFB which are shown in the graphviz.plot are not retained 
>> EST->once the
>> model is trained. In which case, is there a way of showing the network 
>> after training?

>TAN does not do any sort of feature selection, so all the nodes should be there. As for "showing the network after training", what kind of plot are you looking for?

I was looking for  a plot which shows the learned network, an example of which I have attached.



>Cheers,
  >  Marco


-------------- next part --------------
A non-text attachment was scrubbed...
Name: Rplotdemo.png
Type: image/png
Size: 6430 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20160229/7fa207b1/attachment.png>


More information about the R-help mailing list