Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#1481·ml5-library

New m15 Coder, couldn't find answer online, Error "Error in oneHot: depth must be >=2, but it is 1"

Author: TheCocoaGamerCreated Apr 2, 2024Updated May 8, 2024

Dear ml5 community,

I'm submitting a new issue. Please see the details below, I tried to look online for the issue but no one seems to have the problem I'm having.

→ Step 1: Describe the issue

Normalizing my data gives out an error - "Error in oneHot: depth must be >=2, but it is 1", which I saw online was because only 1 variable was assigned to the ouput instead of 2+, but I do have 2 output variables.

→ Step 2: Screenshots or Relevant Documentation

(The code to collect the data works, it uses an online csv file and the code will work without the normalize function in the picture)

image image

→ Step 3: Share an example of the issue

Heres my p5.js sketch: https://editor.p5js.org/TheCocoaGamer/sketches/lHOj_KW75 And the code will work without the normalize function however since the data is not normalized the predicted data is often unreliable.

→ Describe your setup

Here's some helpful information about my setup...

  • Web browser & version: Opera Browser GX up to date

  • Operating System: Win 10 64x

  • ml5 version you're using: 0.4.2

  • Any additional notes

  • I have decent coding experience so no need to dumb down too much (unless the solution is really obv then feel free to).

Source: ml5js/ml5-library

View original on GitHubView discussion on GitHub