ComputeInterestingTuplesDiscrete: Interesting tuples (discrete)

View source: R/information_gain.R

ComputeInterestingTuplesDiscreteR Documentation

Interesting tuples (discrete)

Description

Interesting tuples (discrete)

Usage

ComputeInterestingTuplesDiscrete(
  data,
  decision = NULL,
  dimensions = 2,
  pc.xi = 0.25,
  ig.thr = 0,
  I.lower = NULL,
  interesting.vars = vector(mode = "integer"),
  require.all.vars = FALSE,
  return.matrix = FALSE
)

Arguments

data

input data where columns are variables and rows are observations (all discrete with the same number of categories)

decision

decision variable as a binary sequence of length equal to number of observations

dimensions

number of dimensions (a positive integer; 5 max)

pc.xi

parameter xi used to compute pseudocounts (the default is recommended not to be changed)

ig.thr

IG threshold above which the tuple is interesting (0 and negative mean no filtering)

I.lower

IG values computed for lower dimension (1D for 2D, etc.)

interesting.vars

variables for which to check the IGs (none = all)

require.all.vars

boolean whether to require tuple to consist of only interesting.vars

return.matrix

boolean whether to return a matrix instead of a list (ignored if not using the optimised method variant)

Details

If running in 2D and no filtering is applied, this function is able to run in an optimised fashion. It is recommended to avoid filtering in 2D if only it is feasible.

If decision is omitted, this function calculates mutual information. Translate "IG" to mutual information in the rest of this function's description, except for I.lower where it means entropy.

Value

A data.frame or NULL (following a warning) if no tuples are found.

The following columns are present in the data.frame:

  • Var – interesting variable index

  • Tuple.1, Tuple.2, ... – corresponding tuple (up to dimensions columns)

  • IG – information gain achieved by var in Tuple.*

Additionally attribute named run.params with run parameters is set on the result.

Examples


ig.1d <- ComputeMaxInfoGainsDiscrete(madelon$data > 500, madelon$decision, dimensions = 1)
ComputeInterestingTuplesDiscrete(madelon$data > 500, madelon$decision, dimensions = 2,
                                 ig.thr = 100, I.lower = ig.1d$IG)


MDFS documentation built on April 19, 2022, 5:05 p.m.