safwank/Numerix
{ "createdAt": "2016-04-27T22:39:13Z", "defaultBranch": "master", "description": "A collection of useful mathematical functions in Elixir with a slant towards statistics, linear algebra and machine learning", "fullName": "safwank/Numerix", "homepage": "", "language": "Elixir", "name": "Numerix", "pushedAt": "2021-05-30T22:44:10Z", "stargazersCount": 191, "topics": [ "linear-algebra", "machine-learning", "math", "statistics" ], "updatedAt": "2025-09-22T07:22:24Z", "url": "https://github.com/safwank/Numerix"}Numerix
Section titled “Numerix”A collection of useful mathematical functions in Elixir with a slant towards statistics, linear algebra and machine learning.
Installation
Section titled “Installation”Add numerix to your list of dependencies in mix.exs:
def deps do [{:numerix, "~> 0.6"}] endEnsure numerix and its dependencies are started before your application:
def application do [applications: [:numerix, :gen_stage, :flow]] endExamples
Section titled “Examples”Check out the tests for examples.
Documentation
Section titled “Documentation”Check out the API reference for the latest documentation.
Features
Section titled “Features”Tensor API
Section titled “Tensor API”Numerix now includes a Tensor API that lets you implement complex math functions with little code, similar to what you get from numpy. And since Numerix is written in Elixir, it uses Flow to run independent pieces of computation in parallel to speed things up. Depending on the type of calculations you’re doing, the bigger the data and the more cores you have, the faster it gets.
NOTE: Parallelization can only get you so far. In terms of raw speed, a pure Elixir solution will always be much slower compared to one that leverages low-level routines like BLAS or similar.
Statistics
Section titled “Statistics”- Mean
- Weighted mean
- Median
- Mode
- Range
- Variance
- Population variance
- Standard deviation
- Population standard deviation
- Moment
- Kurtosis
- Skewness
- Covariance
- Weighted covariance
- Population covariance
- Quantile
- Percentile
Correlation functions
Section titled “Correlation functions”- Pearson
- Weighted Pearson
Distance functions
Section titled “Distance functions”- Mean squared error (MSE)
- Root mean square error (RMSE)
- Pearson
- Minkowski
- Euclidean
- Manhattan
- Jaccard
General math functions
Section titled “General math functions”- nth root
Special functions
Section titled “Special functions”- Logit
- Logistic
Window functions
Section titled “Window functions”- Gaussian
Linear algebra
Section titled “Linear algebra”- Dot product
- L1-norm
- L2-norm
- p-norm
- Vector subtraction and multiplication
Linear regression
Section titled “Linear regression”- Least squares best fit
- Prediction
- R-squared
Kernel functions
Section titled “Kernel functions”- RBF
Optimization
Section titled “Optimization”- Genetic algorithms
Neural network activation functions
Section titled “Neural network activation functions”- softmax
- softplus
- softsign
- sigmoid
- ReLU, leaky ReLU, ELU and SELU
- tanh