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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ferrow/ml-data-pipeline

v2.0.0

Published

Lightweight tabular data prep, no tensor deps: column typing, normalize/standardize with saved fit params, one-hot encoding, seeded shuffle, train/test split, simple imputation, and a chainable Pipeline that serializes its fitted params.

Readme

ml-data-pipeline

CI

Lightweight tabular data prep — no tensor/ML framework dependency. Column typing, normalization, one-hot encoding, seeded shuffling, splitting, and imputation, all built around a fit/transform split: params are computed once on training data and then replayed on other data, so you can't accidentally leak test-set statistics into your features.

What this is

  • inferColumnTypes(data) — numeric vs categorical, per column.
  • fitMinMax / applyMinMax and fitZScore / applyZScore — normalization and standardization, each split into a fit step (computes params from data) and an apply step (uses SAVED params — never recomputed from whatever data you pass it).
  • fitOneHot / applyOneHot — one-hot encoding with an explicit unseen- category policy: 'ignore' (all-zero row), 'error' (throws), or 'extra-column' (<column>_unknown).
  • mulberry32(seed) — a small seeded PRNG; seededShuffle(data, seed) — deterministic Fisher-Yates shuffle built on it.
  • trainTestSplit(data, ratio, seed) — seeded shuffle-then-slice.
  • fitImpute / applyImpute — mean / mode / constant imputation, same fit/apply split.
  • Pipeline — chains steps (.impute(), .minmax(), .zscore(), .onehot()), .fit(train) computes and stores every step's params, .transform(anyData) replays those saved params, and .toJSON() / Pipeline.fromJSON() serialize/restore the fitted state.

What this is NOT

  • No tensors, no GPU, no model training — this is preprocessing only.
  • No CSV/file I/O — bring your own parsed Row[] (Record<string, string | number | null>).
  • No image/text feature extraction — tabular columns only.

Quickstart

npm install
npm run build
node dist/examples/demo.js

API

import { Pipeline, trainTestSplit } from 'ml-data-pipeline';

const { train, test } = trainTestSplit(data, 0.75, 7); // seed=7, deterministic

const pipeline = new Pipeline().minmax('age');
pipeline.fit(train);              // computes min/max from TRAIN only
const testOut = pipeline.transform(test); // applies TRAIN's min/max to test

const saved = pipeline.toJSON();
const restored = Pipeline.fromJSON(saved);

Demo: proving no leakage

examples/demo.ts fits a min-max scaler on the train split, transforms the test split, and shows the test output matches a manual calculation done with only the train min/max — never test's own range:

$ node dist/examples/demo.js
train ages: [60, 80, 30, 40, 50, 70]  (min=30, max=80)
test raw ages: [90, 20]
test normalized (via pipeline): [1.2, -0.2]
matches manual TRAIN-param calc: true

Note the test values fall outside [0, 1] — expected, since they're scaled by the training range, not their own.

License

MIT


Sponsored by Ferrow


Part of the ferrow-toolkit collection · Sponsored by Ferrow