ENSIGN Python API¶
ensign.csv2tensor
¶
Converts tabular data into a sparse tensor.
|
Creates a sparse tensor from one or more CSV files or Bro/Zeek logs. |
|
Variant of csv2tensor where in-memory DataFrames are passed instead of paths to files on disk. |
ensign.cp_decomp
¶
CANDECOMP-PARAFAC (CP) sparse tensor decomposition tools.
This module contains functions for reading, writing, and performing CP decompositions along with a class for representing decomposition results.
Represents the results of a CP decomposition. |
|
Computes CP Decomposition backtracking information. |
|
|
Reads a CP decomposition from the filesystem. |
Writes a CP decomposition to the filesystem. |
|
|
Reconstructs a CP decomposition ‘into’ a sparse tensor. |
|
Calculates fit for each entry of a reconstructed tensor present in the original tensor. |
|
Checks if weights and factor matrices are close according to tolerance. |
|
Performs a CP decomposition using the alternating least squares (ALS) method. |
|
Performs a nonnegative CP decomposition using the alternating least squares (ALS) method. |
|
Performs a CP decomposition using the alternating Poisson regression (APR) method. |
|
Performs a CP decomposition using alternating Poisson regression (APR) with projected damped Newton row (PDNR) subproblem. |
|
Performs a CP decomposition using alternating Poisson regression (APR) with projected quasi-Newton row (PQNR) subproblem. |
ensign.sptensor
¶
Sparse tensor tools.
This module contains functions for reading, writing, and representing sparse tensors.
|
Represents a sparse tensor. |
|
Writes a text representation of the sparse tensor to the given directory. |
|
Reads a sparse tensor file from the filesystem. |
|
Writes a sparse tensor to the filesystem. |
ensign.visualize
¶
Visualize a tensor decomposition by plotting scores for selected components in each mode.
|
Visualizes a specific component of a decomposition using blue-line charts. |
ensign.comp_top_k
¶
Module for investigating the contents of a tensor decomposition by listing the highest scoring labels in a component.
|
Computes the top k labels and corresponding scores for each mode for each component in the list. |
ensign.query_decomp
¶
Return all components containing the query label in the given mode. Up to k components are printed where <query label> has a non-zero score.
|
Compute all components containing the query label in the given mode. |
ensign.synchronize_labels
¶
Adjusts labels of multiple tensors and/or CP decompositions such that identical labels (e.g., “1/1/1970”, “10.1.1.1”) map to unique indices (e.g., 5, 437).
Synchronizes labels between tensors. |
|
Synchronizes specified modes between a base decomposition and an update tensor. |
ensign.decomp_diff
¶
|
Determine differences(similarities) between decompositions. |