title: How to save mlr3 lightgbm model correctly?
body: <p>I have some following codes. I met error when save trained model.
  It's only error when i using <code>lightgbm</code>.</p>
  <pre class="lang-r prettyprint-override"><code>library(mlr3)
  library(mlr3pipelines)
  library(mlr3extralearners)
  
  data = tsk(&quot;german_credit&quot;)$data()
  data = data[, c(&quot;credit_risk&quot;, &quot;amount&quot;, &quot;purpose&quot;, &quot;age&quot;)]
  task = TaskClassif$new(&quot;boston&quot;, backend = data, target = &quot;credit_risk&quot;)
  
  g = po(&quot;imputemedian&quot;) %&gt;&gt;%
    po(&quot;imputeoor&quot;) %&gt;&gt;%
    po(&quot;fixfactors&quot;) %&gt;&gt;%
    po(&quot;encodeimpact&quot;) %&gt;&gt;% 
    lrn(&quot;classif.lightgbm&quot;)
  
  gl = GraphLearner$new(g)
  
  gl$train(task)
  
  # predict 
  newdata &lt;- data[1,]
  gl$predict_newdata(newdata) 
  saveRDS(gl, &quot;gl.rds&quot;)
  </code></pre>
  <pre class="lang-r prettyprint-override"><code># read model from disk ----------------
  gl &lt;- readRDS(&quot;gl.rds&quot;)
  newdata &lt;- data[1,]
  
  # error when predict ------------------
  gl$predict_newdata(newdata)
  </code></pre>