Previous Up Next

class Parti_simp



module parti_simp

The documentation is here.

This class represents maximal predictive partitionings [Gué00, Gué01], ie a list of Partition of increasing number of segments, computed on a data using a Lexique.

A partitioning in n segments, or n-partitioning, is a list of partitions from 1 up to n segments classes.

A Parti_simp is made of

Construction

__init__
Optional keyword fic allows construction by reading from a filename in specific format;
read_nf
builds from a filename in specific format; if a Partition in the file has no name, its new name is the string of its index in the list;
build_random
builds a random partitioning in a given number of classes on a given data-length, using build_random;
mpp
computes the maximal predictive partitioning of a given number of classes with Lexique on a data; the names of the Partitions are their numbers of segments;

Handling

len_don
returns the length of the data of the first Partition;
__len__
returns the number of Partition;
__getitem__
returns the Partition of a given number;
__delitem__
removes the Partition of a given number;
__getslice__
returns a Parti_simp made of the selected partitions;
__delslice__
removes the Partition of indexes between given numbers;
append
appends a Partition to the end of self. Data length of this Partition must be equal to the one of self; if this new Partition has no name, it gets the length of the Parti_simp as name, using method s_name.
insert
inserts a Partition before given index. Data length of this Partition must be equal to the one of self; if this new Partition has no name, it gets the length of the Parti_simp as name, using method s_name.
filter
returns a Parti_simp made of the partitions on which a given function returns True;
group
returns a new Parti_simp by clustering the Segment of its Partition given their descriptors numbers, using group.
ls_val
returns the list of the values of the Partition, using val;
prediction
computes the list of predictions of the partitions on a data by a Lexique, using prediction;
pts_comm
returns, for each number n of segments, the number of same-descriptor positions between the n-partitions of both Parti_simp, using pts_comm;

Input-Output

Specific format is:
description
lines of outputs of Partition in specific format
MAX(min-max number of classes) ---> maximum value
example
<0-3637>6:-9127: ---> -9127
<0-2845>7:-6194: XXX <2846-3637>3:-2920: ---> -9114
<0-2505>7:-6234: XXX <25006-3349>1:-2139: XXX <3350-3637>51:-721: ---> -9094
MAX(366) ---> -8685
__str__
outputs in specific format;
abr
outputs in specific format, without the descriptors patterns (see abr).

Graphical output



Horizontal axis represents the data. On each line is the number of segments and the graphical output of the corresponding Partition, where each segment is drawn by an arc. The height of each arc is optionaly computed by a given function on the segments (here their lengths).



Here, only the segments which descriptors numbers are between 30 and 44 are drawn, and their descriptors numbers are written above them.
draw_nf
draws in postscript language in file of given name;

Optional keywords:
seg=l
draws only segments which numbers are in list l;
num=n
if equals 1, the numbers of the descriptors are written;
func=f
the height of each arc is proportional to value of function f computed on the corresponding Segment.

Previous Up Next