Skip to main content
edited tags
Link
Dave
  • 67.1k
  • 7
  • 105
  • 305
Source Link
Sisi
  • 61
  • 1
  • 6

Classificatsion tree, random forest output and negative values

I am doing a random forest and classificatsion tree. I only have numeric variable, no factors, so I have some questions regarding the output. Background of the variables: Prob_1 are values between 0-1 (I devided the real values with 100, to have values between 0-1), all of the other variables used for the are between 1-100

First question is regarding this output:

Regression tree:
tree(formula = Prob_1 ~ ., data = P14_Q1_2, subset = train)
Variables actually used in tree construction:
[1] "Flowers"             "Herbaceous_area" "Woodland"     
Number of terminal nodes:  4 
Residual mean deviance:  0.06002 = 3.301 / 55 
Distribution of residuals:
    Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
-0.63250 -0.12570  0.03416  0.00000  0.14140  0.59530 

I can see residual mean deviance is 0.06002, but when I did tree with values (1-100) [Prob_1 are just the real values devided by 100), I got the residual mean deviance over 600, which seems a lot? How to tell if the residual mean deviance is good, if it too high what are the solutsions?

I calculated the MSE:

> mean((yhat - boston.test)^2)
[1] 0.1234633

What are considered to be good values of MSE, when can I say the tree is predicting correctly?

Lastly:

> RF1 <- randomForest(Prob_par ~ ., data = P14_Q1_2,
+                            subset = train, ntree=50000, mtry = 1, importance = TRUE)
> RF1

Call:
 randomForest(formula = Prob_par ~ ., data = P14_Q1_2, ntree = 50000,      mtry = 1, importance = TRUE, subset = train) 
               Type of random forest: regression
                     Number of trees: 50000
No. of variables tried at each split: 1

          Mean of squared residuals: 0.08347299
                    % Var explained: 0.69

The % Var explained= 0.69, which is quiet low, and when changeing the mtry, the value is some times even with a - sign (for example -3.22). What are the solutions?