aik84

0.0.1 • Public • Published

aik84.js

This library provides various functions for common tasks like random number generation, descriptive statistics, normalization, factorial, sigmoid, kinetic energy, Euclidean distance and Manhattan distance.

Version: 0.0.1

Author: Kalinin Alexandr https://github.com/aik84from

Calculates the sigmoid function

console.log(sigmoid(1.8) == 0.8581489350995123);

Factorial

console.log(factorial(4) == 24);

Kinetic Energy

console.log(kineticEnergy(18, 22) == 4356);

Normalization

console.log(minMaxNormalization([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]));

Descriptive Statistics

console.log(max([0, 1, 2, 3, 4]) == 4);
console.log(min([0, 1, 2, 3, 4]) == 0);
console.log(avg([0, 1, 2, 3, 4]) == 2);
console.log(sum([0, 1, 2, 3, 4]) == 10);
console.log(median([0, 1, 2, 3, 4]) == 2);

Distance

console.log(euclideanDistance([4, 9, 12], [7, 33, 14]) == 24.269322199023193);
console.log(manhattanDistance([4, 9, 12], [7, 33, 14]) == 29);

Random

console.log(getRandomInt(10, 50));
console.log(getRandomElement([0, 1, 2, 3, 4, 5]));
console.log(getRandomElements([0, 1, 2, 3, 4, 5], 3));
console.log(shuffle([0, 1, 2, 3, 4, 5]));

Package Sidebar

Install

npm i aik84

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

4.8 kB

Total Files

3

Last publish

Collaborators

  • aik84from