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

data-preprocessing

v1.1.0

Published

A lightweight data preprocessing library for cleaning datasets—handles missing values, duplicates, and feature correlations with ease.

Readme

data-preprocessing

A flexible JavaScript data preprocessing library for cleaning datasets. Features include removing constant and duplicate columns, filtering columns based on numeric content, and dropping highly correlated features with configurable thresholds—ideal for preparing data for analysis and machine learning. It provides easy-to-use functions for:

✅ Handling missing values (imputation or row/column removal)
✅ Removing duplicate records
✅ Detecting & dropping highly correlated columns
✅ Scaling and normalizing numerical data
✅ Encoding categorical variables

💡 Perfect for developers working with structured datasets in JavaScript/Node.js.


🔧 Preprocessing Configuration Options

The data preprocessing utility provides configurable options to clean and optimize your dataset before analysis or machine learning tasks. Below is a detailed explanation of each supported option:


numeric_threshold (default: 0.7)

Specifies the minimum percentage of numeric values required for a column to be treated as a numeric feature. Columns that do not meet this threshold will be considered non-numeric and may be excluded from numeric-only operations (like correlation analysis).

  • Type: number (between 0 and 1)
  • Example: If numeric_threshold = 0.7, a column must have at least 70% numeric entries to be retained as numeric.

remove_character_columns (default: true)

Controls whether columns containing character or alphanumeric values are automatically removed.

  • When set to true (default), such columns will be excluded during preprocessing.
  • When set to false, character/alphanumeric columns (and any rows containing them) will be retained.
    • In this case, the utility will still clean empty rows and columns, but it will not perform the following checks:
      • Removal of constant columns
      • Removal of duplicate columns
      • Removal of correlated columns

remove_constant_columns (default: true)

Enables automatic removal of constant columns — i.e., columns where all values are the same or contain only one unique value.

  • Such columns add no predictive power or variability and are usually safe to discard.
  • Recommended for almost all preprocessing pipelines.

remove_duplicate_columns (default: true)

Enables removal of columns that are exact duplicates of each other.

  • These columns are redundant and can inflate dimensionality without providing extra information.
  • The utility detects and removes one copy from each duplicate group.

remove_correlated_columns (default: true)

Activates the detection and removal of highly correlated features (based on Pearson correlation).

  • Helps reduce multicollinearity and model overfitting.
  • Particularly useful when training models that assume feature independence (e.g., linear regression).

correlation_coefficient_magnitude (default: 0.8)

Defines the threshold for high correlation between pairs of numeric columns. If the absolute value of the Pearson correlation coefficient between two columns exceeds this threshold, one of them will be removed.

  • Type: number (between 0 and 1)
  • Example: If correlation_coefficient_magnitude = 0.8, any pair of columns with correlation > 0.8 or < -0.8 will be considered redundant.

🔄 Example Configuration

preprocessDataset(data, {
  numeric_threshold: 0.7,
  remove_constant_columns: true,
  remove_duplicate_columns: true,
  remove_correlated_columns: true,
  correlation_coefficient_magnitude: 0.8
});

This setup will:

  • Keep only numeric columns with ≥ 70% numeric values
  • Drop constant and duplicate columns
  • Drop one of each pair of columns that are ≥ 80% correlated