PrimalComponent: handle case where classifier is a fixed int

This commit is contained in:
2020-06-23 10:48:30 -05:00
parent 11d22b4c3c
commit ea12e21e02

View File

@@ -90,7 +90,7 @@ class PrimalSolutionComponent(Component):
if (category, label) not in self.classifiers.keys():
continue
clf = self.classifiers[category, label]
if isinstance(clf, float):
if isinstance(clf, float) or isinstance(clf, int):
ws = np.array([[1 - clf, clf] for _ in range(n)])
else:
ws = clf.predict_proba(x_test[category])