Skip to content

XL-ML/XL-ML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

icon

XLML: Machine Learning for Elixir

Elixir is a favorite among functional programmers and other enthusiasts. Support for native machine learning in Elixir, specifically regresssion algorithms, seems to be lacking for this erlang based language. Through XL-ML, we bring ML algorithms, completely vectorized with Nx to the Elixir community.

Examples

For most algorithms, all that is required is passing data and labels, getting a parameters object, and passing that in for future predictions and evaluation.

An example is given below. All data is assumed to be of type Nx.tensor.

x = Nx.tensor([[1, 2], [2, 4]])
y =  Nx.tensor([2, 4])

After setting up data, we are ready to train.

params = Regressor.LinReg.fit(x, y, epochs: 1000, lr: 0.0001)

With these params we can compute a metric:

r2_score = Regressor.LinReg.metric(x_test, y_test, params)

The most intuitive metric is selected for each algorithm (e.g., r^2 for regression or reconstruction error for PCA).

As can be seen, XL-ML is efficient, optimized, and descriptive.

Algorithms

A list of all algorithms in production is listed below.

Regression

  • Linear
  • Logistic
  • Softmax
  • Probit

Clustering

  • K-Nearest Neighbors Classification

Dimensionality Reduction

  • Principal Component Analysis (PCA)

About

A unique elixir machine learning framework that provides various ML algorithms.

https://hex.pm/packages/xlml

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages