Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter9192 committed Jan 26, 2024
1 parent f9a048b commit 5c2d270
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
# DumME: Mixed Effects Dummy Model

This is an adaptation of https://github.com/manifoldai/merf. The most important changes are:

* This version is (mostly) [SKlearn
compliant](https://scikit-learn.org/stable/developers/develop.html) and can
therefore be used with other frameworks such as
[pycaret](https://pycaret.gitbook.io/docs/).
* Fit API starts with X and y; Z and clusters are removed. Instead, optional
kwargs to specify the columns of 'clusters', 'fixed_effects', and
'random_effects'.
* Predict only accepts X as input. It is assumed new data is structured in the
same way as the original training data.
* The main class was renamed to MixedEffectsModel (more general) with the
scikit-learn dummy model as default.
* Package trimmed down to bare minimum but with modern package structure
This is an adaptation of MERF (https://github.com/manifoldai/merf). The main
difference is that this version is fully compliant with the scikit-learn API.

Other difference include:

- The name: MERF was renamed to the more general MixedEffectsModel
- The default fixed-effects model: dummy model instead of random forest
- The package structure: stripped down to its core and then upgraded to use
modern standards
- Test suite: using pytest instead of unittest

> [!CAUTION]
> We don't intend to maintain or develop this further. However, we are happy to
> contribute our changes to the original version of MERF.
> Notice https://github.com/manifoldai/merf/issues/68.
> We currently don't plan on maintaining or developing this further. However, we
> are happy to contribute our changes to the original version of MERF. Notice
> https://github.com/manifoldai/merf/issues/68.
## Using this version

Expand All @@ -41,11 +37,17 @@ y = df.pop("y")
x = df

# Fit a dummy model
# Notice the signature of the `fit` method: first X and y, and the other args are optional.
me_dummy = MixedEffectsModel()
me_dummy.fit(X, y) # This works now
me_dummy.fit(X, y)

# But you can still pass in additional arguments
# or
me_dummy.fit(X, y, cluster_column="cluster", fixed_effects=["X_0", "X_1", "X_2"], random_effects=["Z"])

# Predict only accepts X as input. It is assumed new data is structured
# in the same way as the original training data.
new_X = X.copy()
me_dummy.predict(new_X)
```

To get the "original" MERF (but still with the new fit signature):
Expand Down

0 comments on commit 5c2d270

Please sign in to comment.