Skip to content

Commit

Permalink
Merge pull request #14 from dmetivie/refactor
Browse files Browse the repository at this point in the history
Refactor
  • Loading branch information
dmetivie authored Nov 7, 2024
2 parents 826196b + cd74af2 commit 63f185f
Show file tree
Hide file tree
Showing 26 changed files with 32,050 additions and 1,958 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.7'
- '1'
- 'nightly'
os:
- ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/Manifest.toml
.vscode/ltex.dictionary.en-US.txt
.vscode/settings.json
test/Manifest.toml
benchmarks/.CondaPkg/env
docs/Manifest.toml
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ExpectationMaximization"
uuid = "e1fe09cc-5134-44c2-a941-50f4cd97986a"
authors = ["David Métivier <david.metivier@inrae.fr> and contributors"]
version = "0.2.2"
version = "0.2.3"

[deps]
ArgCheck = "dce04be8-c92d-5529-be00-80e4d2c0e197"
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Docs](https://img.shields.io/badge/docs-dev-blue.svg)](https://dmetivie.github.io/ExpectationMaximization.jl/dev)

This package provides a simple implementation of the Expectation Maximization (EM) algorithm used to fit mixture models.
Due to [Julia](https://julialang.org/) amazing [dispatch](https://www.youtube.com/watch?v=kc9HwsxE1OY) systems, generic and reusable code spirit, and the [Distributions.jl](https://juliastats.org/Distributions.jl/stable/) package, the code while being very generic is both very expressive and fast! (Have a look at the [Benchmark section](https://dmetivie.github.io/ExpectationMaximization.jl/dev/benchmarks/))
Due to [Julia](https://julialang.org/) amazing [dispatch](https://www.youtube.com/watch?v=kc9HwsxE1OY) systems, generic and reusable code spirit, and the [Distributions.jl](https://juliastats.org/Distributions.jl/stable/) package, the code while being very generic is both very expressive and fast! (Take a look at the [Benchmark section](https://dmetivie.github.io/ExpectationMaximization.jl/dev/benchmarks/))

## What type of mixtures?

Expand All @@ -17,12 +17,12 @@ In particular, it works on a lot of mixtures:

## What EM algorithm?

So far the classic EM algorithm and the Stochastic EM are implemented. Look at the [Bibliography section](https://dmetivie.github.io/ExpectationMaximization.jl/dev/biblio) for references.
So far, the classic EM algorithm and the Stochastic EM are implemented. Look at the [Bibliography section](https://dmetivie.github.io/ExpectationMaximization.jl/dev/biblio) for references.

## How?

Just define a [`mix::MixtureModel`](https://juliastats.org/Distributions.jl/stable/mixture/) and do `fit_mle(mix, y)` where `y` is you observation array (vector or matrix). That's it! For Stochastic EM, just do `fit_mle(mix, y, method = StochasticEM())`.
**Have a look at the [Examples](https://dmetivie.github.io/ExpectationMaximization.jl/dev/examples/#Examples) section**.
**Take a look at the [Examples](https://dmetivie.github.io/ExpectationMaximization.jl/dev/examples/#Examples) section**.

To work, the only requirements are that the components of the mixture `dist ∈ dists = components(mix)` considered (custom or coming from an existing package)

Expand All @@ -36,11 +36,17 @@ To work, the only requirements are that the components of the mixture `dist ∈

[] Better benchmark against other EM implementations

[] Add advice and better default for `atol` and `rtol` choice (it is not obvious how to select then).

[] Speed up code (always!). So far, I focused on readable code.

[] Cool logo

[] I'll soon register the package in French HAL system linked to Software Heritage to get a DOI and citation.

## Example

Also have a look at the [examples](@ref Examples) section.
Also take a look at the [examples](@ref Examples) section.

```julia
using Distributions
Expand Down
Binary file added benchmarks/.CondaPkg/meta
Binary file not shown.
3 changes: 3 additions & 0 deletions benchmarks/CondaPkg.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

[deps.scikit-learn]
channel = "conda-forge"
Loading

0 comments on commit 63f185f

Please sign in to comment.