diff utils.py @ 2:0314dad38aaa draft default tip

planemo upload for repository https://github.com/goeckslab/Galaxy-Pycaret commit ff6d674ecc83db933153b797ef4dbde17f07b10e
author goeckslab
date Wed, 01 Jan 2025 03:19:27 +0000
parents 1f20fe57fdee
children
line wrap: on
line diff
--- a/utils.py	Sat Dec 14 23:17:48 2024 +0000
+++ b/utils.py	Wed Jan 01 03:19:27 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