# Question about DrawNetwork in TMLPAnalyzer

**URL:** <https://root-forum.cern.ch/t/question-about-drawnetwork-in-tmlpanalyzer/55789>\
**Category:** Newbie\
**Tags:** tmva, root\
**Created:** [July 21, 2023, 7:22pm UTC](https://root-forum.cern.ch/t/question-about-drawnetwork-in-tmlpanalyzer/55789 "2023-07-21T19:22:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mortonia](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/e9a140/32.png) [@mortonia](https://root-forum.cern.ch/u/mortonia)\
**Post date:** [July 21, 2023, 7:22pm UTC](https://root-forum.cern.ch/t/question-about-drawnetwork-in-tmlpanalyzer/55789/1 "2023-07-21T19:22:16Z")

</div>

* * *

_Please read [tips for efficient and successful posting](https://root-forum.cern.ch/t/tips-for-efficient-and-successful-posting/28292) and [posting code](https://root-forum.cern.ch/t/posting-code-read-this-first/28293)_

_ROOT Version:_ 6.22/06  
_Platform:_ Ubuntu  
_Compiler:_ Not Provided

* * *

Dear ROOT community,

Hello! This is my first post here.

I’m attempting to classify particles using the TMultiLayerPerceptron class given two root files. One file has certain cuts of one particle, and another has cuts of the other. I’m following an example very similar to the mlphiggs.C, but I’m quite confused, and have a few questions:

1. I’m not quite sure what DrawNetwork does in the TMLPAnalyzer class. I am very new to machine learning, so this might be a silly question. What does it mean to have a distribution of the neural network?
2. Let’s say I wanted to classify which particle was which. I’ve been browsing the TMultiLayerPerceptron class and TMLPAnalyzer documentation, and am quite confused on how to make a clear output that would tell me the probability of the output being a certain particle dependent on the event.

That’s all my concerns! Thank you in advance!

---

<div class="post-metadata">

**Author:** ![Axel](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/axel/32/11084_2.png) [@Axel](https://root-forum.cern.ch/u/Axel)\
**Post date:** [July 24, 2023, 10:54am UTC](https://root-forum.cern.ch/t/question-about-drawnetwork-in-tmlpanalyzer/55789/2 "2023-07-24T10:54:34Z")

</div>

Welcome @mortonia and apologies for the slow response! First off I’d recommend _not_ to start with TMultiLayerPercepton but use one of the many existing Python ML classifiers; ROOT has excellent support for training and evaluating them.

We will need @moneta 's input on your actual questions. He is on vacation this week; I hope he will respond here once he’s back!

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [August 7, 2023, 12:07pm UTC](https://root-forum.cern.ch/t/question-about-drawnetwork-in-tmlpanalyzer/55789/3 "2023-08-07T12:07:38Z")

</div>

Hi,  
Apologies for the late reply. DrawNetwork draws the output result from the network, as shown in this  
tutorial, [ROOT: tutorials/legacy/mlp/mlpHiggs.C File Reference](https://root.cern.ch/doc/master/mlpHiggs_8C.html)

For using a MLP for classification, either use existing Python ML libraries as reccomended by Axel, or use ROOT TMVA, see the tutorial [ROOT: tutorials/tmva/TMVAClassification.C File Reference](https://root.cern.ch/doc/master/TMVAClassification_8C.html) where different methods are used.

Best regards

Lorenzo
