npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

dtc-ml

v1.0.0

Published

Custom ML library for Node.JS

Downloads

3

Readme

dtc-machiene-learning

A light weigh JS utility for basic and quick ML problems produced by DownToCrypto

Motovation

I was looking to create a simple ans easy to use utility for AI to aid in automated trading.

Tech

Node JS palne and simple

Features

At this point it is still in its infancy. As such it is simply an easy to use genetic optomization tool. More NL and deep learning is to come.

Examples

Genetic Optomization

Gene Types

  • GeneTypes.int: any real integer value
  • GeneTypes.float: any real float value
  • GeneTypes.bool: true or false

GeneTypes.int and GeneTypes.float have a default min and max of +/-10

Mutation Types

  • MutationTypes.uniform: sets the gene to a random number between the min and max inclusivly
  • MutationTypes.boundry: sets the gene to the max or min at random
  • MutationTypes.percent: changes the value to within +/- the specafied percent of the current value at random

Putting it all together

Alaways start with

const {
  Population,
  MutationTypes,
  GeneTypes,
} = require("dtc-ml").Genetic;

Making the Organisms

const buildingblocks = [
{ type: GeneTypes.int, min: 0, max: 10 },
{ type: GeneTypes.int, min: 0, max: 10 },
];

Making the fitness test for the population

function FitnessTest(individual) {
  return individual[0].value * individual[1].value;
}

Making a population of 100 organisms out of the building blocks

const populationSize = 100;
let population = new Population(populationSize, buildingblocks, FitnessTest);

Randomizes all of the genes for a population

population.randomize();

Running the fitness test and score all individuals

population.runFitnessTests();

Cache any individuals to save time down the road. This is optional

population.saveFamilyTree();

Determin breeding pool based off individual scores

population.selection();

Breed next generation and determine what percentage of the top performers carry over to the next generation

population.breed(0.05);//top 5% stay till next generation

Mutate the population based on the selected method and percentage rate

population.mutate(MutationTypes.uniform, 0.05);

The "transitionToNextGeneration" method rolls selection, breed and mutate into 1 call.

population.transitionToNextGeneration(0, MutationTypes.uniform, 0.05);

Here is it all together with some periferals to record the findings

const {
  Population,
  MutationTypes,
  GeneTypes,
} = require("dtc-ml");

const buildingblocks = [
  { type: GeneTypes.int, min: 0, max: 10 },
  { type: GeneTypes.int, min: 0, max: 10 },
];

function FitnessTest(individual) {
  return individual[0].value * individual[1].value;
}

const populationSize = 100;

let population = new Population(populationSize, buildingblocks, FitnessTest);

population.randomize();

const generations = 10;

for (let i = 1; i <= generations; i++) {
  population.runFitnessTests();
  population.saveFamilyTree();
  if (i !== generations) {
    population.transitionToNextGeneration(0.1, MutationTypes.uniform, 0.05);
  }
}

console.log(population.getFittest());

The outshould be the below. Note there is some randomness involved so you may get a gene that has a value of 9. If you do just run it again.

Individual(2) [
  Int { min: 0, max: 10, value: 10 },
  Int { min: 0, max: 10, value: 10 },
  fitness: 100,
  id: 46724426
]

Coming Soon

  • Built in exit conditions for genetic learning
  • "runGenerations" method to contain for loop internally to the population class
  • Neurons