diff --git a/lightwood/analysis/nc/calibrate.py b/lightwood/analysis/nc/calibrate.py index 43a9852f5..41390f81d 100644 --- a/lightwood/analysis/nc/calibrate.py +++ b/lightwood/analysis/nc/calibrate.py @@ -366,9 +366,9 @@ def explain(self, row_insights: pd.DataFrame, global_insights: Dict[str, object] # Or if they even need handling yet pass elif ns.target_dtype in (dtype.integer): - row_insights['prediction'] = row_insights['prediction'].clip(-pow(2, 63), pow(2, 63)).astype(int) - row_insights['upper'] = row_insights['upper'].clip(-pow(2, 63), pow(2, 63)).astype(int) - row_insights['lower'] = row_insights['lower'].clip(-pow(2, 63), pow(2, 63)).astype(int) + row_insights['prediction'] = row_insights['prediction'].clip(-pow(2, 62), pow(2, 62)).astype(int) + row_insights['upper'] = row_insights['upper'].clip(-pow(2, 62), pow(2, 62)).astype(int) + row_insights['lower'] = row_insights['lower'].clip(-pow(2, 62), pow(2, 62)).astype(int) elif ns.target_dtype in (dtype.float, dtype.quantity): row_insights['prediction'] = row_insights['prediction'].astype(float) row_insights['upper'] = row_insights['upper'].astype(float) diff --git a/lightwood/api/json_ai.py b/lightwood/api/json_ai.py index 6c3f05512..d40c165e6 100644 --- a/lightwood/api/json_ai.py +++ b/lightwood/api/json_ai.py @@ -1,7 +1,5 @@ # TODO: lookup_encoder is awkward; similar to dtype, can we make a file with encoder_lookup? People may be interested # in seeing where these come from and it's not clear that you need to look here. -# TODO: What does `target_class_distribution` and `positive_domain` do? -# TODO: generate_json_ai is really large; can we abstract it into smaller functions to make it more readable? # TODO: add_implicit_values unit test ensures NO changes for a fully specified file. from typing import Dict from lightwood.helpers.templating import call, inline_dict, align diff --git a/lightwood/ensemble/best_of.py b/lightwood/ensemble/best_of.py index dd5d12350..be9551cf1 100644 --- a/lightwood/ensemble/best_of.py +++ b/lightwood/ensemble/best_of.py @@ -33,7 +33,7 @@ def __init__(self, target, mixers: List[BaseMixer], data: EncodedDs, accuracy_fu if can_be_nan_numeric(avg_score): avg_score = -pow(2, 63) log.warning(f'Change the accuracy of mixer {type(mixer).__name__} to valid value: {avg_score}') - + score_list.append(avg_score) self.indexes_by_accuracy = list(reversed(np.array(score_list).argsort()))