JavaScript and Machine Learning

Some Algorithms and Samples

By @ajlopez

Using reveal.js

Machine Learning


The science of getting computers to act without being explicitly programmed

The construction and study of algorithms that can learn from and make predictions on data

The creation of a model from example inputs in order to make data-driven predictions or decisions

Learning from experience either with or without supervision from humans


  • K-Nearest Neighbours
  • Decision Trees
  • Support Vector Machines
  • Neural Networks
  • Genetic Algorithms
  • Evolutionary Programs
  • Distributed ...
  • ...

Decision Trees



Genetic Algorithms

Search for a Solution to a Problem

Stochastic Search Algorithms

Essentially, Reinformence Learning Algorithms: Fitness


  • Represents a solution/individual
  • Composed by "genes"
  • Evaluation of Performance
  • Mutation
  • Crossover

Generic Structure

## Creating and Running Populations ```js for (var k = 0; k < 1000; k++) genotypes.push(Path.createGenotype(/* ... */)); var mutators = []; for (var k = 0; k < 4; k++) mutators.push(Path.createMutator()); engine = new simplega.Engine({ minimize: true }); engine.setPopulation(genotypes); engine.setMutators(mutators); // var newgenotypes = engine.nextPopulation(); best = simplega.getBestGenotype(newgenotypes, { minimize: true }); ```

Path Sample

Evolutionary Programs

Evolving Animals

Codified Program

Bloomberg Stock Trading Game

Systematic Trading

The End

BY Angel 'Java' Lopez / @ajlopez