Learn R Programming

mlspatial (version 0.1.1)

train_svr: Train Support Vector Regression (SVR) model

Description

Train Support

Usage

train_svr(data, formula)

Value

A trained svm model object from the e1071 package.

Arguments

data

A data frame containing the training data.

formula

A formula specifying the model.

Details

Trains an SVR model using the radial kernel.

Examples

Run this code
# \donttest{
# Load required package
library(e1071)

# Use built-in dataset
data(mtcars)

# Define regression formula
svr_formula <- mpg ~ cyl + disp + hp + wt

# Train SVR model
svr_model <- train_svr(data = mtcars, formula = svr_formula)

# Print model summary
print(svr_model)

# Predict on the same data (for illustration)
preds <- predict(svr_model, newdata = mtcars)
head(preds)
# }

Run the code above in your browser using DataLab