# Outcome of a Neural Network is too good. Where did I go wrong

**URL:** <https://forum.knime.com/t/outcome-of-a-neural-network-is-too-good-where-did-i-go-wrong/72596>\
**Category:** KNIME Analytics Platform\
**Created:** [September 13, 2023, 2:06pm UTC](https://forum.knime.com/t/outcome-of-a-neural-network-is-too-good-where-did-i-go-wrong/72596 "2023-09-13T14:06:36Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [September 14, 2023, 7:25pm UTC](https://forum.knime.com/t/outcome-of-a-neural-network-is-too-good-where-did-i-go-wrong/72596/7 "2023-09-14T19:25:24Z")

</div>

@fath1 first I think you will have to sort out the thing with your test and training data. This seems strange.

When you just use the training data and split them and train a model you get quite decent values with GBM models. Since this data is unbalanced you might opt for [AUCPR](https://forum.knime.com/t/help-with-svm-algorithm-under-optimization-loop/48070/7) as the deciding metric if you want to focus on the top group of Active=1.

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/9/2/92a9b1ad7d0e5bbcfd81818beb59460c105ce24d.jpeg)

You will have to think about what precision you want to accept and where to put the threshold - this very much depends on what happens to the wrongly classified cases. In this example: what would it mean if the 23 cases which are considered by the model to be 1 are in fact 0 and you would have acted upon the decision.

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/e/2/e24736477cb42fa9965698b2a1ccd243a792e062.jpeg)

Then you might want to take a look at the data itself. I have no idea about the (business/scientific) domain of the case. With a quick GBM model 3 “Bits” take a significant amount of ‘explaining’ power. You might want to check with experts if this does make any sense. “Bit 9” is very prominent.

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/0/7/0765222dffdd12e7d2b4c9d9234c7680bc21aabe.jpeg)

Since you have some 150+ variables you might think about some data engineering and data preparation. Maybe bring the number down to half of them. I have written an article about how to do that in an automatic way with the help of vtreat, but there are other techniques of dimension reduction ([thread 1](https://forum.knime.com/t/random-forest-evaluating-attribute-usage/27848/2), [thread 2](https://forum.knime.com/t/t-sne-how-to-use-in-production-pipeline/49365/6)).

> **[Data preparation for Machine Learning with KNIME and the Python “vtreat” package](https://medium.com/low-code-for-advanced-data-science/data-preparation-for-machine-learning-with-knime-and-the-python-vtreat-package-efcaf58fa783)**
>
> TL;DR: Speed up your ML data preparation with the great Python package vtreat and just a few lines of code — wrapped in a convenient KNIME…

More ideas being discussed here:

> [@MEDICAL DATA](https://forum.knime.com/t/medical-data/61205/4):
>
> @helfortuny this sounds like an interesting study. These things come to my mind: You indeed have a lot of variables that will need some preprocessing. One thing you could try is read about [vtreat](https://medium.com/low-code-for-advanced-data-science/data-preparation-for-machine-learning-with-knime-and-the-python-vtreat-package-efcaf58fa783) [you can find KNIME [workflows for that here](https://hub.knime.com/-/spaces/-/latest/~tgdedu04tUX8ldcC/)] and try that with your target and see what recommendations would be made to see if it makes any difference. You might have tried and removed [highly correlated variables](https://hub.knime.com/knime/extensions/org.knime.features.base/latest/org.knime.base.node.preproc.correlation.filter.CorrelationFilterNodeFactory/). At the end of the vtreat article there are links to other dimension reduction techniques…

The workflow used with your data is here:

> **[KNIME forum - binary machine-learning task (72596) – mlauber71](https://hub.knime.com/mlauber71/spaces/Forum/2023/kn_forum_72596_binary_classification_h2o~oPfT9HCVpSatQ2bR/current-state)**
>
> KNIME forum - binary machine-learning task (72596) https://forum.knime.com/t/outcome-of-a-neural-network-is-too-good-where-did-i-go-wrong/72596/7?u=mlauber71

---

_[View the full topic](https://forum.knime.com/t/outcome-of-a-neural-network-is-too-good-where-did-i-go-wrong/72596)._
