Код: Выделить всё
import scorecardpy as ac
card=sc.scorecard(bins_adj, lr, X_train.columns)
Код: Выделить всё
import numpy as np
np.save('card.npy',card)
Код: Выделить всё
card=np.load('card.npy',allow_pickle=True)
Код: Выделить всё
score=sc.scorecard_ply(data_train, card, print_step=0)
Код: Выделить всё
UnboundLocalError Traceback (most recent call last)
Cell In [91], line 1
score=sc.scorecard_ply(data_train, card, print_step=0)
File ~/.local/lib/python3.9/site-packages/scorecardpy/scorecard.py:330, in scorecard_ply(dt, card, only_total_score, print_step, replace_blank_na, var_kp)
card_df=card.copy(deep=True)
# x variables
xs=card_df.loc[card_df.variable != 'basepoints', 'variable'].unique()
# length of x variables
xs_len=len(xs)
UnboundLocalError: local variable 'card_df' referenced before assignment
Подробнее здесь: https://stackoverflow.com/questions/792 ... nced-befor