CFOF using iSAX trees

class pyCFOFiSAX._cfofisax.CFOFiSAX

The class for iCFOF approximation using iSAX index trees. Contains the iSAX tree forest.

init_forest_isax(size_word: int, threshold: int, data_ts: numpy.ndarray, base_cardinality: int = 2, number_tree: int = 1, indices_partition: Optional[list] = None, max_card_alphabet: int = 128, boolean_card_max: bool = True)

Initializes the forest of iSAX trees. Requires the parameters of the class ForestISAX.

Paramètres
  • size_word (int) – The size of the SAX words

  • threshold (int) – The threshold, maximal size of nodes

  • data_ts (numpy.ndarray) – The sequences to be inserted, to compute the stats of dataset

  • base_cardinality (int) – The smallest cardinality to encode iSAX

  • number_tree (int) – The number of iSAX trees in the forest

  • indices_partition (list) – A list of indices list where, for each tree, specifies the indices of the sequences to be inserted

  • max_card_alphabet (int) – if boolean_card_max == True, the maximum cardinality of iSAX encoding in each tree

  • boolean_card_max (bool) – if == True, defines maximum cardinality for iSAX sequences encoding in each of the trees

score_icfof(query: numpy.array, ntss: numpy.ndarray, rho=[0.001, 0.005, 0.01, 0.05, 0.1], each_tree_score: bool = False, fast_method: bool = True)

Compute the iCFOF approximations. Call one of the two functions according to the parameter fast_method :

  • if True (default) : vranglist_by_idtree_faster()

  • if False : vranglist_by_idtree()

Then sort the vrang list to get CFOF scores approximations based on rho parameter values.

Paramètres
  • query (numpy.array) – The sequence to be evaluated

  • ntss (numpy.ndarray) – Reference sequences

  • rho (list) – Rho values for the computation of approximations

  • each_tree_score (bool) – if True, returns the scores obtained in each of the trees

  • fast_method (bool) – if True, uses the numpy functions for computation, otherwise goes through the tree via a FIFO list of nodes

Renvoie

iCFOF score approximations

Type renvoyé

numpy.ndarray