From f4cd5fa5840e9c43f97668ad7d4e24b701ab95c7 Mon Sep 17 00:00:00 2001 From: Donald Tolley Date: Wed, 24 May 2023 17:01:08 -0400 Subject: [PATCH] Check if base_score is available and it is a string type convert it to float Signed-off-by: Donald Tolley --- onnxmltools/convert/xgboost/_parse.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/onnxmltools/convert/xgboost/_parse.py b/onnxmltools/convert/xgboost/_parse.py index d5228806..65f6ac04 100644 --- a/onnxmltools/convert/xgboost/_parse.py +++ b/onnxmltools/convert/xgboost/_parse.py @@ -99,9 +99,12 @@ def _get_attributes(booster): if 'base_score' not in kwargs: kwargs['base_score'] = 0.5 + elif isinstance(kwargs['base_score'], str): + kwargs['base_score'] = float(kwargs['base_score']) return kwargs + class WrappedBooster: def __init__(self, booster):