Closed JBGruber closed 4 years ago
@JBGruber can you enable me to make mods to your PR branch? See https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork
You should be able to make mods to the branch as far as I know (and according to the help page you linked). I left the default:
I think if you grant me permission to push to your branch, I can add my edits.
(base) kbenoit@KB-Office-iMac quanteda.textmodels % git remote -v
origin https://github.com/quanteda/quanteda.textmodels.git (fetch)
origin https://github.com/quanteda/quanteda.textmodels.git (push)
upstream https://github.com/JBGruber/quanteda.textmodels.git (fetch)
upstream https://github.com/JBGruber/quanteda.textmodels.git (push)
(base) kbenoit@KB-Office-iMac quanteda.textmodels % git push upstream
Total 0 (delta 0), reused 0 (delta 0)
To https://github.com/JBGruber/quanteda.textmodels.git
! [remote rejected] JBGruber-master -> JBGruber-master (permission denied)
error: failed to push some refs to 'https://github.com/JBGruber/quanteda.textmodels.git'
Ok, you should have an invitation.
Thanks for adding the function and thanks for adding me as an author of the package :blush:!
Give it a thorough lookover, since I made some changes in the final mix, but could not easily feed them back to your fork. I think I forked your fork, then issued a PR for your PR, which got complicated! In the future you can just create dev branches on this repo.
This PR implements a logistic regression classifier for 2 and >2 classes as discussed in quanteda/quanteda.classifiers#14 and quanteda/quanteda.classifiers#20.
Below I put together a short demo of the functions. I think there are still some open question regarding design (e.g., how to treat parallel processing, as it requires another package here). Let me know what you think.
two classes (binomial)
The coefficients are a
dgCMatrix
in this case, which I think makes sense given that normally most values will be 0.Maybe it would make sense to show in an example that the coefficients can be used to show which words are most important in the model.
more than two classes (multinomial)
For multinomial classification, coefficients appear side by side: