Description Super classes Methods Author(s) Examples
R6 class representing a logistic regression model.
R6 class representing a logistic regression model.
modello::module
-> modello::module.lm
-> module.logistic
new()
The initialisation method sets the weights (W), the bais (B) matrices, the objective function (obj), as well as the name of the module. The calculation performed is the following ans = sigmoid(W.op(X) + B)
module.logistic$new(tx, nin, b = TRUE)
tx
if TRUE it traspose the input matrix
nin
number of column of the input matrix
b
if TRUE the intercept term is included
Returns the total number of parameters
op()
Performs: ans = sigmoid(W.op(X) + B)
module.logistic$op(X)
X
input matrix, reference object of class 'number'
Returns a reference object of class 'number'
\donttest{ modello.init(10, 10, 10, 10) X = number(as.matrix(rnorm(10)), dx=FALSE) mdl = module.logistic$new(1, 1, b=FALSE) print(X$v) Yh = mdl$op(X) print(Yh) print(Yh$v) modello.close() }
clone()
The objects of this class are cloneable with this method.
module.logistic$clone(deep = FALSE)
deep
Whether to make a deep clone.
Filippo Monari
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## ------------------------------------------------
## Method `module.logistic$op`
## ------------------------------------------------
modello.init(10, 10, 10, 10)
X = number(as.matrix(rnorm(10)), dx=FALSE)
mdl = module.logistic$new(1, 1, b=FALSE)
print(X$v)
Yh = mdl$op(X)
print(Yh)
print(Yh$v)
modello.close()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.