Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ml-array-rescale

Package Overview
Dependencies
Maintainers
4
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ml-array-rescale

Rescale an array into a range

  • 1.3.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
176K
decreased by-13.24%
Maintainers
4
Weekly downloads
 
Created

What is ml-array-rescale?

The ml-array-rescale npm package is used to rescale arrays to a specified range. This can be particularly useful in data preprocessing for machine learning tasks, where normalizing or standardizing data is a common step.

What are ml-array-rescale's main functionalities?

Rescale array to a specified range

This feature allows you to rescale an array to a specified range. In this example, the array [1, 2, 3, 4, 5] is rescaled to the range [0, 1].

const rescale = require('ml-array-rescale');
const array = [1, 2, 3, 4, 5];
const rescaledArray = rescale(array, {min: 0, max: 1});
console.log(rescaledArray); // Output: [0, 0.25, 0.5, 0.75, 1]

Rescale array with default range

This feature allows you to rescale an array to the default range [0, 1] if no range is specified. In this example, the array [10, 20, 30, 40, 50] is rescaled to the range [0, 1].

const rescale = require('ml-array-rescale');
const array = [10, 20, 30, 40, 50];
const rescaledArray = rescale(array);
console.log(rescaledArray); // Output: [0, 0.25, 0.5, 0.75, 1]

Other packages similar to ml-array-rescale

FAQs

Package last updated on 01 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc