Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Machine Learning
avec Scikit-Learn
Voir le programme détaillé
Classe « ClusterNode »

Méthode scipy.cluster.hierarchy.ClusterNode.pre_order

Signature de la méthode pre_order

def pre_order(self, func=<function ClusterNode.<lambda> at 0x0000020DFE429800>) 

Description

help(ClusterNode.pre_order)

Perform pre-order traversal without recursive function calls.

When a leaf node is first encountered, ``func`` is called with
the leaf node as its argument, and its result is appended to
the list.

For example, the statement::

   ids = root.pre_order(lambda x: x.id)

returns a list of the node ids corresponding to the leaf nodes
of the tree as they appear from left to right.

Parameters
----------
func : function
    Applied to each leaf ClusterNode object in the pre-order traversal.
    Given the ``i``-th leaf node in the pre-order traversal ``n[i]``,
    the result of ``func(n[i])`` is stored in ``L[i]``. If not
    provided, the index of the original observation to which the node
    corresponds is used.

Returns
-------
L : list
    The pre-order traversal.



Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les compléments
Voir le programme détaillé