Methods for generating matrices from Paper objects and other data.
dfr | Methods for generating Numpy data objects from JSTOR Data-for-Research datasets. |
Methods for generating Numpy data objects from JSTOR Data-for-Research datasets.
array(data[, normalize, verbose]) | Yields a Numpy array, along with feature-index and document-index mappings. |
matrix(data[, normalize, verbose]) | Yields a Numpy matrix, along with feature-index and document-index mappings. |
Yields a Numpy array, along with feature-index and document-index mappings.
Usage
>>> import tethne.readers as rd
>>> import tethne.matrices as mt
>>> data = rd.dfr.ngrams("/Path/to/DfR/data")
>>> A, doc_index, feat_index = mt.dfr.array(data, normalize=True)
Parameters : | data : dict
normalize : bool
|
---|---|
Returns : | A : Numpy array
document_index : class:.Map
feature_index : Map
|
Yields a Numpy matrix, along with feature-index and document-index mappings.
Usage
>>> import tethne.readers as rd
>>> import tethne.matrices as mt
>>> data = rd.dfr.ngrams("/Path/to/DfR/data")
>>> M, doc_index, feat_index = mt.dfr.matrix(data, normalize=True)
Parameters : | data : dict
normalize : bool
|
---|---|
Returns : | M : Numpy matrix
document_index : class:.Map
feature_index : Map
|