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

starlight-preprocess

v1.0.0

Published

Preprocessing utilities for machine learning in Starlight

Readme

starlight-preprocess

Starlight Preprocess is a lightweight preprocessing library for machine learning in the Starlight ecosystem. It provides common data transformation tools such as scaling, encoding, and dataset splitting — designed to work seamlessly with other Starlight ML packages.


Features

  • Feature Scaling

  • StandardScaler (mean = 0, std = 1)

  • MinMaxScaler (range 0–1)

  • Label Encoding

  • LabelEncoder (class → integer)

  • OneHotEncoder (categorical → binary vectors)

  • Dataset Splitting

  • Train / Test split utility

  • Pipeline Friendly

  • Works with starlight-regression, starlight-classifier, starlight-cluster

  • Designed for starlight-pipeline


Installation

npm install starlight-preprocess

Usage Examples

Standard Scaling

import { StandardScaler } from "starlight-preprocess";

const X = [
  [1, 10],
  [2, 20],
  [3, 30]
];

const scaler = new StandardScaler();
const XScaled = scaler.fitTransform(X);

console.log(XScaled);

Min-Max Scaling

import { MinMaxScaler } from "starlight-preprocess";

const scaler = new MinMaxScaler();
const normalized = scaler.fitTransform(X);

Label Encoding

import { LabelEncoder } from "starlight-preprocess";

const labels = ["cat", "dog", "cat", "bird"];

const encoder = new LabelEncoder();
const encoded = encoder.fitTransform(labels);

console.log(encoded);
// [0, 1, 0, 2]

One-Hot Encoding

import { OneHotEncoder } from "starlight-preprocess";

const encoder = new OneHotEncoder();
const oneHot = encoder.fitTransform(["red", "blue", "red"]);

console.log(oneHot);
// [[1,0],[0,1],[1,0]]

Train / Test Split

import { trainTestSplit } from "starlight-preprocess";

const X = [[1], [2], [3], [4], [5]];
const y = [2, 4, 6, 8, 10];

const { XTrain, XTest, yTrain, yTest } =
  trainTestSplit(X, y, 0.2);

console.log(XTrain, XTest);

API Overview

Scalers

  • StandardScaler
  • MinMaxScaler

Methods

  • fit(X)
  • transform(X)
  • fitTransform(X)

Encoders

  • LabelEncoder
  • OneHotEncoder

Methods

  • fit(values)
  • transform(values)
  • fitTransform(values)
  • inverseTransform() (LabelEncoder)

Utilities

  • trainTestSplit(X, y, testSize = 0.2, shuffle = true)

Works Great With

  • starlight-ml
  • starlight-vec
  • starlight-classifier
  • starlight-regression
  • starlight-cluster
  • starlight-pipeline

License

MIT License © Dominex Macedon


Roadmap

  • Missing value handling
  • Text normalization helpers
  • Image preprocessing
  • Auto-preprocessing in pipelines