I am trying to use smbinning package in R software to find optimal binnings to a certain variable. Running the command
result=smbinning(df=bop,y="FLAG_TARGET",x="VL_TOTL_REND",p=0.05)
returns the following error message:
"Target (y) not found or it is not numeric"
What is happening here? FLAG_TARGET
is numeric and I have already tried to change data format to integer but it does not work.
Is there a solution to this issue?
It is because
bop
is not a data frame, you have to convert bop into data frame withas.data.frame(bop)
. If you look at the full smbinning code (https://github.com/cran/smbinning/blob/master/R/smbinning.R#L490), there is this blockafter setting y as the target column name and x as the predictor column name, try running
if bop is not a dataframe, it will return
FALSE
. After runningbop_dataframe <- as.data.frame(bop)
and runningit should return
TRUE