helper_funcs.py :  » Math » Modular-toolkit-for-Data-Processing » MDP-2.6 » mdp » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Math » Modular toolkit for Data Processing 
Modular toolkit for Data Processing » MDP 2.6 » mdp » helper_funcs.py
import mdp

def pca(x, **kwargs):
    """Filters multidimensioanl input data through its principal components.

    Observations of the same variable are stored on rows, different variables
    are stored on columns.

    This is a shortcut function for the corresponding node PCANode. If any
    keyword arguments are specified, they are passed to its constructor.

    This is equivalent to mdp.nodes.PCANode(**kwargs)(x)
    """
    return mdp.nodes.PCANode(**kwargs)(x)
                              
def whitening(x, **kwargs):
    """Filters multidimensional input data through its principal components,
    rescaling the output signals such that they have unit variance.

    Observations of the same variable are stored on rows, different variables
    are stored on columns.

    This is a shortcut function for the corresponding node WhiteningNode.
    If any keyword arguments are specified, they are passed to its constructor.

    This is equivalent to mdp.nodes.WhiteningNode(**kwargs)(x)
    """
    return mdp.nodes.WhiteningNode(**kwargs)(x)

def fastica(x, **kwargs):
    """Perform Independent Component Analysis on input data using the FastICA
    algorithm by Aapo Hyvarinen.

    Observations of the same variable are stored on rows, different variables
    are stored on columns.

    This is a shortcut function for the corresponding node FastICANode.
    If any keyword arguments are specified, they are passed to its constructor.

    This is equivalent to mdp.nodes.FastICANode(**kwargs)(x)
    """
    return mdp.nodes.FastICANode(**kwargs)(x)

def sfa(x, **kwargs):
    """Perform Slow Feature Analysis on input data using the SFA
    algorithm by Laurenz Wiskott.

    Observations of the same variable are stored on rows, different variables
    are stored on columns.

    This is a shortcut function for the corresponding node SFANode.
    If any keyword arguments are specified, they are passed to its constructor.

    This is equivalent to mdp.nodes.SFANode(**kwargs)(x)
    """
    return mdp.nodes.SFANode(**kwargs)(x)

def get_eta(x, **kwargs):
    """Compute eta values (a slowness measure) of the input data.

    The delta value of a signal is a measure of its temporal
    variation, and is defined as the mean of the derivative squared,
    i.e. delta(x) = mean(dx/dt(t)^2).  delta(x) is zero if
    x is a constant signal, and increases if the temporal variation
    of the signal is larger.

    The eta value is a more intuitive measure of temporal variation,
    defined as
       eta(x) = T/(2*pi) * sqrt(delta(x))
    If x is a signal of length T which consists of a sine function
    that accomplishes exactly N oscillations, then eta(x)=N.

    Input data are normalized to have unit variance, such that it is
    possible to compare the temporal variation of two signals
    independently from their scaling.    

    Observations of the same variable are stored on rows, different variables
    are stored on columns.

    This is a shortcut function for the corresponding node EtaComputerNode.
    If any keyword arguments are specified, they are passed to its constructor.
    """
    eta = mdp.nodes.EtaComputerNode()
    eta.train(x)
    return eta.get_eta(**kwargs)


www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.