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 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-data-preprocessing

v1.3.0

Published

A node package for data preprocessing.

Downloads

6

Readme

node-data-preprocessing

Build Status Code Climate

A node package for data preprocessing.

The package exposes the individual steps, as well as one to the entire process.

Individual Steps

csvParser

var data = process.csvParser(options);

options

List of options with defaults -

var options = {
    path: ''
};
path

String - The path to the data.

extract

var extracted = process.extract(options, data);

options

List of options with defaults -

var options = {
    useHeaders: 'true'
};
useHeaders

Boolean - Indicates whether the first row of data is the heading or not. Note - The heading will not be used in the process. Setting it to true simply strips the first row from the data.

cleanse

var cleansed = process.cleanse(options, data);

options

List of options with defaults -

var options = {
    formats: [],
    ranges: []
};
formats

Array - of strings representing the formats that the fields should be. The string should match the result of typeof() applied to the expected data format.

ranges

Array - of objects, such that { 'validatorName': 'validatorValue' }.

validators

Available validators -

  • greater - expects value, min, returns value > min;
  • greaterOrEqual - expects value, min, returns value >= min;
  • less - expects value, max, returns value > max;
  • lessOrEqual - expects value, max, returns value > max;
  • between - expects value, range, where range is a string such that 'min-max', and returns greater(value, min) && less(value, max);
  • betweenOrEqual - expects value, range, where range is a string such that 'min-max', and returns greaterOrEqual(value, min) && lessOrEqual(value, max);

standardise

var standardised = process.standardise(options, data);

options

List of options with defaults -

var options = {
    min: 0.1,
    max: 0.9,
    standardisationMethod: 'default'
};
min

number - The minimum value for the standardisation.

max

number - The maximum value for the standardisation.

standardisationMethod

string - Can be default, normal or ss (Sum of Squares).

ignore

Array - of integers representing columns of the data to ignore while standardising. They will retain their non-standardised values.

divide

var divided = process.divide(options, data);

options

List of options with defaults -

var options = {
    split: [60, 20, 20]
};
split

Array - Indicates how many subsets the data should be split into, and with what weighting.

process (combined)

var result = process.process(options);

options

The combined proces takes all the options that the individual steps take, in one object.

var options = {
    path: '',
    useHeaders: true,
    formats: [],
    min: 0.1,
    max: 0.9,
    standardisationMethod: 'default',
    split: [60, 20, 20]
};