Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mrdimosthenis/emel
A simple and functional machine learning library for the Erlang ecosystem
https://github.com/mrdimosthenis/emel
elixir erlang functional-programming gleam machine-learning
Last synced: about 2 months ago
JSON representation
A simple and functional machine learning library for the Erlang ecosystem
- Host: GitHub
- URL: https://github.com/mrdimosthenis/emel
- Owner: mrdimosthenis
- Created: 2018-11-09T23:44:28.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-08-05T19:30:15.000Z (over 2 years ago)
- Last Synced: 2024-03-15T00:22:19.397Z (9 months ago)
- Topics: elixir, erlang, functional-programming, gleam, machine-learning
- Language: Gleam
- Homepage: https://hexdocs.pm/emel/
- Size: 677 KB
- Stars: 96
- Watchers: 7
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - A simple and functional machine learning library written in elixir. (Algorithms and Data structures)
- fucking-awesome-elixir - emel - A simple and functional machine learning library written in elixir. (Algorithms and Data structures)
- awesome-elixir - emel - A simple and functional machine learning library written in elixir. (Algorithms and Data structures)
- awesome-gleam - emel - [📚](https://hexdocs.pm/emel/) - Turn data into functions in the Erlang ecosystem (Packages / Machine Learning)
README
# emel
Turn data into functions! A simple and functional **machine learning** library, (re)implemented in **Gleam** for the **Erlang** ecosystem.
## Installation
* For **Erlang** projects, add the dependency into `rebar.config`:
```erlang
{deps, [
{emel, "1.0.1"}
]}.
```* For **Elixir** projects, add the dependency into `mix.exs`:
```elixir
defp deps do
[
{:emel, "~> 1.0.1"}
]
end
```* For **Gleam** projects, run `gleam add emel`.
## Examples
### Erlang
```erlang
Data = [
{[7.0, 7.0], "bad"},
{[7.0, 4.0], "bad"},
{[3.0, 4.0], "good"},
{[1.0, 4.0], "good"}
],
F = emel@ml@k_nearest_neighbors:classifier(Data, 3),
F([3.0, 7.0]). % "good"
```
### Elixir```elixir
data = [
{[1.794638, 15.15426], 0.510998918},
{[3.220726, 229.6516], 105.6583692},
{[5.780040, 3480.201], 1776.99}
]
f = :emel@ml@linear_regression.predictor(data)
f.([3.0, 230.0]) # 106.74114058686602
```### Gleam
```gleam
import emel/ml/neural_network as nn
let data = [
#([0.8, 0.0, 0.0], "x"),
#([0.0, 0.9, 0.0], "y"),
#([0.0, 0.0, 0.8], "z"),
]
let f = nn.classifier(
data,
[4], // hidden layers
0.01, // learning rate
0.1, // error threshold
1000 // maximum iterations
)
f([0.0, 0.8, 0.0]) // "y"
```## Documentation
The [documentation](https://hexdocs.pm/emel/1.0.0/) describes all the public functions. **Gleam** developers can pay attention to the type annotations. **Erlang** and **Elixir** devs may take a look at the examples which are written in **Erlang**.
### Implemented Algorithms
* [Linear Regression](https://hexdocs.pm/emel/1.0.0/emel/ml/linear_regression.html)
* [K Nearest Neighbors](https://hexdocs.pm/emel/1.0.0/emel/ml/k_nearest_neighbors.html)
* [Decision Tree](https://hexdocs.pm/emel/1.0.0/emel/ml/decision_tree.html)
* [Naive Bayes](https://hexdocs.pm/emel/1.0.0/emel/ml/naive_bayes.html)
* [K Means](https://hexdocs.pm/emel/1.0.0/emel/ml/k_means.html)
* [Perceptron](https://hexdocs.pm/emel/1.0.0/emel/ml/perceptron.html)
* [Logistic Regression](https://hexdocs.pm/emel/1.0.0/emel/ml/logistic_regression.html)
* [Neural Network](https://hexdocs.pm/emel/1.0.0/emel/ml/neural_network.html)### Mathematics
* [Algebra](https://hexdocs.pm/emel/1.0.0/emel/math/algebra.html)
* [Geometry](https://hexdocs.pm/emel/1.0.0/emel/math/geometry.html)
* [Statistics](https://hexdocs.pm/emel/1.0.0/emel/math/statistics.html)_For the documentation of the previous version (`0.3.0`), click [here](https://hexdocs.pm/emel/0.3.0/)._