ersilia-os / chempfn

Ensemble-based, size-agnostic wrapper for the TabPFN classifier
GNU General Public License v3.0
28 stars 0 forks source link

random seeds and predict_proba #26

Open wahahaaaa123 opened 1 year ago

wahahaaaa123 commented 1 year ago

Hi, great work. I have 2 questions:

  1. The results obtained are inconsistent each time. How can I set the parameters so that the random seeds of all processes are consistent and the results can be repeated?

  2. When I use "y_pred_proba = model.predict_proba(X_test)", the following error occurs:

Cell In[3], line 30, in make_predictions(model, X_test)
     28 def make_predictions(model, X_test):
     29     y_pred = model.predict(X_test)
---> 30     y_pred_proba = model.predict_proba(X_test)
     31     return y_pred, y_pred_proba

File /opt/anaconda3/envs/ml/lib/python3.11/site-packages/ensemble_tabpfn/ensemble_tabpfn.py:171, in EnsembleTabPFN.predict_proba(self, X)
    169 result = self._predict(X)
    170 result.aggregate
--> 171 return result.probs

AttributeError: 'Result' object has no attribute 'probs'
DhanshreeA commented 1 year ago

Hi @lijiyang thanks for reporting this. The version hosted on pypi does present with the predict_proba issue, I would recommend building from source currently for a more up to date version. A new release to PyPI is planned soon. For the random seed, let me open an issue and track it, please expect a fix within this week.

DhanshreeA commented 1 year ago

Hey @lijiyang we have fixed this in the latest push to main. Can you test it and confirm if it works?