Mercurial > repos > goeckslab > pycaret_compare
diff utils.py @ 3:02f7746e7772 draft default tip
planemo upload for repository https://github.com/goeckslab/Galaxy-Pycaret commit ff6d674ecc83db933153b797ef4dbde17f07b10e
author | goeckslab |
---|---|
date | Wed, 01 Jan 2025 03:19:40 +0000 |
parents | 915447b14520 |
children |
line wrap: on
line diff
--- a/utils.py Sat Dec 14 23:18:02 2024 +0000 +++ b/utils.py Wed Jan 01 03:19:40 2025 +0000 @@ -1,6 +1,8 @@ import base64 import logging +import numpy as np + logging.basicConfig(level=logging.DEBUG) LOG = logging.getLogger(__name__) @@ -155,3 +157,8 @@ """Convert an image file to a base64 encoded string.""" with open(image_path, "rb") as img_file: return base64.b64encode(img_file.read()).decode("utf-8") + + +def predict_proba(self, X): + pred = self.predict(X) + return np.array([1-pred, pred]).T