compute_viewpoints: Compute viewpoints

Description Usage Arguments Value

View source: R/1-compute-viewpoints.R

Description

This function computes viewpoints (features) for every chord sequence in a corpus, and saves the result to disk.

Usage

1
2
3
4
5
6
7
8
compute_viewpoints(
  corpus,
  parent_dir,
  output_dir = file.path(parent_dir, "0-viewpoints"),
  seq_test = seq_along(corpus),
  viewpoints = hvr::hvr_viewpoints,
  verbose = TRUE
)

Arguments

corpus

A corpus of chord sequences as created by corpus. Must be encoded in the pc_chord representation.

parent_dir

(Character scalar) The parent directory for the output files, shared with functions such as compute_ppm_analyses and compute_model_matrix. Ignored if dir is provided.

output_dir

(Character scalar) The output directory for the viewpoint analyses. Will be created if it doesn't exist already.

seq_test

(Integer vector) Provides the indices of the sequences in corpus that will eventually be predicted by the model. Sequences not included in seq_test will only be used for training. Training sequences only need viewpoints to be computed for observed chords, not the full alphabet of possible chords.

viewpoints

List of viewpoints to apply, as created by new_viewpoint. Defaults to a fairly comprehensive list, hvr_viewpoints.

verbose

(Logical scalar) Whether or not to print verbose status reports.

Value

The primary output is written to disk in the output_dir directory.


pmcharrison/hvr documentation built on April 14, 2020, 2:47 a.m.