Skip to contents

This method return a maximum number of weights of the model not yet integer.

Usage

findk(
  x,
  y,
  nfolds = 1,
  gamma = 1,
  k.sparse = NULL,
  vartype = "real",
  lb = -1,
  ub = 1
)

Arguments

x

matrix or dataframe of predictors, of dimension n*p; each row is an observation vector.

y

response variable (1 or -1)

nfolds

k-folds cross-validation that we want test. Dedault value is 1.

gamma

is the hinge loss parameter.. Defines the margin

k.sparse

is the sparsity (non-negative real value). Default value is k.sparse = NULL - no constraint.

vartype

is the type of coefficients : cplexAPI::CPX_INTEGER, cplexAPI::CPX_BINARY, cplexAPI::CPX_CONTINUOUS. Default vartype = cplexAPI::CPX_INTEGER

lb

is the lower bound of coefficients

ub

is the upper bound of coefficients

Value

An integer is number of coefficients not yet integer.