Class "GenRegRes" and "ThetaRegRes"
GenRegRes-class.RdRegularisation 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 hyper-parameters tested.design:Object of class
"numeric"describing the cross-validation design, the test data size and the number of replications.log:Object of class
"list"with warnings thrown during the hyper-parameters 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 hyper-parameters for each replication.f1Matrices:Object of class
"list"with respectivetimescross-validation F1 matrices.cmMatrices:Object of class
"list"with respectivetimescontingency matrices.testPartitions:Object of class
"list"with respectivetimestest partitions.datasize:Object of class
"list"with details about the respective inner and outter training and testing data sizes.
Only in ThetaRegRes:
predictions:A
listof predictions for the optimisation iterations.otherWeights:Alternative best theta weigts: a vector per iterations,
NULLif 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. Whentis 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
ThetaRegResoptimisation 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 macro-F1 score, considering that multiple max scoring combinations are possible) or"count"(the observed weight that get the maximum number of observations, seef1Count). ThefavourPargument can be used to prioritise weights that favour the primary data (i.e. heigh weights). SeefavourPrimarybelow. - 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
listofThetaRegResinstances to be combined and returnes a newThetaRegResinstance.favourPrimary(primary, auxiliary, object, verbose = TRUE)Takes the
primaryandauxiliarydata sources (twoMSnSetinstances) and aThetaRegResobject and returns and updatedThetaRegResinstance containing best parameters/weigths (see thegetParamsfunction) favouring the primary data when multiple best theta weights are available.
Examples
showClass("GenRegRes")
#> Class "GenRegRes" [package "pRoloc"]
#>
#> Slots:
#>
#> Name: algorithm hyperparameters design log
#> Class: character list numeric list
#>
#> Name: seed results f1Matrices cmMatrices
#> Class: integer matrix list list
#>
#> Name: testPartitions datasize
#> Class: list list
#>
#> Known Subclasses: "ThetaRegRes"
showClass("ThetaRegRes")
#> Class "ThetaRegRes" [package "pRoloc"]
#>
#> Slots:
#>
#> Name: predictions otherWeights algorithm hyperparameters
#> Class: list list character list
#>
#> Name: design log seed results
#> Class: numeric list integer matrix
#>
#> Name: f1Matrices cmMatrices testPartitions datasize
#> Class: list list list list
#>
#> Extends: "GenRegRes"