modelStudio icon indicating copy to clipboard operation
modelStudio copied to clipboard

Partial display of ModelStudio applet in Quatro HTML file

Open arodionoff opened this issue 1 year ago • 2 comments

I'm trying to create an HTML file by rendering a Quatro file with the following code in Posit Cloud:

---
title: "TEST ModelStudio"
format: html
---

## 	modelStudio in R
'''{r}
library("DALEX")
library("ranger")
library("modelStudio")

# fit a model
model <- ranger(score ~., data = happiness_train)

# create an explainer for the model    
explainer <- explain(model,
                     data = happiness_test,
                     y = happiness_test$score,
                     label = "Random Forest",
                     verbose = FALSE)

# make a studio for the model
modelStudio(explainer)
'''

But in Quarto, a file is created in which modelStudio generates an applet, which is partially visible only in the upper left part. image

How can we make it possible to demonstrate the entire applet in its entirety?

arodionoff avatar Jun 28 '24 08:06 arodionoff

Hi @arodionoff, I didn't try to run modelStudio in Quatro before. Will look into it when I have some free time

hbaniecki avatar Jun 29 '24 09:06 hbaniecki

Are there any promotions for ModelStudio in Quarto?

arodionoff avatar Aug 29 '24 10:08 arodionoff

Hi @arodionoff, you need to play around with document margins, e.g.

---
title: "TEST ModelStudio"
format: 
  html:
    grid:
      body-width: 1250px
---

<style type="text/css">

#mywidget {
  position: relative !important;
  width: 1250px !important;
  height: 900px !important;
}

</style>

## 	modelStudio in R

``{r}
library("DALEX")
library("ranger")
library("modelStudio")

# fit a model
model <- ranger(score ~., data = happiness_train)

# create an explainer for the model    
explainer <- explain(model,
                     data = happiness_test,
                     y = happiness_test$score,
                     label = "Random Forest",
                     verbose = FALSE)

# make a studio for the model
modelStudio(explainer,
            widget_id = "mywidget")
``

## Test

test

hbaniecki avatar Sep 14 '24 10:09 hbaniecki