new Correlations()
The Correlations tool enables an exploration of the extent to which term frequencies vary in sync (terms whose frequencies rise and fall together or inversely).
- Tutorials:
Example
let config = {
columns: null,
dir: null,
docId: null,
docIndex: null,
minInDocumentsCountRatio: null,
query: null,
sort: null,
stopList: null,
termColors: null,
withDistributions: null
};
loadCorpus("austen").tool("correlations", config);
Members
-
columns
-
Properties:
Name Type Description columns
columns 'sourceTerm', 'source-distributions', 'target-distributions', 'targetTerm', 'correlation', 'significance'
-
dir
-
Properties:
Name Type Description dir
String The direction in which to sort the results: 'asc' or 'desc'
-
docId
-
Properties:
Name Type Description docId
String | Array.<String> The document ID(s) to restrict the results to.
-
docIndex
-
Properties:
Name Type Description docIndex
Number | Array.<Number> The document index(es) to restrict the results to.
-
minInDocumentsCountRatio
-
Properties:
Name Type Default Description minInDocumentsCountRatio
Number 100 The minimum coverage (as a percentage) for terms. For instance, if a corpus has 10 documents and the minimum coverage is 20%, at least two of the documents must contain the term or it will be ignored.
-
query
-
Properties:
Name Type Description query
String | Array.<String> A query or array of queries (queries can be separated by a comma). For query syntax, see the search documentation.
-
sort
-
Properties:
Name Type Description sort
String The column to sort the results by
-
stopList
-
Properties:
Name Type Default Description stopList
String auto A comma-separated list of words, a named list or a URL to a plain text list, one word per line. By default this is set to 'auto' which auto-detects the document's language and loads an appropriate list (if available for that language). Set this to blank to not use the default stopList. For more information see the Stopwords documentation.
-
termColors
-
Properties:
Name Type Default Description termColors
String categories Which term colors to show in the grid. By default this is set to 'categories' which shows the term color only if it's been assigned by a category. The other alternatives are 'terms' which shows all terms colors, and '' or undefined which shows no term colors.
-
withDistributions
-
Properties:
Name Type Default Description withDistributions
String relative Determines whether to show "raw" or "relative" frequencies (those are the two valid values). The default value is "relative" (unless there's only one document in the corpus, in which case raw frequencies are shown).