Class "GenRegRes" and "ThetaRegRes"
Description
Regularisation framework containers.
Objects from the Class
Object of this class are created with the respective regularisation
function: knnOptimisation
,
svmOptimisation
, plsdaOptimisation
,
knntlOptimisation
, ...
Slots
algorithm
:Object of class
"character"
storing the machine learning algorithm name.hyperparameters
:Object of class
"list"
with the respective algorithm hyperparameters tested.design
:Object of class
"numeric"
describing the crossvalidation design, the test data size and the number of replications.log
:Object of class
"list"
with warnings thrown during the hyperparameters regularisation.seed
:Object of class
"integer"
with the random number generation seed.results
:Object of class
"matrix"
of dimenstionstimes
(seedesign
) by number of hyperparameters + 1 storing the macro F1 values for the respective best hyperparameters for each replication.f1Matrices
:Object of class
"list"
with respectivetimes
crossvalidation F1 matrices.cmMatrices
:Object of class
"list"
with respectivetimes
contingency matrices.testPartitions
:Object of class
"list"
with respectivetimes
test partitions.datasize
:Object of class
"list"
with details about the respective inner and outter training and testing data sizes.
Only in ThetaRegRes
:
predictions
:A
list
of predictions for the optimisation iterations.otherWeights
:Alternative best theta weigts: a vector per iterations,
NULL
if no other best weights were found.
Methods
 getF1Scores
Returns a matrix of F1 scores for the optimisation parameters.
 f1Count
signature(object = "GenRegRes", t = "numeric")
andsignature(object = "ThetaRegRes", t = "numeric")
: Constructs a table of all possible parameter combination and count how many have an F1 scores greater or equal thant
. Whent
is missing (default), the best F1 score is used. This method is useful in conjunctin withplot
. getParams

Returns the best parameters. It is however strongly recommended to inspect the optimisation results. For a
ThetaRegRes
optimisation result, the method to chose the best parameters can be"median"
(default) or"mean"
(the median or mean of the best weights is chosen),"max"
(the first weights with the highest macroF1 score, considering that multiple max scoring combinations are possible) or"count"
(the observed weight that get the maximum number of observations, seef1Count
). ThefavourP
argument can be used to prioritise weights that favour the primary data (i.e. heigh weights). SeefavourPrimary
below.  getSeed
Returns the seed used for the optimisation run.
 getWarnings
signature(object = "GenRegRes")
: Returns a vector of recorded warnings. levelPlot
signature(object = "GenRegRes")
: Plots a heatmap of of the optimisation results. Only for"GenRegRes"
instances. plot
Plots the optisisation results.
 show
Shows the object.
Other functions
Only for ThetaRegRes
:
combineThetaRegRes(object)
Takes a
list
ofThetaRegRes
instances to be combined and returnes a newThetaRegRes
instance.favourPrimary(primary, auxiliary, object, verbose = TRUE)
Takes the
primary
andauxiliary
data sources (twoMSnSet
instances) and aThetaRegRes
object and returns and updatedThetaRegRes
instance containing best parameters/weigths (see thegetParams
function) favouring the primary data when multiple best theta weights are available.
Author(s)
Laurent Gatto <lg390@cam.ac.uk>
Examples
1 2 
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.