From 5bde8bc279883211f7deb16c5526f9226b9c05f1 Mon Sep 17 00:00:00 2001 From: majing8 Date: Tue, 23 Aug 2022 17:34:28 +0800 Subject: [PATCH] add new functions --- .gitignore | 1 + python-package/xlearn/xlearn.py | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/.gitignore b/.gitignore index e409da16..f29344e7 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,4 @@ build_unix/* *.Rhistory *.tar.gz xlearn/* +.idea diff --git a/python-package/xlearn/xlearn.py b/python-package/xlearn/xlearn.py index d9fddc86..13607a21 100644 --- a/python-package/xlearn/xlearn.py +++ b/python-package/xlearn/xlearn.py @@ -231,6 +231,20 @@ def setSigmoid(self): _check_call(_LIB.XLearnSetBool(ctypes.byref(self.handle), c_str(key), ctypes.c_bool(True))) + + def disableSign(self): + """Disable convert output to 0 and 1""" + key = 'sign' + _check_call(_LIB.XLearnSetBool(ctypes.byref(self.handle), + c_str(key), ctypes.c_bool(False))) + + + def disableSigmoid(self): + """Disable convert output by using sigmoid""" + key = 'sigmoid' + _check_call(_LIB.XLearnSetBool(ctypes.byref(self.handle), + c_str(key), ctypes.c_bool(True))) + def fit(self, param, model_path): """Check hyper-parameters, train model, and dump model.