Description Usage Arguments Details Value Examples
View source: R/train_classifier.R
This function trains a Support Vector Machine (SVM) or Random Forest (RF) classifier for use in an image classification.
1 2 3 |
train_data |
a |
type |
either "svm" (to fit a support vector machine) or "rf" (to fit a random forest). |
use_training_flag |
indicates whether to exclude data flagged as
testing data when training the classifier. For this to work the input
train_data |
train_control |
default is NULL (reasonable values will be set
automatically). For details see |
tune_grid |
the training grid to be used for training the classifier. See Details. |
use_rfe |
whether to use Recursive Feature Extraction (RFE) as
implemented in the |
factors |
a list of character vector giving the names of predictors
(layer names from the images used to build |
... |
additional arguments (such as |
For type='svm'
, tunegrid
must be a data.frame
with two
columns: ".sigma" and ".C". For type='rf'
, must be a
data.frame
with one column: '.mtry'.
This function will run in parallel if a parallel backend is registered with
foreach
.
a trained model (as a train
object from the caret
package)
1 2 3 | train_data <- get_pixels(L5TSR_1986, L5TSR_1986_2001_training, "class_1986",
training=.6)
model <- train_classifier(train_data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.