Describe the bug:
When trying to pass a RandomForestClassifier to brew() as an alternative Model object in place of the default PercolatorModel, the following error is raised:
Traceback (most recent call last):
File "/Users/Surya/TalusBio/test.py", line 143, in <module>
moka_test_model, _ = mokapot.brew(psms, model=rf_model)
File "/Users/Surya/TalusBio/mokapot/mokapot/brew.py", line 124, in brew
models.sort(key=lambda x: x[0].estimator.intercept_)
File "/Users/Surya/TalusBio/mokapot/mokapot/brew.py", line 124, in <lambda>
models.sort(key=lambda x: x[0].estimator.intercept_)
AttributeError: 'RandomForestClassifier' object has no attribute 'intercept_'
To Reproduce:
import mokapot
from mokapot.model import Model
from sklearn.ensemble import RandomForestClassifier
psms = mokapot.read_pin("psms.pin")
moka_conf, _ = mokapot.brew(psms, model=Model(RandomForestClassifier(max_depth=2, 2)))
The hyperparameters for RandomForestClassifier are optional but greatly decrease runtime.
Describe the bug: When trying to pass a RandomForestClassifier to
brew()
as an alternative Model object in place of the default PercolatorModel, the following error is raised:To Reproduce:
The hyperparameters for
RandomForestClassifier
are optional but greatly decrease runtime.