quant
quant

Reputation: 4482

partial dependency plot in multinomial regression using h2o

I have the following data.table.

  fixed acidity volatile acidity citric acid residual sugar chlorides free sulfur dioxide total sulfur dioxide density   pH
   1:           7.0             0.27        0.36           20.7     0.045                  45                  170 1.00100 3.00
   2:           6.3             0.30        0.34            1.6     0.049                  14                  132 0.99400 3.30
   3:           8.1             0.28        0.40            6.9     0.050                  30                   97 0.99510 3.26
   4:           7.2             0.23        0.32            8.5     0.058                  47                  186 0.99560 3.19
   5:           7.2             0.23        0.32            8.5     0.058                  47                  186 0.99560 3.19   

sulphates alcohol   quality
   1:      0.45     8.8  Bad wine
   2:      0.49     9.5  Bad wine
   3:      0.44    10.1  Bad wine
   4:      0.40     9.9  Bad wine
   5:      0.40     9.9  Bad wine

I can run

system.time(model_glm <- h2o.glm(x = 1:11, y = 12, training_frame = wine.train.h2o,
                                 validation_frame = wine.test.h2o, seed = 42,
                                 family = "binomial"))

to train a glm on this data set. Later in order to get the partial dependency plot i can use

glm_pp <- rbindlist(lapply(glm_pp, function(x){melt(x, id.vars="mean_response")}))
ggplot(glm_pp, aes(x=value, y=mean_response)) + geom_point()  + facet_wrap(~variable, scale="free_x") +
  geom_smooth(method="loess") + theme_pl() + ggtitle("Partial dependence plot")

In my case my y is the quality, which is a binary variable.

How could I get a partial dependency plot if my dependent variable had 3 or more categories, so if i ran glm using family = multinomial ?

Upvotes: 1

Views: 305

Answers (1)

Navdeep Gill
Navdeep Gill

Reputation: 101

Currently H2O supports binomial and regression models in its partial dependency implementation. Multinomial models are not yet compatible.

-Nav

Upvotes: 2

Related Questions