title | description | author | ms.author | ms.date | ms.service | ms.subservice | ms.topic | keywords | monikerRange | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
kernel function (MicrosoftML) |
Kernels supported for use in computing inner products. |
rothja |
jroth |
07/15/2019 |
sql |
machine-learning |
reference |
|
>=sql-server-2016||>=sql-server-linux-ver15 |
Kernels supported for use in computing inner products.
linearKernel(...)
polynomialKernel(a = NULL, bias = 0, deg = 3, ...)
rbfKernel(gamma = NULL, ...)
sigmoidKernel(gamma = NULL, coef0 = 0, ...)
The numeric value for a in the term (a*<x,y> + b)^d. If not specified, (1/(number of features)
is used.
The numeric value for b in the term (a*<x,y> + b)^d
.
The integer value for d in the term (a*<x,y> + b)^d
.
The numeric value for gamma in the expression tanh(gamma*<x,y> + c
). If not specified, 1/(number of features)
is used.
The numeric value for c in the expression tanh(gamma*<x,y> + c
).
Additional arguments passed to the Microsoft ML compute engine.
These helper functions specify the kernel that is used for training in relevant algorithms. The kernels that are supported:
linearKernel
: linear kernel.
rbfKernel
: radial basis function kernel.
polynomialKernel
: polynomial kernel.
sigmoidKernel
: sigmoid kernel.
A character string defining the kernel.
Microsoft Corporation Microsoft Technical Support
Estimating the Support of a High-Dimensional Distribution
# Simulate some simple data
set.seed(7)
numRows <- 200
normalData <- data.frame(day = 1:numRows)
normalData$pageViews = runif(numRows, min = 10, max = 1000) + .5 * normalData$day
testData <- data.frame(day = 1:numRows)
# The test data has outliers above 1000
testData$pageViews = runif(numRows, min = 10, max = 1400) + .5 * testData$day
train <- function(kernelFunction, args=NULL) {
model <- rxOneClassSvm(formula = ~pageViews + day, data = normalData,
kernel = kernelFunction(args))
scores <- rxPredict(model, data = testData, writeModelVars = TRUE)
scores$groups = scores$Score > 0
scores
}
display <- function(scores) {
print(sum(scores$groups))
rxLinePlot(pageViews ~ day, data = scores, groups = groups, type = "p",
symbolColors = c("red", "blue"))
}
scores <- list()
scores$rbfKernel <- train(rbfKernel)
scores$linearKernel <- train(linearKernel)
scores$polynomialKernel <- train(polynomialKernel, (a = .2))
scores$sigmoidKernel <- train(sigmoidKernel)
display(scores$rbfKernel)
display(scores$linearKernel)
display(scores$polynomialKernel)
display(scores$sigmoidKernel)