\seekquarry\yioop\library\classifiersInvertedData

Stores a data matrix in an inverted index on columns with non-zero entries.

The index is just an array of entries <j, i, X[i][j]> sorted first by j and then by i, where all X[i][j] > 0. Provides a method to iterate over all rows which have a non-zero entry for a particular column (feature) j. There is no efficient way to iterate over rows in order.

Summary

Methods
Properties
Constants
__construct()
rows()
columns()
iterateColumn()
iterateData()
$rows
$columns
$data
$index
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$rows

$rows : integer

Number of rows in the matrix.

Type

integer

$columns

$columns : integer

Number of columns in the matrix.

Type

integer

$data

$data : array

Array of non-zero matrix entries.

Type

array

$index

$index : array

Array of offsets into the $data array, where each offset gives the start of the entries for a particular feature.

Type

array

Methods

__construct()

__construct(object  $X) 

Converts a SparseMatrix into an InvertedData instance. The data is duplicated.

Parameters

object $X

SparseMatrix instance to convert

rows()

rows() : \seekquarry\yioop\library\classifiers\number

Accessor method which the number of rows in the matrix

Returns

\seekquarry\yioop\library\classifiers\number —

of rows

columns()

columns() : \seekquarry\yioop\library\classifiers\number

Accessor method which the number of columns in the matrix

Returns

\seekquarry\yioop\library\classifiers\number —

of columns

iterateColumn()

iterateColumn(\seekquarry\yioop\library\classifiers\into  $j) : object

Returns an iterator over the values for a particular column of the matrix. If no matrix entry in the column is non-zero then an empty iterator is returned.

Parameters

\seekquarry\yioop\library\classifiers\into $j

feature index (column) to iterate over

Returns

object —

iterator over values in the column

iterateData()

iterateData() : object

Returns an iterator over the entire matrix. Note that this iterator is not in row order, but effectively in column order.

Returns

object —

iterator over every non-zero entry in the matrix