BNS | R Documentation |
Creates BNS (bi-normal separation) model. Defined as: Q(true positive rate) - Q(false positive rate), where Q is a quantile function of normal distribution.
BNS
R6Class
object.
Bi-Normal Separation
bns_stat
data.table
with computed BNS statistic.
Useful for feature selection.
For usage details see Methods, Arguments and Examples sections.
bns = BNS$new(treshold = 0.0005) bns$fit_transform(x, y) bns$transform(x)
$new(treshold = 0.0005)
Creates bns model
$fit_transform(x, y)
fit model to an input sparse matrix (preferably in "dgCMatrix" format) and then transforms it.
$transform(x)
transform new data x
using bns from train data
A BNS
object
An input document term matrix. Preferably in dgCMatrix
format
Binary target variable coercible to logical.
Clipping treshold to avoid infinities in quantile function.
## Not run:
data("movie_review")
N = 1000
it = itoken(head(movie_review$review, N), preprocessor = tolower, tokenizer = word_tokenizer)
vocab = create_vocabulary(it)
dtm = create_dtm(it, vocab_vectorizer(vocab))
model_bns = BNS$new()
dtm_bns = model_bns$fit_transform(dtm, head(movie_review$sentiment, N))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.