Skip to content

Results of NeuralNetwork is unexpected #523

@dougmolineux

Description

@dougmolineux

A GIF or MEME to give some spice of the internet

What is wrong?

Thank you for this wonderful project. I am attempting to create a program that can tell if a person is a child or not with provided height and weight. For some reason, it is telling me the opposite results of what I would expect.

Where does it happen?

In the a NeuralNetwork when trying to the program in node.js on my mac.

How do we replicate the issue?

const brain = require("brain.js");
const net = new brain.NeuralNetwork();

net.train([
  { input: { height: 6, weight: 180 }, output: { notAChild: 1 } },
  { input: { height: 6, weight: 190 }, output: { notAChild: 1 } },
  { input: { height: 6, weight: 193 }, output: { notAChild: 1 } },
  { input: { height: 5, weight: 150 }, output: { notAChild: 1 } },
  { input: { height: 5, weight: 160 }, output: { notAChild: 1 } },
  { input: { height: 5, weight: 164 }, output: { notAChild: 1 } },
  { input: { height: 3, weight: 60 }, output: { child: 1 } },
  { input: { height: 3, weight: 68 }, output: { child: 1 } },
  { input: { height: 3, weight: 69 }, output: { child: 1 } },
])

const output = net.run({ height: 3, weight: 65 }); 
// { notAChild: 0.6541248559951782, child: 0.34587541222572327 }

console.log(output);

How important is this (1-5)?

1 - I maybe doing something wrong here.

Expected behavior (i.e. solution)

I would have expected that when given { height: 3, weight: 65 } it would have given a high likelihood that it IS a child. But it's actually saying its more likely to be a not a child. What am I doing wrong here?

Thanks again!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions