This class provides a container to store all necessary data to
perform MVPA analyses. These are the data samples, as well as the
labels associated with the samples. Additionally, samples can be
grouped into chunks.
Important: labels assumed to be immutable, i.e. no one should modify
them externally by accessing indexed items, ie something like
dataset.labels[1] += 100 should not be used. If a label has
to be modified, full copy of labels should be obtained, operated on,
and assigned back to the dataset, otherwise dataset.uniquelabels
would not work. The same applies to any other attribute which has
corresponding unique* access property.
|
__init__(self,
data=None,
dsattr=None,
dtype=None,
samples=None,
labels=None,
labels_map=None,
chunks=None,
origids=None,
check_data=True,
copy_samples=False,
copy_data=True,
copy_dsattr=True)
Initialize dataset instance |
source code
|
|
|
idhash(self)
To verify if dataset is in the same state as when smth else was done |
source code
|
|
|
_resetallunique(self,
force=False)
Set to None all unique* attributes of corresponding dictionary |
source code
|
|
|
|
|
_setdataattr(self,
attrib,
value)
Provide common facility to set attributes |
source code
|
|
|
_getNSamplesPerAttr(self,
attrib='labels')
Returns the number of samples per unique label. |
source code
|
|
|
_getSampleIdsByAttr(self,
values,
attrib="labels",
sort=True)
Return indecies of samples given a list of attributes |
source code
|
|
|
idsonboundaries(self,
prior=0,
post=0,
attributes_to_track=['labels','chunks'],
affected_labels=None,
revert=False)
Find samples which are on the boundaries of the blocks |
source code
|
|
|
|
|
_checkData(self)
Checks _data members to have the same # of samples. |
source code
|
|
|
_expandSampleAttribute(self,
attr,
attr_name)
If a sample attribute is given as a scalar expand/repeat it to a
length matching the number of samples in the dataset. |
source code
|
|
|
|
|
|
|
summary(self,
uniq=True,
stats=True,
idhash=False,
lstats=True,
maxc=30,
maxl=20)
String summary over the object |
source code
|
|
|
|
|
__iadd__(self,
other)
Merge the samples of one Dataset object to another (in-place). |
source code
|
|
|
|
|
copy(self,
deep=True)
Create a copy (clone) of the dataset, by fully copying current one |
source code
|
|
|
|
|
applyMapper(self,
featuresmapper=None,
samplesmapper=None,
train=True)
Obtain new dataset by applying mappers over features and/or samples. |
source code
|
|
|
|
|
index(self,
*args,
**kwargs)
Universal indexer to obtain indexes of interesting samples/features.
See .select() for more information |
source code
|
|
|
|
|
where(self,
*args,
**kwargs)
Obtain indexes of interesting samples/features. See select() for more information |
source code
|
|
|
|
|
|
|
|
|
getNSamples(self)
Currently available number of patterns. |
source code
|
|
|
getNFeatures(self)
Number of features per pattern. |
source code
|
|
|
getLabelsMap(self)
Stored labels map (if any) |
source code
|
|
|
|
|
setSamplesDType(self,
dtype)
Set the data type of the samples array. |
source code
|
|
|
|
|
|
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__ ,
__sizeof__ ,
__subclasshook__
|