-
Notifications
You must be signed in to change notification settings - Fork 3
/
plotTensor.Rd
44 lines (38 loc) · 1.44 KB
/
plotTensor.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot_tensor.R
\name{plotTensor}
\alias{plotTensor}
\title{Visualize bivariate tensor products}
\usage{
plotTensor(cboost, tname, npoints = 100L, nbins = 15L)
}
\arguments{
\item{cboost}{(\link{Compboost})\cr
A trained \code{Compboost} object.}
\item{tname}{(\code{character(2L)})\cr
Name of the tensor base learner.}
\item{npoints}{(\code{integer(1L)})\cr
Number of grid points per numerical feature. Note: For two numerical features,
the overall number of grid points is \code{npoints^2}. For a numerical and
categorical feature it is \code{npoints * ncat} with \code{ncat} the number
of categories. For two categorical features \code{ncat^2} grid points are
drawn.}
\item{nbins}{(\code{logical(1L)})\cr
Number of bins for the surface. Only applies in the case of two numerical features.
A smooth surface is drawn if \code{nbins = NULL}.}
}
\value{
\code{ggplot} object containing the graphic.
}
\description{
This function visualizes the contribution of a bivariate tensor product.
}
\examples{
cboost = Compboost$new(data = iris, target = "Petal.Length",
learning_rate = 0.1)
cboost$addTensor("Sepal.Width", "Sepal.Length", df1 = 4, df2 = 4, n_knots = 7)
cboost$addTensor("Sepal.Width", "Species", df1 = 4, df2 = 2, n_knots = 7)
cboost$train(100L)
plotTensor(cboost, "Sepal.Width_Species_tensor", npoints = 10L)
plotTensor(cboost, "Sepal.Width_Sepal.Length_tensor", npoints = 10L)
}