ngboost icon indicating copy to clipboard operation
ngboost copied to clipboard

back compatibility

Open yudeng2022 opened this issue 7 months ago • 0 comments

Hi I trained a ngboost model under python 3.8, and saved the model using joblib. Now I want to migrate to python 3.12. Model retrain is not an option. I want to load the saved model under python 3.12 but got an error:

ValueError: node array from the pickle has an incompatible dtype:
- expected: {'names': ['left_child', 'right_child', 'feature', 'threshold', 'impurity', 'n_node_samples', 'weighted_n_node_samples', 'missing_go_to_left'], 'formats': ['<i8', '<i8', '<i8', '<f8', '<f8', '<i8', '<f8', 'u1'], 'offsets': [0, 8, 16, 24, 32, 40, 48, 56], 'itemsize': 64}
- got     : [('left_child', '<i8'), ('right_child', '<i8'), ('feature', '<i8'), ('threshold', '<f8'), ('impurity', '<f8'), ('n_node_samples', '<i8'), ('weighted_n_node_samples', '<f8')]

Is there anyway around it without retrain the model under the new environment?

yudeng2022 avatar Jun 05 '25 04:06 yudeng2022

Is this project still alive ??? :)

grhaonan avatar Dec 09 '22 06:12 grhaonan

I am getting this error as well. SHAP 0.40.0 Transformers 4.12.3

Will try downgrading shap...

smart-patrol avatar Jan 25 '23 16:01 smart-patrol

Thanks for sharing @smart-patrol , please also help to let me know if downgrading works, really appreciate it.

grhaonan avatar Jan 26 '23 05:01 grhaonan

same here

alessandrodanesi avatar May 01 '23 19:05 alessandrodanesi

This issue has been inactive for two years, so it's been automatically marked as 'stale'.

We value your input! If this issue is still relevant, please leave a comment below. This will remove the 'stale' label and keep it open.

If there's no activity in the next 90 days the issue will be closed.

github-actions[bot] avatar Jun 16 '25 03:06 github-actions[bot]

This issue has been automatically closed due to lack of recent activity.

Your input is important to us! Please feel free to open a new issue if the problem persists or becomes relevant again.

github-actions[bot] avatar Sep 15 '25 03:09 github-actions[bot]