Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo


Numpy, regression and PyML: an example

  • Since I've spent some time on this (I'm newbie in PyML), this tip can help someone else.

    If you are trying to build a dataset from a numpy array and you need to use numeric labels (i.e. for regression), remember to add always 'patternID=...' to you labels constructor. Example:
    * X is a numpy matrix (note that you always need a matrix, numpy 1D vector are not allowed!)
    * Y is a numpy vector of label values, related to X
    * build you dataset in this way:
    L = datafunc.Labels(Y,numericLabels=True,patternID=range(len(Y)))
    data = datafunc.SparseCDataSet(X = X)

    Now you can play with svm.SVR()...