groupdata2 | R Documentation |
Methods for dividing data into groups. Create balanced partitions and cross-validation folds. Perform time series windowing and general grouping and splitting of data. Balance existing groups with up- and downsampling.
The groupdata2
package provides six main functions:
group()
, group_factor()
, splt()
, partition()
,
fold()
, and balance()
.
Create groups from your data.
Divides data into groups by a wide range of methods.
Creates a grouping factor with 1
s for group 1, 2
s for group 2, etc.
Returns a data.frame
grouped by the grouping factor
for easy use in magrittr
pipelines.
Go to group()
Create grouping factor for subsetting your data.
Divides data into groups by a wide range of methods.
Creates and returns a grouping factor
with 1
s for group 1, 2
s for group 2, etc.
Go to group_factor()
Split data by a wide range of methods.
Divides data into groups by a wide range of methods. Splits data by these groups.
Go to splt()
Create balanced partitions (e.g. training/test sets).
Splits data into partitions. Balances a given categorical variable between partitions and keeps (if possible) all data points with a shared ID (e.g. participant_id) in the same partition.
Go to partition()
Create balanced folds for cross-validation.
Divides data into groups (folds) by a wide range of methods. Balances a given categorical variable between folds and keeps (if possible) all data points with the same ID (e.g. participant_id) in the same fold.
Go to fold()
Balance the sizes of your groups with up- and downsampling.
Uses up- and/or downsampling to fix the group sizes to the
min
, max
, mean
, or median
group size or
to a specific number of rows. Has a set of methods for balancing on
ID level.
Go to balance()
Ludvig Renbo Olsen, r-pkgs@ludvigolsen.dk
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.