Skip to content

Commit

Permalink
feat: marshall rweka models
Browse files Browse the repository at this point in the history
  • Loading branch information
be-marc committed Nov 14, 2024
1 parent 6ccad99 commit dfe3b59
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 7 deletions.
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Generated by roxygen2: do not edit by hand

S3method(marshal_model,Weka_classifier)
S3method(unmarshal_model,Weka_classifier)
S3method(unmarshal_model,Weka_classifier_marshaled)
export(LearnerClassifAbess)
export(LearnerClassifAdaBoostM1)
export(LearnerClassifBart)
Expand Down
11 changes: 5 additions & 6 deletions R/helpers_rweka.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,16 @@ rweka_predict = function(newdata, pars, predict_type, model) {

#' @export
#' @method marshal_model.Weka_classifier
marshal_model.Weka_classifier= function(model, inplace = FALSE, ...) {
marshal_model.Weka_classifier = function(model, inplace = FALSE, ...) {
rJava::.jcache(model$classifier)

structure(list(
marshaled = model, packages = "mlr3extralearners"),
class = c("classif.Weka_classifier_marshaled", "marshaled")
marshaled = model, packages = c("mlr3", "mlr3extralearners")),
class = c("Weka_classifier_marshaled", "marshaled")
)
}

#' @export
#' @method unmarshal_model.Weka_classifier
unmarshal_model.Weka_classifier = function(model, inplace = FALSE, ...) {
#' @method unmarshal_model.Weka_classifier_marshaled
unmarshal_model.Weka_classifier_marshaled = function(model, inplace = FALSE, ...) {
model$marshaled
}
46 changes: 46 additions & 0 deletions man/mlr_learners_classif.AdaBoostM1.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dfe3b59

Please sign in to comment.