0
$\begingroup$

I am doing the following, and the model is getting all of the "True" class predictions wrong. Any idea what I can try on this data? I tried to tune some things, and also tried XGBoost to no luck.

Here is the mix of the true / false cases in the train and test. It is heavily one class, but the mix is not that bad

> table(trainDf$dependent_variable)

  1   2 
406  37 
> table(testDf$dependent_variable)

  1   2 
102   9 
library(dplyr)
library(randomForest)
library(caret)

x <- structure(list(dependent_variable = structure(c(1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 
1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L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 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 2L, 
    1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 
    1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 
    2L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 2L, 1L, 2L, 
    1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 2L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
    1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), levels = c("1", 
    "2"), class = "factor")), row.names = c(NA, -554L), class = "data.frame")

trainRows <- c(sample(1:nrow(x), 0.8 * nrow(x)))
trainDf <- x[trainRows, ]
testDf <- x[-trainRows, ]

rfModel <- randomForest(
  dependent_variable ~ ., data = trainDf, ntree = 20000, mtry = 4
  )

table(
  rfModel %>% predict(select(testDf, -dependent_variable)),
  testDf$dependent_variable
  )
   
      1   2
  1 102   8
  2   0   1
```
$\endgroup$
6
  • $\begingroup$ Are there a lot more “false” instances than “true” instances? (Is the problem, indeed, binary, or are there additional categories?) $\endgroup$
    – Dave
    Dec 13, 2023 at 23:36
  • $\begingroup$ Just binary classification. I updated the question showing mix of the two classes. $\endgroup$ Dec 13, 2023 at 23:44
  • 4
    $\begingroup$ The test set is too small to get an accurate understanding of the performance variability expected. Only '9' positives examples is too low. I would strongly suggest considering a resampling approach (stratified bootstrap, repeated stratified CV, etc.) $\endgroup$
    – usεr11852
    Dec 14, 2023 at 1:08
  • $\begingroup$ Using this did not change anything: control <- trainControl(method='repeatedcv', number=10, repeats=3) $\endgroup$ Dec 14, 2023 at 1:30
  • 3
    $\begingroup$ I don't think that you have enough data to fit such a complicated model. Even if you were lucky enough to fit this data set, the results would be unlikely to generalize to new data. In general with binary outcomes, you need about 15 members of the minority class per predictor to get a reliable model. For each categorical variable, the effective number of predictors is one less than its number of levels. By my count, you thus have 22 total predictors with only 46 minority-class outcomes. Random forest/boosting might cut down on the effective number of predictors, but this seems a bit much. $\endgroup$
    – EdM
    Dec 29, 2023 at 21:17

1 Answer 1

1
+50
$\begingroup$

First I want to say that reproducible examples with random sampling must specify a seed. e.g., set.seed(1).

Your data is unbalanced and from what I can tell most of the cases for your explanatory variables when the dependent variable equals 2 (class2) are present when the dependent variable equals 1 (class1). Any good algorithm should predict class1 in this case when there are more instances of class1 with the same set of explanatory variables as class2 (which looks to be true for your data in most cases). It is not true in all classes and is likely why you ran the model against your test data you did get one correct prediction for class2.

The code below illustrates this point with your data.

# set random seed                                                                                                                                                                                                                                                                                                                                                                                                              
set.seed(1)

# split training data as you have done in the original post
trainRows <- c(sample(1:nrow(x), 0.8 * nrow(x)))
trainDf <- x[trainRows, ]
testDf <- x[-trainRows, ]

# print balance of classes
table(trainDf$dependent_variable)

  1   2 
408  35 

# get explanatory variables for the training data by class
class1_train <- trainDf[trainDf$dependent_variable == 1,-1]
class2_train <- trainDf[trainDf$dependent_variable == 2,-1]

# unique combinations of explanatory variables for training data
unique_class1_train <- unique(class1_train)
unique_class2_train <- unique(class2_train)

# print number of unique cases for class 1
print(nrow(unique_class1_train))
[1] 167

# print number of unique cases for class 1
print(nrow(unique_class2_train))
[1] 24

# determine qhich cases are part of the training data for class1
unique_class2_train$in_class1 <- NA
for(i in 1:nrow(unique_class2_train)){
  row_to_find <- unique_class2_train[i,]
  unique_class2_train$in_class1[i] <- nrow(merge(row_to_find,unique_class1_train)) > 0
}

# print the number of unique cases that are in the class1 cases or not
table(unique_class2_train$in_class1)

FALSE  TRUE 
4    20 
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.