|
1 |
| -[](https://github.com/raeslab/lorepy/actions/workflows/autopytest.yml) [](https://raw.githubusercontent.com/raeslab/lorepy/main/docs/coverage-badge.svg) [](https://github.com/psf/black) [](https://zenodo.org/badge/latestdoi/686018963) [](https://badge.fury.io/py/lorepy) |
| 1 | +[](https://github.com/raeslab/lorepy/actions/workflows/autopytest.yml) [](https://raw.githubusercontent.com/raeslab/lorepy/main/docs/coverage-badge.svg) [](https://github.com/psf/black) [](https://zenodo.org/badge/latestdoi/686018963) [](https://badge.fury.io/py/lorepy) [](https://creativecommons.org/licenses/by-nc-sa/4.0/) |
2 | 2 |
|
3 | 3 | # lorepy: Logistic Regression Plots for Python
|
4 | 4 |
|
@@ -109,13 +109,38 @@ plt.show()
|
109 | 109 |
|
110 | 110 | 
|
111 | 111 |
|
| 112 | +By default lorepy uses a multi-class logistic regression model, however this can be replaced with any classifier |
| 113 | +from scikit-learn that implements ```predict_proba``` and ```fit```. Below you can see the code and output with a |
| 114 | +Support Vector Classifier (SVC) and Random Forest Classifier (RF). |
| 115 | + |
| 116 | +```python |
| 117 | +from sklearn.svm import SVC |
| 118 | +from sklearn.ensemble import RandomForestClassifier |
| 119 | + |
| 120 | +fig, ax = plt.subplots(1, 2, sharex=False, sharey=True) |
| 121 | + |
| 122 | +svc = SVC(probability=True) |
| 123 | +rf = RandomForestClassifier(n_estimators=10, max_depth=2) |
| 124 | + |
| 125 | +loreplot(data=iris_df, x="sepal width (cm)", y="species", clf=svc, ax=ax[0]) |
| 126 | +loreplot(data=iris_df, x="sepal width (cm)", y="species", clf=rf, ax=ax[1]) |
| 127 | + |
| 128 | +ax[0].set_title("SVC") |
| 129 | +ax[1].set_title("RF") |
| 130 | + |
| 131 | +plt.savefig("./docs/img/loreplot_other_clf.png", dpi=150) |
| 132 | +plt.show() |
| 133 | +``` |
| 134 | + |
| 135 | +[Lorepy with different types of classifiers](./docs/img/loreplot_other_clf.png) |
| 136 | + |
112 | 137 | ## Contributing
|
113 | 138 |
|
114 |
| -Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**. |
| 139 | +Any contributions you make are **greatly appreciated**. |
115 | 140 |
|
116 | 141 | * Found a bug or have some suggestions? Open an [issue](https://github.com/raeslab/lorepy/issues).
|
117 | 142 | * Pull requests are welcome! Though open an [issue](https://github.com/raeslab/lorepy/issues) first to discuss which features/changes you wish to implement.
|
118 | 143 |
|
119 | 144 | ## Contact
|
120 | 145 |
|
121 |
| -lorepy was developed by [Sebastian Proost](https://sebastian.proost.science/) at the [RaesLab](https://raeslab.sites.vib.be/en) and was based on R code written by [Sara Vieira-Silva](https://saravsilva.github.io/). |
| 146 | +lorepy was developed by [Sebastian Proost](https://sebastian.proost.science/) at the [RaesLab](https://raeslab.sites.vib.be/en) and was based on R code written by [Sara Vieira-Silva](https://saravsilva.github.io/). As of version 0.2.0 lorepy is available under the [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-nc-sa/4.0/) license. |
0 commit comments