Skip to contents

Simple and fast neural nets for tabular data classification. Calls fastai::tabular_learner() from package fastai.

Installation

The Python dependencies are automatically installed via reticulate::py_require(). See Installing Python Dependencies for more details. You can manually specify a virtual environment by calling reticulate::use_virtualenv() prior to calling the $train() function. In this virtual environment, the fastai package and its dependencies must be installed.

Saving a Learner

In order to save a lrn("classif.fastai") for later usage, it is necessary to call the $marshal() method on the Learner before writing it to disk, as the object will otherwise not be saved correctly. After loading a marshaled lrn("classif.fastai") into R again, you then need to call $unmarshal() to transform it into a useable state.

Initial parameter values

Dictionary

This Learner can be instantiated via lrn():

lrn("classif.fastai")

Meta Information

  • Task type: “classif”

  • Predict Types: “response”, “prob”

  • Feature Types: “logical”, “integer”, “numeric”, “factor”, “ordered”

  • Required Packages: mlr3, mlr3extralearners, fastai, reticulate

Parameters

IdTypeDefaultLevelsRange
act_clsuntyped--
bn_contlogicalTRUETRUE, FALSE-
bn_finallogicalFALSETRUE, FALSE-
drop_lastlogicalFALSETRUE, FALSE-
embed_pnumeric0\([0, 1]\)
emb_szsuntypedNULL-
n_epochinteger-\([1, \infty)\)
eval_metricuntyped--
layersuntyped--
loss_funcuntyped--
lrnumeric0.001\([0, \infty)\)
metricsuntyped--
n_outinteger-\((-\infty, \infty)\)
num_workersinteger0\((-\infty, \infty)\)
opt_funcuntyped--
patienceinteger1\([1, \infty)\)
pin_memorylogicalTRUETRUE, FALSE-
procsuntypedNULL-
psuntypedNULL-
shufflelogicalFALSETRUE, FALSE-
train_bnlogicalTRUETRUE, FALSE-
wdinteger-\([0, \infty)\)
wd_bn_biaslogicalFALSETRUE, FALSE-
use_bnlogicalTRUETRUE, FALSE-
y_rangeuntypedNULL-
bsinteger50\((-\infty, \infty)\)

References

Howard, Jeremy, Gugger, Sylvain (2020). “Fastai: A Layered API for Deep Learning.” Information, 11(2), 108. ISSN 2078-2489, doi:10.3390/info11020108 .

See also

Author

annanzrv

Super classes

mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifFastai

Active bindings

internal_valid_scores

(named list() or NULL) The validation scores extracted from eval_protocol which itself is set by fitting the fastai::tab_learner. If early stopping is activated, this contains the validation scores of the model for the optimal n_epoch, otherwise the n_epoch for the final model.

internal_tuned_values

(named list() or NULL) If early stopping is activated, this returns a list with n_epoch, which is the last epoch that yielded improvement w.r.t. the patience, extracted by max(eval_protocol$epoch)+1

validate

(numeric(1) or character(1) or NULL) How to construct the internal validation data. This parameter can be either NULL, a ratio, "test", or "predefined".

marshaled

(logical(1)) Whether the learner has been marshaled.

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage


Method marshal()

Marshal the learner's model.

Usage

LearnerClassifFastai$marshal(...)

Arguments

...

(any)
Additional arguments passed to mlr3::marshal_model().


Method unmarshal()

Unmarshal the learner's model.

Usage

LearnerClassifFastai$unmarshal(...)

Arguments

...

(any)
Additional arguments passed to mlr3::marshal_model().


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerClassifFastai$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.