TipsMake

Perceptron test

Create new unknown points and test whether your perceptron can correctly predict the answer.

  • A perceptron needs to be inspected and evaluated.
  • A perceptron needs to be tested with real values.

Check your library

Create new unknown points and test whether your perceptron can correctly predict the answer:

 

For example:

// Test Against Unknown Data const counter = 500; for (let i = 0; i < counter; i++) { let x = Math.random() * xMax; let y = Math.random() * yMax; let guess = ptron.activate([x, y, ptron.bias]); let color = "black"; if (guess == 0) color = "blue"; plotter.plotPoint(x, y, color); }

Error counting

Add a tool to count the number of errors:

For example:

// Test Against Unknown Data const counter = 500; let errors = 0; for (let i = 0; i < counter; i++) { let x = Math.random() * xMax; let y = Math.random() * yMax; let guess = ptron.activate([x, y, ptron.bias]); let color = "black"; if (guess == 0) color = "blue"; plotter.plotPoint(x, y, color); if ((y > f(x) && guess == 0) || (y < f(x) && guess == 1)) {errors++} }

Perceptron adjustment

How do you tune a Perceptron? Here are some suggestions:

  • Adjust the learning pace.
  • Increase the amount of training data.
  • Increase the number of training repetitions.

Discover more

Perceptron
David Pac

Share by

David Pac
Update 05 March 2026