question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it okay to use Brain.JS to sort products in Web Shop?

See original GitHub issue

A GIF or MEME to give some spice of the internet

The Project

We are running our own-coded web shop with dozen of products. There are around 100.000 different products, where around 50.000 categorized (are linked to category, for example HP LaserJet MFP 2000 -> Printer) and another 50.000 don’t have any category. The only possible train data would be like this JSON:

  [{
    "input": "Toner schwarz für HP Laserjet P3015 12.500 Seiten",
    "output": "Toner"
  },
  {
    "input": "alternativ Toner Brother MFC 9142 2.200 Seiten cyan",
    "output": "Toner"
  },
  {
    "input": "Laserdrucker HL-L6300DW inkl. UHG, Filter und Halterung mit intregiertem NFC-Kartenleser, 46 Seiten/Minute Druckgeschwindigkeit, 520 Blatt-Papierkassette, Auflösung 1200 x 1200 dpi, USB 2.0 Hi-Speed, LAN, WLAN, integrierte BSI-Schnitt- stelle, 4,5 cm Touc",
    "output": "Laserdrucker"
  },
  {
    "input": "Laserdrucker HL-L6400DW inkl. UHG, mit intregiertem NFC-Kartenleser,, Brother",
    "output": "Laserdrucker"
  }]

How important is this (1-5)?

3

Expected behavior

By checking “Toner TN-3430, schwarz für DCP-L5500DN, DCP-L6600DW, HL-L5000D, Brother” get “Toner” Category.

Other Comments

Would it be wise to use Brain.JS for that? That would probably take years to train over 50k items?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Macilcommented, Apr 26, 2019

When the output is a string, brain.js doesn’t recognize the output as a distinct category label. If you have some training items with the output “foo”, and other training items with the output “bar”, Brain.js learns logic like “for items like the first group, include the ‘o’ and ‘f’ characters more often in the output than ‘a’, ‘b’, and ‘r’”.

You should have the output be {foo: 1} for things in the “foo” category and {bar: 1} for things in the “bar” category. Then your output will be like {foo: 0.8, bar: 0.1} for things that Brain thinks probably belong in “foo”, etc.

0reactions
mubaidrcommented, Oct 4, 2019

Should be 1, 0. just like probability (max is always 1).

Read more comments on GitHub >

github_iconTop Results From Across the Web

An introduction to deep learning with Brain.js - LogRocket Blog
Using Brain.js is a fantastic way to build a neural network. It learns the patterns and relationship between the inputs and output in...
Read more >
Neural Networks with JavaScript - Full Course using Brain.js
This course gives you a practical introduction to building neural networks in the browser and in Node.js using the Brain. js JavaScript ...
Read more >
Beginner's Guide To Neural Networks In JavaScript With Brain.js
You'll learn how to apply Neural Networks by using a JavaScript library ... that if you click on one of the product links...
Read more >
use brain.js ( neural network in js ) to learn contrast of ...
There is a provided demo that shows how to train the neural network to recognise colour contrast, but how can I set it...
Read more >
Want to learn neural networks? Here's a free Brain.js course!
Brain.js also has a nice feature which allows it to work with objects. So in this tutorial, Robert explains how to do exactly...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found