Learn R Programming

fastTextR (version 1.0)

ft.control: Default Control Settings

Description

A auxiliary function for defining the control variables.

Usage

ft.control(loss = c("softmax", "hs", "ns"), learning_rate = 0.05,
  learn_update = 100L, word_vec_size = 5L, window_size = 5L, epoch = 5L,
  min_count = 5L, min_count_label = 0L, neg = 5L, max_len_ngram = 1L,
  nbuckets = 2000000L, min_ngram = 3L, max_ngram = 6L, nthreads = 1L,
  threshold = 1e-04, label = "__label__", verbose = 0,
  pretrained_vectors = "")

Arguments

loss

a character string giving the name of the loss function allowed values are 'softmax', 'hs' and 'ns'.

learning_rate

a numeric giving the learning rate, the default value is 0.05.

learn_update

an integer giving after how many tokens the learning rate should be updated. The default value is 100L, which means the learning rate is updated every 100 tokens.

word_vec_size

an integer giving the length (size) of the word vectors.

window_size

an integer giving the size of the context window.

epoch

an integer giving the number of epochs.

min_count

an integer giving the minimal number of word occurences.

min_count_label

and integer giving the minimal number of label occurences.

neg

an integer giving how many negatives are sampled (only used if loss is "ns").

max_len_ngram

an integer giving the maximum length of ngrams used.

nbuckets

an integer giving the number of buckets.

min_ngram

an integer giving the minimal ngram length.

max_ngram

an integer giving the maximal ngram length.

nthreads

an integer giving the number of threads.

threshold

a numeric giving the sampling threshold.

label

a character string specifying the label prefix (default is '__label__').

verbose

an integer giving the verbosity level, the default value is 0L and shouldn't be changed since Rcpp::Rcout cann't handle the traffic.

pretrained_vectors

a character string giving the file path to the pretrained word vectors which are used for the supervised learning.

Value

a list with the control variables.

Examples

Run this code
# NOT RUN {
ft.control(learning_rate=0.1)
# }

Run the code above in your browser using DataLab