mirror of
https://github.com/ANL-CEEESA/MIPLearn.git
synced 2025-12-07 01:48:51 -06:00
PrimalComponent: handle case where classifier is a fixed int
This commit is contained in:
@@ -90,7 +90,7 @@ class PrimalSolutionComponent(Component):
|
|||||||
if (category, label) not in self.classifiers.keys():
|
if (category, label) not in self.classifiers.keys():
|
||||||
continue
|
continue
|
||||||
clf = self.classifiers[category, label]
|
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)])
|
ws = np.array([[1 - clf, clf] for _ in range(n)])
|
||||||
else:
|
else:
|
||||||
ws = clf.predict_proba(x_test[category])
|
ws = clf.predict_proba(x_test[category])
|
||||||
|
|||||||
Reference in New Issue
Block a user