A class for storing scores for trials. The modelset and segset fields are lists of model and test segment names respectively. The element i,j of scoremat and scoremask corresponds to the trial involving model i and test segment j.
Attr modelset: | list of unique models in a ndarray |
---|---|
Attr segset: | list of unique test segments in a ndarray |
Attr scoremask: | 2D ndarray of boolean which indicates the trials of interest i.e. the entry i,j in scoremat should be ignored if scoremask[i,j] is False |
Attr scoremat: | 2D ndarray of scores |
The ordering in the output Scores object corresponds to ndx, so aligning several Scores objects with the same ndx will result in them being comparable with each other.
Parameters: | ndx – a Key or Ndx object |
---|---|
Returns: | resized version of the current Scores object to size of ‘ndx’ and reordered according to the ordering of modelset and segset in ‘ndx’. |
Removes some of the information in a Scores object. Useful for creating a gender specific score set from a pooled gender score set. Depending on the value of ‘keep’, the two input lists indicate the models and test segments (and their associated scores) to retain or discard.
Parameters: |
|
---|---|
Returns: | a filtered version of ‘inscr’. |
Divides scores into target and non-target scores using information in a key.
Parameters: | key – a Key object. |
---|---|
Returns: | a vector of target scores. |
Returns: | a vector of non-target scores. |
Merges a list of Scores objects into the current one. The resulting must have all models and segment in the input Scores (only once) and the union of all the scoremasks. It is an error if two of the input Scores objects have a score for the same trial.
Parameters: | scoreList – the list of Scores object to merge |
---|
Read information from a file and constructs a Scores object. The type of file is deduced from the extension. The extension must be ‘.txt’ for a text file and ‘.hdf5’ or ‘.h5’ for a HDF5 file.
Parameters: | inputFileName – name of the file o read from |
---|
Read Scores in PICKLE format.
Parameters: | inputFileName – name of the file to read from |
---|
Creates a Scores object from information stored in a text file.
Parameters: | inputFileName – name of the file to read from |
---|
Save the Scores object to file. The format of the file is deduced from the extension of the filename. The format can be PICKLE, HDF5 or text. Extension for text file should be ‘.p’ for pickle ‘.txt’ and for HDF5 it should be ‘.hdf5’ or ‘.h5’
Parameters: | outputFileName – name of the file to write to |
---|
Save Scores in PICKLE format. If Python > 3.3, scores are converted to float32 before saving to save space.
Parameters: | outputFilename – name of the file to write to |
---|
Save a Scores object in a text file
Parameters: | outputFileName – name of the file to write to |
---|
Sets all scores for which the trialmask is true but the scoremask is false to the same value, supplied by the user.
Parameters: |
|
---|---|
Returns: | a Scores object (with the missing scores added and set to value). |
Sort models and segments
Checks that an object of type Scores obeys certain rules that must always be true.
Returns: | a boolean value indicating whether the object is valid. |
---|