From 89b73b8b279717b111502b5c9f10cb4861120c52 Mon Sep 17 00:00:00 2001 From: "Elaine K. Lee" Date: Tue, 1 Jun 2021 17:46:35 -0500 Subject: [PATCH] FIX: SVC's gamma = 'scale' representation If gamma is 'scale', use the computed value stored on the estimator object, rather than `'scale'`. --- sklearn_porter/estimator/classifier/SVC/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sklearn_porter/estimator/classifier/SVC/__init__.py b/sklearn_porter/estimator/classifier/SVC/__init__.py index 3c1ceaac..c71908f1 100644 --- a/sklearn_porter/estimator/classifier/SVC/__init__.py +++ b/sklearn_porter/estimator/classifier/SVC/__init__.py @@ -182,6 +182,8 @@ def export(self, class_name, method_name, export_data=False, self.gamma = self.params['gamma'] if self.gamma == 'auto': self.gamma = 1. / self.n_features + elif self.gamma == 'scale': + self.gamma = est._gamma # computed value of 1 / (n_features * X.var()) self.gamma = self.repr(self.gamma) # Coefficient and degree: