Ignore:
Timestamp:
08/21/12 14:22:12 (20 months ago)
Author:
mlevar
Branch:
default
Message:

Added Clustering Trees to Orange.core

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/orange/lib_learner.cpp

    r10619 r10968  
    5252 
    5353#include "externs.px" 
     54 
     55/* ************ CLUSTERING TREE LEARNER ************ */ 
     56 
     57#include "tdidt_clustering.hpp" 
     58C_CALL(ClusteringTreeLearner - Orange.multitarget.tree.ClusteringTreeLearner, MultiLearner, "([examples], [minMajority=, minMSE=, minExamples=, maxDepth=, method=])") 
     59C_NAMED(ClusteringTreeClassifier - Orange.multitarget.tree.ClusteringTreeClassifier, MultiClassifier, "()") 
     60 
     61PyObject *ClusteringTreeClassifier__reduce__(PyObject *self) 
     62{ 
     63    PyTRY 
     64    ostringstream ss; 
     65 
     66    CAST_TO(TClusteringTreeClassifier, classifier); 
     67    classifier->save_model(ss); 
     68    return Py_BuildValue("O(s)N", getExportedFunction("__pickleLoaderClusteringTreeClassifier"),  
     69        ss.str().c_str(), packOrangeDictionary(self)); 
     70    PyCATCH 
     71} 
     72 
     73PyObject *__pickleLoaderClusteringTreeClassifier(PyObject *self, PyObject *args) PYARGS(METH_VARARGS, "(buffer)") 
     74{ 
     75    PyTRY 
     76    char *cbuf; 
     77    istringstream ss; 
     78 
     79    int buffer_size = 0; 
     80    if (!PyArg_ParseTuple(args, "s:__pickleLoaderClusteringTreeClassifier", &cbuf)) 
     81        return NULL; 
     82    ss.str(string(cbuf)); 
     83    PClusteringTreeClassifier classifier = mlnew TClusteringTreeClassifier(); 
     84    classifier->load_model(ss); 
     85    return WrapOrange(classifier); 
     86    PyCATCH 
     87} 
     88 
    5489 
    5590/* ************ SIMPLE TREE LEARNER ************ */ 
Note: See TracChangeset for help on using the changeset viewer.