Skip to content

Commit

Permalink
Fix documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fouodo committed Jul 13, 2024
1 parent 11dffb7 commit da2ccc5
Show file tree
Hide file tree
Showing 18 changed files with 83 additions and 86 deletions.
16 changes: 8 additions & 8 deletions R/Data.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Data <- R6Class("Data",
#' @description
#' Constructor of class Data.
#'
#' @param id (`character()`) \cr
#' @param id (`character(1)`) \cr
#' Object ID.
#' @param ind_col \cr
#' @param ind_col (`character(1)`) \cr
#' Column name containing individual IDs.
#' @param data_frame \cr
#' \code{data.frame} containing data.
Expand All @@ -42,9 +42,9 @@ Data <- R6Class("Data",
#' @description
#' Retrieve a data subset for a given variable name and values, a data subset.
#'
#' @param var_name \cr
#' @param var_name `character(1)` \cr
#' Variable name of interest.
#' @param value \cr
#' @param value `vector(n)` \cr
#' Values of interest.
#'
#' @return
Expand All @@ -53,7 +53,7 @@ Data <- R6Class("Data",
#' @export
#'
getIndSubset = function (var_name, value) {
# FIXME: Also profide a function getVarSubset() later
# TODO: Also provide a function getVarSubset() later
subset_data <- self$clone(deep = FALSE)
index = which(subset_data$getDataFrame()[[var_name]] %in% value)
data_frame = subset_data$getDataFrame()[index, ]
Expand All @@ -64,9 +64,9 @@ Data <- R6Class("Data",
#' For the given variable name, non existing values in the
#' current dataset are returned.
#'
#' @param var_name \cr
#' @param var_name `character(1)` \cr
#' Variable name of interest.
#' @param value
#' @param value `vector(n)` \cr
#' Values of interest.
#'
#' @return
Expand Down Expand Up @@ -97,7 +97,7 @@ Data <- R6Class("Data",
#' @description
#' Set a new \code{data.frame} to the current object.
#'
#' @param data_frame
#' @param data_frame `data.frame(1)`
#'
#' @return
#' The current object is returned.
Expand Down
8 changes: 4 additions & 4 deletions R/HashTable.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ HashTable <- R6Class("HashTable",
#' @description
#' Initialize a default parameters list.
#'
#' @param id (`character(1)`)\cr
#' @param id (`character(1)`) \cr
#' ID of the hash table. It must be unique.
#'
#' @export
Expand All @@ -23,11 +23,11 @@ HashTable <- R6Class("HashTable",
},
#' @description
#' Function to add a key-value pair to the hash table.
#' @param key (`character(1)`)\cr
#' @param key (`character(1)`) \cr
#' The key to be added.
#' @param value (`object(1)`)\cr
#' @param value (`object(1)`) \cr
#' Object to be added.
#' @param .class (`character(1)`)\cr
#' @param .class (`character(1)`) \cr
#' Class of the object to be added.
#' @export
#'
Expand Down
12 changes: 6 additions & 6 deletions R/Lrner.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ Lrner <- R6Class("Lrner",
#'
#'
#' Learner ID.
#' @param id (`character()`) \cr
#' @param id (`character(1)`) \cr
#' Package that implements the learn function. If NULL, the
#' learn function is called from the current environment.
#' @param package (`character()`) \cr
#' @param package (`character(1)`) \cr
#' Learn function name.
#' @param lrn_fct (`character()`) \cr
#' @param lrn_fct (`character(1)`) \cr
#' Learn parameters.
#' @param param (`Param()`) \cr
#' @param param (`Param(1)`) \cr
#' Layer on which the learner is stored.
#' @param train_layer (`TrainLayer()`) \cr
#' @param train_layer (`TrainLayer(1)`) \cr
#' The training layer where to store the learner.
initialize = function (id,
package = NULL,
Expand Down Expand Up @@ -66,7 +66,7 @@ Lrner <- R6Class("Lrner",
#' @description
#' Tains the current learner (from class [Lrner]) on the current training data (from class [TrainData]).
#'
#' @param ind_subset \cr
#' @param ind_subset `vector(1)` \cr
#' Individual ID subset on which the training will be performed.
#'
#' @return
Expand Down
12 changes: 6 additions & 6 deletions R/Model.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ Model <- R6Class("Model",
#' @description
#' Constructor of Model class.
#'
#' @param lrner (`Lrner()`) \cr
#' @param lrner (`Lrner(1)`) \cr
#' The learner.
#' @param train_data (`TrainData()`) \cr
#' @param train_data (`TrainData(1)`) \cr
#' Training data.
#' @param base_model (`object()`) \cr
#' @param base_model (`object(1)`) \cr
#' Base model as returned by the original learn function.
#' @param train_layer \cr
#' @param train_layer (`TrainLayer(1)`) \cr
#' The current training layer on which the model is stored.
#'
#' @return
Expand Down Expand Up @@ -110,9 +110,9 @@ Model <- R6Class("Model",
#' Predict target values for the new data
#' (from class [NewData]) taken as into.
#'
#' @param new_data \cr
#' @param new_data `NewData(1)` \cr
#' An object from class [NewData].
#' @param ind_subset \cr
#' @param ind_subset `vector(1)` \cr
#' Subset of individual IDs to be predicted.
#' @param ...
#' Further parameters.
Expand Down
8 changes: 4 additions & 4 deletions R/NewData.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ NewData <- R6Class("NewData",
#' @description
#' Initialize a new object from the current class.
#'
#' @param id (`character()`) \cr
#' @param id (`character(1)`) \cr
#' Object ID.
#' @param ind_col (`character()`)\cr
#' @param ind_col (`character(1)`)\cr
#' Column name containing individual IDs.
#' @param data_frame (`data.frame()`)\cr
#' @param data_frame (`data.frame(1)`)\cr
#' \code{data.frame} containing data.
#' @param new_layer (`NewLayer()`) \cr
#' @param new_layer (`NewLayer(1)`) \cr
#' Layer where to store the current object.
initialize = function (id,
data_frame,
Expand Down
4 changes: 2 additions & 2 deletions R/NewLayer.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ NewLayer <- R6Class("NewLayer",
#' @description
#' constructor
#'
#' @param id (`character()`)\cr
#' @param id (`character(1)`)\cr
#' See class Param
#' @param new_study (`NewStudy()`)\cr
#' @param new_study (`NewStudy(1)`)\cr
#'
initialize = function (id, new_study) {
super$initialize(id = id)
Expand Down
12 changes: 6 additions & 6 deletions R/NewMetaLayer.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ NewMetaLayer <- R6Class("NewMetaLayer",
#' @description
#' constructor
#'
#' @param id (`character()`)\cr
#' @param id (`character(1)`)\cr
#' See class Param
#' @param new_study (`NewStudy()`)\cr
#' @param new_study (`NewStudy(1)`)\cr
#'
initialize = function (id, new_study) {
super$initialize(id = id)
Expand Down Expand Up @@ -88,13 +88,13 @@ NewMetaLayer <- R6Class("NewMetaLayer",
#' Create and set an [NewData] object to the current
#' new meta learner.
#'
#' @param id `character()` \cr
#' @param id `character(1)` \cr
#' ID of the [NewData] object to be instanciated.
#' @param ind_col `character()` \cr
#' @param ind_col `character(1)` \cr
#' Name of individual column IDs.
#' @param data_frame `data.frame` \cr
#' @param data_frame `data.frame(1)` \cr
#' \code{data.frame} of layer specific predictions.
#' @param meta_layer `NewLayer()` \cr
#' @param meta_layer `NewLayer(1)` \cr
#' Layer where to store the [NewData] object.
#'
#' @export
Expand Down
5 changes: 2 additions & 3 deletions R/NewStudy.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ NewStudy <- R6Class("NewStudy",
#'
#' @param id (`character(1)`)\cr
#' See class Param
#' @param ind_col (`character(0L)`)
#' @param ind_col (`character(1)`)
#' Name of column of individuals IDS
initialize = function (id, ind_col) {
super$initialize(id = id)
Expand Down Expand Up @@ -96,7 +96,7 @@ NewStudy <- R6Class("NewStudy",
getIndIDs = function() {
# FIXME: Adjust to the Predict class
layers = self$getKeyClass()
# This code accesses each layer (except MetaLayer) level
# This code accesses each layer (except the MetaLayer) level
# and get the target variable
layers = layers[layers$class %in% "NewLayer", ]
ids_data = NULL
Expand Down Expand Up @@ -140,6 +140,5 @@ NewStudy <- R6Class("NewStudy",
ind_col = character(0L),
target = character(0L)
),
# TODO: Define a deep_clone function for this class.
cloneable = FALSE
)
8 changes: 4 additions & 4 deletions R/PredictData.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ PredictData <- R6Class("PredictData",
#' @description
#' Initialize a new object from the current class.
#'
#' @param id (`character()`) \cr
#' @param id (`character(1)`) \cr
#' Object ID.
#' @param ind_col (`character()`)\cr
#' @param ind_col (`character(1)`)\cr
#' Column name containing individual IDs.
#' @param data_frame (`data.frame()`)\cr
#' @param data_frame (`data.frame(1)`)\cr
#' \code{data.frame} containing data.
initialize = function (id,
ind_col,
Expand Down Expand Up @@ -63,7 +63,7 @@ PredictData <- R6Class("PredictData",
#' @description
#' Assigns a predicted layer to the predicted data.
#'
#' @param predict_layer `PredictLayer()` \cr
#' @param predict_layer `PredictLayer(1)` \cr
#'
#' @return
#' The current object
Expand Down
5 changes: 2 additions & 3 deletions R/PredictLayer.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ PredictLayer <- R6Class("PredictLayer",
#' @description
#' constructor
#'
#' @param id (`character()`) \cr
#' @param id (`character(1)`) \cr
#' The layer ID.
initialize = function (id) {
super$initialize(id = id)
Expand Down Expand Up @@ -80,7 +80,7 @@ PredictLayer <- R6Class("PredictLayer",
#' @description
#' Assigns a predicted study to the predicted layer.
#'
#' @param predict_study `PredictStudy()` \cr
#' @param predict_study `PredictStudy(1)` \cr
#'
#' @return
#' The current object
Expand All @@ -104,6 +104,5 @@ PredictLayer <- R6Class("PredictLayer",
private = list(
predict_study = NULL
),
# TODO: define a deep_clone function for this class.
cloneable = FALSE
)
4 changes: 2 additions & 2 deletions R/PredictMetaLayer.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ PredictMetaLayer <- R6Class("PredictMetaLayer",
#' @description
#' constructor
#'
#' @param id (`character()`)\cr
#' @param id (`character(1)`)\cr
#' See class Param
#' @param predict_study (`PredictStudy()`)\cr
#' @param predict_study (`PredictStudy(1)`)\cr
#'
initialize = function (id, predict_study) {
super$initialize(id = id)
Expand Down
5 changes: 2 additions & 3 deletions R/PredictStudy.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ PredictStudy <- R6Class("PredictStudy",
#'
#' @param id (`character(1)`)\cr
#' See class Param
#' @param ind_col (`character(0L)`)
#' @param ind_col (`character(1L)`)
#' Name of column of individuals IDS
initialize = function (id, ind_col) {
super$initialize(id = id)
Expand All @@ -45,7 +45,7 @@ PredictStudy <- R6Class("PredictStudy",
cat(sprintf("PredictStudy : %s\n", private$id))
cat(sprintf("Nb. layers : %s\n", length(private$hash_table)))
},
#' @param meta_layer_id (`character()`) \cr
#' @param meta_layer_id (`character(1)`) \cr
#' ID of the meta layer where the new meta data will be stored.
#'
#' @description
Expand Down Expand Up @@ -143,6 +143,5 @@ PredictStudy <- R6Class("PredictStudy",
private = list(
ind_col = NULL
),
# TODO: Define a deep_clone function for this class.
cloneable = FALSE
)
8 changes: 4 additions & 4 deletions R/TrainData.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ TrainData <- R6Class("TrainData",
#' @description
#' Initialize a new object from the current class.
#'
#' @param id (`character()`) \cr
#' @param id (`character(1)`) \cr
#' The Object ID.
#' @param data_frame (`data.frame()`)\cr
#' @param data_frame (`data.frame(1)`)\cr
#' \code{data.frame} containing data.
#' @param train_layer (`TrainLayer()`) \cr
#' @param train_layer (`TrainLayer(1)`) \cr
#' Training layer where to store the current object.
initialize = function (id,
data_frame,
Expand Down Expand Up @@ -122,7 +122,7 @@ TrainData <- R6Class("TrainData",
#' is returned.
#' @export
#'
#FIXME: Maybe rename getNewLayer, getTrainLayer and getPredictLayer as getLayer?
#TODO: Maybe rename getNewLayer, getTrainLayer and getPredictLayer as getLayer?
getNewLayer = function () {
return(private$train_layer)
}
Expand Down
10 changes: 5 additions & 5 deletions R/TrainLayer.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ TrainLayer <- R6Class("TrainLayer",
#' @description
#' constructor
#'
#' @param id (`character()`)\cr
#' @param id (`character(1)`)\cr
#' See class Param
#' @param train_study (`TrainStudy()`)\cr
#' @param train_study (`TrainStudy(1)`)\cr
#'
initialize = function (id, train_study) {
super$initialize(id = id)
Expand Down Expand Up @@ -71,7 +71,7 @@ TrainLayer <- R6Class("TrainLayer",
#' @description
#' Trains the current layer.
#'
#' @param ind_subset [vector] \cr
#' @param ind_subset `vector(1)` \cr
#' ID subset of individuals to be used for training.
#'
#' @return
Expand Down Expand Up @@ -106,8 +106,8 @@ TrainLayer <- R6Class("TrainLayer",
#' @description
#' Predicts values for the new layer taking as argument.
#'
#' @param new_layer [TrainLayer()] \cr
#' @param ind_subset [vector()] \cr
#' @param new_layer `TrainLayer()` \cr
#' @param ind_subset `vector()` \cr
#'
#' @return
#' A new [PredictLayer] object with the predicted data is returned.
Expand Down
Loading

0 comments on commit da2ccc5

Please sign in to comment.