You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your performance::check_outliers() function does not allow you to check for influential observations in a logistic regression, the objective function of which is a factor, and there is not a single numeric feature among the predictors.
If there are numerical variable (at least as a target), then everything is fine:
# install.packages(c("smbinning", "randomForest", "performance"))
# Load library and its dataset
library(smbinning)
# Sampling
pop=smbsimdf1 # Population
train=subset(pop,rnd<=0.7) # Training sample
# Generate binning object to generate variables
smbcbs1=smbinning(train,x="cbs1",y="fgood")
smbcbinq=smbinning.factor(train,x="cbinq",y="fgood")
pop=smbinning.gen(pop,smbcbs1,"g1cbs1")
pop=smbinning.factor.gen(pop,smbcbinq,"g1cbinq")
# Resample
train=subset(pop,rnd<=0.7) # Training sample
test=subset(pop,rnd>0.7) # Testing sample
# Run logistic regression with factors
modlogisticsmb=glm(fgood ~ cbinq + cbterm + inc, data = train, family = binomial())
summary(modlogisticsmb)
library(performance)
plot( performance::check_outliers(modlogisticsmb) )
But as soon as there are no more of them left, replacing them with a factor, we get an error:
train$fgood <- as.factor(train$fgood)
# Run logistic regression with factors
modlogisticsmb=glm(fgood ~ cbinq + cbterm + inc, data = train, family = binomial())
summary(modlogisticsmb)
# Error in performance::check_outliers()
plot( performance::check_outliers(modlogisticsmb) )
Error: No numeric variables found. No data to check for outliers.
However, such an analysis can be carried out by calling the performance::check_model function:
Your
performance::check_outliers()
function does not allow you to check for influential observations in a logistic regression, the objective function of which is a factor, and there is not a single numeric feature among the predictors.If there are numerical variable (at least as a target), then everything is fine:
But as soon as there are no more of them left, replacing them with
a factor
, we get an error:Error: No numeric variables found. No data to check for outliers.
However, such an analysis can be carried out by calling the
performance::check_model
function:The only annoying thing is that in this case the graph appears only on the left side of the screen, and not on the entire screen.
The text was updated successfully, but these errors were encountered: