HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Generate new unknown points and check if your Perceptron can guess the right answers
Generate new unknown points and check if your Perceptron can guess the right answers:
// 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);
}
Add a counter to count the number of errors:
// 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) {errors++}
}
How can you tune the Perceptron?
Here are some suggestions: