Description Usage Arguments Value See Also
This function fits a set of weighted kernel SVMs for binary treatment comparisons.
1 2 3 4 5 6 7 8 9 10 11 12 13 | mlearn.wsvm(
train_data,
test_data,
idx,
trts,
max_size,
delta,
dist_mat,
g_func,
kernel = "rbfdot",
kpar = "automatic",
C
)
|
train_data |
a data frame for subjects in training fold(s), containing
the ID ( |
test_data |
a data frame for subjects in test fold(s), containing
the ID ( |
idx |
a data frame of two columns |
trts |
a vector of treatment names. |
max_size |
an integer indicating the upper limit of the sizes of all
matched sets. The default setting is |
delta |
a scalar, as defined in |
dist_mat |
a precalculated matrix of distances between subjects.
This matrix must include all subjects in |
g_func |
a function that transforms the differences between outcomes
of a set of subjects and the subjects in their matched sets to the weights
in SVMs. In |
kernel |
the kernel function used in SVMs. Supported argument values
can be found in |
kpar |
the list of hyper-parameters (kernel parameters). Valid
parameters for supported kernels can be found in |
C |
a scalar that is the cost of constraints violation in SVMs. This is the "C"-constant of the regularization term in the Lagrange formulation. |
A list with 2 sublists as follows:
Suppose there are K
treatments in the input data,
model
: a list with K(K-1)/2
sublists. Each sublist is a weighted
SVM (trained on train_data
) for the corresponding binary treatment
comparison.
prediction
: a matrix with K(K-1)/2
columns. Each column is the
recommendations between the corresponding treatment pair for subjects in
test_data
.
ksvm
and dots
for
kernel
. weighted.ksvm
for fitting weighted SVMs.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.