sample module¶
This module contains the Sample class The Sample class encapsulates a sample ‘s components nbL and nbEx numbers, the fourth dictionaries for sample, prefix, suffix and factor
-
class
sample.
Sample
(adr, type='SPiCe', lrows=[], lcolumns=[], version='classic', partial=False)[source]¶ Bases:
object
A sample instance
Example: >>> from sp2learn import Sample >>> train_file = '0.spice.train' >>> pT = Sample(adr=train_file)
- Input:
Parameters: - adr (string) – adresse and name of the loaden file
- type (string) – (default value = ‘SPiCe’) indicate the structure of the file
- lrows (int or list of int) – number or list of rows, a list of strings if partial=True; otherwise, based on self.pref if version=”classic” or “prefix”, self.fact otherwise
- lcolumns (int or list of int) – number or list of columns a list of strings if partial=True ; otherwise, based on self.suff if version=”classic” or “suffix”, self.fact otherwise
- version (string) – (default = “classic”) version name
- partial (boolean) – (default value = False) build of partia
-
fact
¶ factor dictionary
-
nbEx
¶ Number of examples
-
nbL
¶ Number of letters
-
pref
¶ prefix dictionary
-
sample
¶ sample dictionary
-
select_columns
(nb_columns_max=1000, version='classic')[source]¶ define lcolumns
- Input:
Parameters: - Output:
Parameters: lcolumns (list) – list of columns
-
select_rows
(nb_rows_max=1000, version='classic')[source]¶ define lrows
- Input:
Parameters: - Output:
Parameters: lrows (list) – list of rows
-
suff
¶ suffix dictionary