Adjustments / fixes... And add knn for regression
[agghoo.git] / man / agghoo.Rd
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/agghoo.R
3 \name{agghoo}
4 \alias{agghoo}
5 \title{agghoo}
6 \usage{
7 agghoo(data, target, task = NULL, gmodel = NULL, params = NULL, quality = NULL)
8 }
9 \arguments{
10 \item{data}{Data frame or matrix containing the data in lines.}
11
12 \item{target}{The target values to predict. Generally a vector.}
13
14 \item{task}{"classification" or "regression". Default:
15 regression if target is numerical, classification otherwise.}
16
17 \item{gmodel}{A "generic model", which is a function returning a predict
18 function (taking X as only argument) from the tuple
19 (dataHO, targetHO, param), where 'HO' stands for 'Hold-Out',
20 referring to cross-validation. Cross-validation is run on an array
21 of 'param's. See params argument. Default: see R6::Model.}
22
23 \item{params}{A list of parameters. Often, one list cell is just a
24 numerical value, but in general it could be of any type.
25 Default: see R6::Model.}
26
27 \item{quality}{A function assessing the quality of a prediction.
28 Arguments are y1 and y2 (comparing a prediction to known values).
29 Default: see R6::AgghooCV.}
30 }
31 \value{
32 An R6::AgghooCV object.
33 }
34 \description{
35 Run the agghoo procedure. (...)
36 }
37 \examples{
38 # Regression:
39 a_reg <- agghoo(iris[,-c(2,5)], iris[,2])
40 a_reg$fit()
41 pr <- a_reg$predict(iris[,-c(2,5)] + rnorm(450, sd=0.1))
42 # Classification
43 a_cla <- agghoo(iris[,-5], iris[,5])
44 a_cla$fit(mode="standard")
45 pc <- a_cla$predict(iris[,-5] + rnorm(600, sd=0.1))
46
47 }