alpha | R Documentation |
This function calculates Alpha irreplaceability. Inputs can be single
parameter values needed to calculate Alpha, vectors of parameter values to
calculate a vector of Alpha values, or a data.frame
with columns
containing parameters needed to calculate a vector of Alpha values.
Single Alpha measurement: If local
, global
and
target
are numeric, it calculates and returns Alpha irreplaceability.
Vectorized Alpha measurement: If local
, global
and target
are vectors of the same length, a vector of Alpha
irreplaceability values will be calculated and returned.
Dataframe Alpha measurement: If df
is provided and
local
, global
and target
are strings representing
field names in df
, a vector of Alpha irreplaceability values will be
caluclated and returned. Optionally: If alpha_col
is also
provided, a data.frame
identical to df
will be returned with
the calculated Alpha values in the alpha_col
column.
alpha(
local,
global,
target,
df = NULL,
alpha_col = NULL,
triage = FALSE,
na.allow = NULL,
overwrite = FALSE
)
local |
number, vector or string - The feature's representation at the site, or the name of the column containing the feature's representation at the site. |
global |
number, vector or string - The feature's globally available representation, or the name of the column containing the feature's globally available representation. |
target |
number, vector or string - The feature's target, or the name of the column containing the feature's target. |
df |
data.frame - Optional; an input data.frame. |
alpha_col |
string - The name of the column where to write alpha values. If both df and alpha_col are provided, the output will be the input dataframe with the additional column. |
triage |
logical - Should features with unachievable targets be ignored?
Defaults to |
na.allow |
logical - Allaw |
overwrite |
logical - Should |
A number, vector or data.frame
Daniele Baisero, daniele.baisero@gmail.com
alpha(1, 100, 45)
alpha(c(1,25,45), c(100,100,100), c(50,50,50))
dtfrm = data.frame(
loc = c(1,25,45),
glob = c(100,100,100),
targ = c(50,50,50)
)
alpha('loc', 'glob', 'targ', df = dtfrm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.