--sparse

Switch

--sparse

Description

Use sparse representation for X when training / testing.

Argument and Default Value

Default value is False.

Details

Often calls the Scipy csr_matrix (Compressed Sparse Row) class. Sparse matrices can be used in arithmetic operations: they support addition, subtraction, multiplication, division, and matrix power.

Advantages of the CSR format efficient arithmetic operations CSR + CSR, CSR * CSR, etc. efficient row slicing fast matrix vector products Disadvantages of the CSR format slow column slicing operations changes to the sparsity structure are expensive

Other Switches

Optional Switches — usable with most training/testing/prediction switches, e.g.:

Example Commands

Using the packaged dla_tutorial dataset (see Differential Language Analysis (DLA) Tutorial):

dlatkInterface.py -d dla_tutorial -t msgs -c user_id -f 'feat$1gram$msgs$user_id$16to16$0_01' \
--outcome_table blog_outcomes --outcomes age --combo_test_regression --sparse