# Node-red-contrib-machine-learning (Question)

**URL:** <https://discourse.nodered.org/t/node-red-contrib-machine-learning-question/60759>\
**Category:** General\
**Created:** [4 April 2022 09:40 UTC](https://discourse.nodered.org/t/node-red-contrib-machine-learning-question/60759 "2022-04-04T09:40:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thar](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thar/32/59532_2.png) [@Thar](https://discourse.nodered.org/u/Thar)\
**Post date:** [4 April 2022 09:40 UTC](https://discourse.nodered.org/t/node-red-contrib-machine-learning-question/60759/1 "2022-04-04T09:40:49Z")

</div>

Hello, I want to know about the result 0.9333333333333 is good or bad in this flow node-red? You can find the flow chart in here : [node-red-contrib-machine-learning (node) - Node-RED (nodered.org)](https://flows.nodered.org/node/node-red-contrib-machine-learning).  
And here is my assessment python code --

```auto
import sklearn.metrics as m
import json
import sys
import numpy
from inspect import getfullargspec
#import inspect

#read configurations
config = json.loads(input())

while True:
        #read request
        data = json.loads(input())

        get_score = getattr(m, config['score'])
        kwargs = {}
        if 'average' in getfullargspec(get_score).args:
                kwargs['average'] = 'micro'
        if 'beta' in getfullargspec(get_score).args:
                kwargs['beta'] = 1
        score = get_score(data['real'], data['predicted'], **kwargs)
        if type(score) is numpy.ndarray:
                score = json.dumps(score.tolist())
        print(score)

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [3 June 2022 09:41 UTC](https://discourse.nodered.org/t/node-red-contrib-machine-learning-question/60759/2 "2022-06-03T09:41:32Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
