[pymvpa] LinearCSVMC not found in PyMVPA-upstream-2.4.0 release (Nick Oosterhof)

Feilong Ma mafeilong at gmail.com
Wed Jul 22 18:45:16 UTC 2015


Hi Nick,

Switching to an earlier version of SWIG works for me.  I had problems with
SWIG 3.0.5, but when I switched to SWIG 3.0.4 the problem was solved.  I
installed SWIG using Homebrew, which should work in the same way as
installing from source.

The error message I talked about with CLANG still appears while running
`python setup.py build_ext`.  I guess it's not related to this issue.  The
message is:
#### ['clang', '-fno-strict-aliasing', '-fno-common', '-dynamic', '-g',
'-O2', '-DNDEBUG', '-g', '-fwrapv', '-O3', '-Wall', '-Wstrict-prototypes']
#######
Missing compiler_cxx fix for UnixCCompiler

Best,
Feilong

On Sun, Jul 19, 2015 at 9:44 AM <
pkg-exppsy-pymvpa-request at lists.alioth.debian.org> wrote:

> Send Pkg-ExpPsy-PyMVPA mailing list submissions to
>         pkg-exppsy-pymvpa at lists.alioth.debian.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa
>
> or, via email, send a message with subject or body 'help' to
>         pkg-exppsy-pymvpa-request at lists.alioth.debian.org
>
> You can reach the person managing the list at
>         pkg-exppsy-pymvpa-owner at lists.alioth.debian.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Pkg-ExpPsy-PyMVPA digest..."
> Today's Topics:
>
>    1. Re: LinearCSVMC not found in PyMVPA-upstream-2.4.0 release
>       (Nick Oosterhof)
>
>
>
> ---------- Forwarded message ----------
> From: Nick Oosterhof <n.n.oosterhof at googlemail.com>
> To: Development and support of PyMVPA <
> pkg-exppsy-pymvpa at lists.alioth.debian.org>
> Cc:
> Date: Sun, 19 Jul 2015 15:44:23 +0200
> Subject: Re: [pymvpa] LinearCSVMC not found in PyMVPA-upstream-2.4.0
> release
>
> > On 15 Jul 2015, at 18:46, Feilong Ma <mafeilong at gmail.com> wrote:
> >
> > I had a similar problem while installing PyMVPA on Mac OS (10.10.4).  I
> think the problem is related to this line:
> >
> https://github.com/PyMVPA/PyMVPA/blob/master/mvpa2/clfs/libsvmc/_svm.py#L22
> >
> > When I tried to run this line in ipython
> > from mvpa2.clfs.libsvmc._svmc import C_SVC, NU_SVC, ONE_CLASS,
> EPSILON_SVR
> > What I got is:
> > ImportError: cannot import name C_SVC
>
> I get the same error. Briefly (see below for details), it seems due to a
> change in SWIG, with later versions giving issues.
>
> When running "python setup.py build_ext” and copying over the .o and .so
> files from the build directory to PyMVPA’s root directory (across the
> corresponding subdirectories), the following reproduces the error directly:
>
>     python -c "from mvpa2.clfs.libsvmc._svmc import C_SVC”
>
> Strangely enough, the following works for the failing PyMVPA installation
> (but not for the working one):
>
>     python -c "from mvpa2.clfs.libsvmc._svmc import C_SVC_swigconstant”
>
> Digging a bit further, the mvpa2/clfs/libsvmc/svmc.py file differs between
> my “working” (generated using SWIG 3.0.2) and “failing” (SWIG 3.0.6) PyMVPA
> setup. One difference is that the working version has contents such as
>
>     C_SVC = _svmc.C_SVC
>
> whereas the failing version has extra lines that includes “swigconstant”
>
>     _svmc.C_SVC_swigconstant(_svmc)
>     C_SVC = _svmc.C_SVC
>
> (For completeness I’m including the full content of both versions below. )
>
> Tracing this back further, I compiled swig from source, both for the
> latest version on github and for version 3.0.0 (version 3.0.2 gave an error
> when compiling). When using 3.0.0, the import works fine; with 3.0.6 or the
> latest (3.0.7 development) it breaks.
>
> >
> > I guess the problem might be related to compiling LibSVM.  I vaguely
> remember there was some error messages with CLANG blah blah.
>
> I installed GCC 5.1 and get the same problem as when using CLANG.
>
> To summarize, the following worked for me to get libsvm to work on OS X
> Yosemite:
>
> - clone swig from https://github.com/swig/swig, then “git checkout -tag
> tags/tags/rel-3.0.0”
> - in the swig directory, run “autoconf && ./configure && make && sudo make
> install” (although it gives an error when installing the man-pages due to
> missing yodl2man, the binaries are installed fine). This requires autoconf,
> automake and libconf.
> - in the PyMVPA directory, run "python setup.py build_ext”
> - copy the .so and .o files from the build directory to the PyMVPA root
> directory, for example in the PyMVPA root directory do "for ext in .so .o;
> do for i in `find build -iname "*${ext}"`; do j=`echo $i | cut -f3- -d/`;
> cp $i $j; done; done”
>
> If anyone can confirm that using an earlier version of SWIG fixes the
> problem, that would be great. In that case I can also raise the issue with
> the developers.
>
>
>
> (Below: contents of mvpa2/clfs/libsvmc/svmc.py for working and failing
> libsvm in PyMVPA)
>
> ################
> # *Failing* mvpa2/clfs/libsvmc/svmc.py
> ################
>
> # This file was automatically generated by SWIG (http://www.swig.org).
> # Version 3.0.6
> #
> # Do not make changes to this file unless you know what you are
> doing--modify
> # the SWIG interface file instead.
>
>
>
>
>
> from sys import version_info
> if version_info >= (2, 6, 0):
>     def swig_import_helper():
>         from os.path import dirname
>         import imp
>         fp = None
>         try:
>             fp, pathname, description = imp.find_module('_svmc',
> [dirname(__file__)])
>         except ImportError:
>             import _svmc
>             return _svmc
>         if fp is not None:
>             try:
>                 _mod = imp.load_module('_svmc', fp, pathname, description)
>             finally:
>                 fp.close()
>             return _mod
>     _svmc = swig_import_helper()
>     del swig_import_helper
> else:
>     import _svmc
> del version_info
> try:
>     _swig_property = property
> except NameError:
>     pass  # Python < 2.2 doesn't have 'property'.
>
>
> def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
>     if (name == "thisown"):
>         return self.this.own(value)
>     if (name == "this"):
>         if type(value).__name__ == 'SwigPyObject':
>             self.__dict__[name] = value
>             return
>     method = class_type.__swig_setmethods__.get(name, None)
>     if method:
>         return method(self, value)
>     if (not static):
>         if _newclass:
>             object.__setattr__(self, name, value)
>         else:
>             self.__dict__[name] = value
>     else:
>         raise AttributeError("You cannot add attributes to %s" % self)
>
>
> def _swig_setattr(self, class_type, name, value):
>     return _swig_setattr_nondynamic(self, class_type, name, value, 0)
>
>
> def _swig_getattr_nondynamic(self, class_type, name, static=1):
>     if (name == "thisown"):
>         return self.this.own()
>     method = class_type.__swig_getmethods__.get(name, None)
>     if method:
>         return method(self)
>     if (not static):
>         return object.__getattr__(self, name)
>     else:
>         raise AttributeError(name)
>
> def _swig_getattr(self, class_type, name):
>     return _swig_getattr_nondynamic(self, class_type, name, 0)
>
>
> def _swig_repr(self):
>     try:
>         strthis = "proxy of " + self.this.__repr__()
>     except:
>         strthis = ""
>     return "<%s.%s; %s >" % (self.__class__.__module__,
> self.__class__.__name__, strthis,)
>
> try:
>     _object = object
>     _newclass = 1
> except AttributeError:
>     class _object:
>         pass
>     _newclass = 0
>
>
>
> _svmc.__version___swigconstant(_svmc)
> __version__ = _svmc.__version__
>
> _svmc.C_SVC_swigconstant(_svmc)
> C_SVC = _svmc.C_SVC
>
> _svmc.NU_SVC_swigconstant(_svmc)
> NU_SVC = _svmc.NU_SVC
>
> _svmc.ONE_CLASS_swigconstant(_svmc)
> ONE_CLASS = _svmc.ONE_CLASS
>
> _svmc.EPSILON_SVR_swigconstant(_svmc)
> EPSILON_SVR = _svmc.EPSILON_SVR
>
> _svmc.NU_SVR_swigconstant(_svmc)
> NU_SVR = _svmc.NU_SVR
>
> _svmc.LINEAR_swigconstant(_svmc)
> LINEAR = _svmc.LINEAR
>
> _svmc.POLY_swigconstant(_svmc)
> POLY = _svmc.POLY
>
> _svmc.RBF_swigconstant(_svmc)
> RBF = _svmc.RBF
>
> _svmc.SIGMOID_swigconstant(_svmc)
> SIGMOID = _svmc.SIGMOID
>
> _svmc.PRECOMPUTED_swigconstant(_svmc)
> PRECOMPUTED = _svmc.PRECOMPUTED
> class svm_parameter(_object):
>     __swig_setmethods__ = {}
>     __setattr__ = lambda self, name, value: _swig_setattr(self,
> svm_parameter, name, value)
>     __swig_getmethods__ = {}
>     __getattr__ = lambda self, name: _swig_getattr(self, svm_parameter,
> name)
>     __repr__ = _swig_repr
>     __swig_setmethods__["svm_type"] = _svmc.svm_parameter_svm_type_set
>     __swig_getmethods__["svm_type"] = _svmc.svm_parameter_svm_type_get
>     if _newclass:
>         svm_type = _swig_property(_svmc.svm_parameter_svm_type_get,
> _svmc.svm_parameter_svm_type_set)
>     __swig_setmethods__["kernel_type"] =
> _svmc.svm_parameter_kernel_type_set
>     __swig_getmethods__["kernel_type"] =
> _svmc.svm_parameter_kernel_type_get
>     if _newclass:
>         kernel_type = _swig_property(_svmc.svm_parameter_kernel_type_get,
> _svmc.svm_parameter_kernel_type_set)
>     __swig_setmethods__["degree"] = _svmc.svm_parameter_degree_set
>     __swig_getmethods__["degree"] = _svmc.svm_parameter_degree_get
>     if _newclass:
>         degree = _swig_property(_svmc.svm_parameter_degree_get,
> _svmc.svm_parameter_degree_set)
>     __swig_setmethods__["gamma"] = _svmc.svm_parameter_gamma_set
>     __swig_getmethods__["gamma"] = _svmc.svm_parameter_gamma_get
>     if _newclass:
>         gamma = _swig_property(_svmc.svm_parameter_gamma_get,
> _svmc.svm_parameter_gamma_set)
>     __swig_setmethods__["coef0"] = _svmc.svm_parameter_coef0_set
>     __swig_getmethods__["coef0"] = _svmc.svm_parameter_coef0_get
>     if _newclass:
>         coef0 = _swig_property(_svmc.svm_parameter_coef0_get,
> _svmc.svm_parameter_coef0_set)
>     __swig_setmethods__["cache_size"] = _svmc.svm_parameter_cache_size_set
>     __swig_getmethods__["cache_size"] = _svmc.svm_parameter_cache_size_get
>     if _newclass:
>         cache_size = _swig_property(_svmc.svm_parameter_cache_size_get,
> _svmc.svm_parameter_cache_size_set)
>     __swig_setmethods__["eps"] = _svmc.svm_parameter_eps_set
>     __swig_getmethods__["eps"] = _svmc.svm_parameter_eps_get
>     if _newclass:
>         eps = _swig_property(_svmc.svm_parameter_eps_get,
> _svmc.svm_parameter_eps_set)
>     __swig_setmethods__["C"] = _svmc.svm_parameter_C_set
>     __swig_getmethods__["C"] = _svmc.svm_parameter_C_get
>     if _newclass:
>         C = _swig_property(_svmc.svm_parameter_C_get,
> _svmc.svm_parameter_C_set)
>     __swig_setmethods__["nr_weight"] = _svmc.svm_parameter_nr_weight_set
>     __swig_getmethods__["nr_weight"] = _svmc.svm_parameter_nr_weight_get
>     if _newclass:
>         nr_weight = _swig_property(_svmc.svm_parameter_nr_weight_get,
> _svmc.svm_parameter_nr_weight_set)
>     __swig_setmethods__["weight_label"] =
> _svmc.svm_parameter_weight_label_set
>     __swig_getmethods__["weight_label"] =
> _svmc.svm_parameter_weight_label_get
>     if _newclass:
>         weight_label =
> _swig_property(_svmc.svm_parameter_weight_label_get,
> _svmc.svm_parameter_weight_label_set)
>     __swig_setmethods__["weight"] = _svmc.svm_parameter_weight_set
>     __swig_getmethods__["weight"] = _svmc.svm_parameter_weight_get
>     if _newclass:
>         weight = _swig_property(_svmc.svm_parameter_weight_get,
> _svmc.svm_parameter_weight_set)
>     __swig_setmethods__["nu"] = _svmc.svm_parameter_nu_set
>     __swig_getmethods__["nu"] = _svmc.svm_parameter_nu_get
>     if _newclass:
>         nu = _swig_property(_svmc.svm_parameter_nu_get,
> _svmc.svm_parameter_nu_set)
>     __swig_setmethods__["p"] = _svmc.svm_parameter_p_set
>     __swig_getmethods__["p"] = _svmc.svm_parameter_p_get
>     if _newclass:
>         p = _swig_property(_svmc.svm_parameter_p_get,
> _svmc.svm_parameter_p_set)
>     __swig_setmethods__["shrinking"] = _svmc.svm_parameter_shrinking_set
>     __swig_getmethods__["shrinking"] = _svmc.svm_parameter_shrinking_get
>     if _newclass:
>         shrinking = _swig_property(_svmc.svm_parameter_shrinking_get,
> _svmc.svm_parameter_shrinking_set)
>     __swig_setmethods__["probability"] =
> _svmc.svm_parameter_probability_set
>     __swig_getmethods__["probability"] =
> _svmc.svm_parameter_probability_get
>     if _newclass:
>         probability = _swig_property(_svmc.svm_parameter_probability_get,
> _svmc.svm_parameter_probability_set)
>
>     def __init__(self):
>         this = _svmc.new_svm_parameter()
>         try:
>             self.this.append(this)
>         except:
>             self.this = this
>     __swig_destroy__ = _svmc.delete_svm_parameter
>     __del__ = lambda self: None
> svm_parameter_swigregister = _svmc.svm_parameter_swigregister
> svm_parameter_swigregister(svm_parameter)
>
> class svm_problem(_object):
>     __swig_setmethods__ = {}
>     __setattr__ = lambda self, name, value: _swig_setattr(self,
> svm_problem, name, value)
>     __swig_getmethods__ = {}
>     __getattr__ = lambda self, name: _swig_getattr(self, svm_problem, name)
>     __repr__ = _swig_repr
>     __swig_setmethods__["l"] = _svmc.svm_problem_l_set
>     __swig_getmethods__["l"] = _svmc.svm_problem_l_get
>     if _newclass:
>         l = _swig_property(_svmc.svm_problem_l_get,
> _svmc.svm_problem_l_set)
>     __swig_setmethods__["y"] = _svmc.svm_problem_y_set
>     __swig_getmethods__["y"] = _svmc.svm_problem_y_get
>     if _newclass:
>         y = _swig_property(_svmc.svm_problem_y_get,
> _svmc.svm_problem_y_set)
>     __swig_setmethods__["x"] = _svmc.svm_problem_x_set
>     __swig_getmethods__["x"] = _svmc.svm_problem_x_get
>     if _newclass:
>         x = _swig_property(_svmc.svm_problem_x_get,
> _svmc.svm_problem_x_set)
>
>     def __init__(self):
>         this = _svmc.new_svm_problem()
>         try:
>             self.this.append(this)
>         except:
>             self.this = this
>     __swig_destroy__ = _svmc.delete_svm_problem
>     __del__ = lambda self: None
> svm_problem_swigregister = _svmc.svm_problem_swigregister
> svm_problem_swigregister(svm_problem)
>
> class svm_model(_object):
>     __swig_setmethods__ = {}
>     __setattr__ = lambda self, name, value: _swig_setattr(self, svm_model,
> name, value)
>     __swig_getmethods__ = {}
>     __getattr__ = lambda self, name: _swig_getattr(self, svm_model, name)
>     __repr__ = _swig_repr
>     __swig_setmethods__["param"] = _svmc.svm_model_param_set
>     __swig_getmethods__["param"] = _svmc.svm_model_param_get
>     if _newclass:
>         param = _swig_property(_svmc.svm_model_param_get,
> _svmc.svm_model_param_set)
>     __swig_setmethods__["nr_class"] = _svmc.svm_model_nr_class_set
>     __swig_getmethods__["nr_class"] = _svmc.svm_model_nr_class_get
>     if _newclass:
>         nr_class = _swig_property(_svmc.svm_model_nr_class_get,
> _svmc.svm_model_nr_class_set)
>     __swig_setmethods__["l"] = _svmc.svm_model_l_set
>     __swig_getmethods__["l"] = _svmc.svm_model_l_get
>     if _newclass:
>         l = _swig_property(_svmc.svm_model_l_get, _svmc.svm_model_l_set)
>     __swig_setmethods__["SV"] = _svmc.svm_model_SV_set
>     __swig_getmethods__["SV"] = _svmc.svm_model_SV_get
>     if _newclass:
>         SV = _swig_property(_svmc.svm_model_SV_get, _svmc.svm_model_SV_set)
>     __swig_setmethods__["sv_coef"] = _svmc.svm_model_sv_coef_set
>     __swig_getmethods__["sv_coef"] = _svmc.svm_model_sv_coef_get
>     if _newclass:
>         sv_coef = _swig_property(_svmc.svm_model_sv_coef_get,
> _svmc.svm_model_sv_coef_set)
>     __swig_setmethods__["rho"] = _svmc.svm_model_rho_set
>     __swig_getmethods__["rho"] = _svmc.svm_model_rho_get
>     if _newclass:
>         rho = _swig_property(_svmc.svm_model_rho_get,
> _svmc.svm_model_rho_set)
>     __swig_setmethods__["probA"] = _svmc.svm_model_probA_set
>     __swig_getmethods__["probA"] = _svmc.svm_model_probA_get
>     if _newclass:
>         probA = _swig_property(_svmc.svm_model_probA_get,
> _svmc.svm_model_probA_set)
>     __swig_setmethods__["probB"] = _svmc.svm_model_probB_set
>     __swig_getmethods__["probB"] = _svmc.svm_model_probB_get
>     if _newclass:
>         probB = _swig_property(_svmc.svm_model_probB_get,
> _svmc.svm_model_probB_set)
>     __swig_setmethods__["label"] = _svmc.svm_model_label_set
>     __swig_getmethods__["label"] = _svmc.svm_model_label_get
>     if _newclass:
>         label = _swig_property(_svmc.svm_model_label_get,
> _svmc.svm_model_label_set)
>     __swig_setmethods__["nSV"] = _svmc.svm_model_nSV_set
>     __swig_getmethods__["nSV"] = _svmc.svm_model_nSV_get
>     if _newclass:
>         nSV = _swig_property(_svmc.svm_model_nSV_get,
> _svmc.svm_model_nSV_set)
>     __swig_setmethods__["free_sv"] = _svmc.svm_model_free_sv_set
>     __swig_getmethods__["free_sv"] = _svmc.svm_model_free_sv_get
>     if _newclass:
>         free_sv = _swig_property(_svmc.svm_model_free_sv_get,
> _svmc.svm_model_free_sv_set)
>
>     def __init__(self):
>         this = _svmc.new_svm_model()
>         try:
>             self.this.append(this)
>         except:
>             self.this = this
>     __swig_destroy__ = _svmc.delete_svm_model
>     __del__ = lambda self: None
> svm_model_swigregister = _svmc.svm_model_swigregister
> svm_model_swigregister(svm_model)
>
>
> def svm_set_verbosity(verbosity_flag):
>     return _svmc.svm_set_verbosity(verbosity_flag)
> svm_set_verbosity = _svmc.svm_set_verbosity
>
> def svm_train(prob, param):
>     return _svmc.svm_train(prob, param)
> svm_train = _svmc.svm_train
>
> def svm_cross_validation(prob, param, nr_fold, target):
>     return _svmc.svm_cross_validation(prob, param, nr_fold, target)
> svm_cross_validation = _svmc.svm_cross_validation
>
> def svm_save_model(model_file_name, model):
>     return _svmc.svm_save_model(model_file_name, model)
> svm_save_model = _svmc.svm_save_model
>
> def svm_load_model(model_file_name):
>     return _svmc.svm_load_model(model_file_name)
> svm_load_model = _svmc.svm_load_model
>
> def svm_get_svm_type(model):
>     return _svmc.svm_get_svm_type(model)
> svm_get_svm_type = _svmc.svm_get_svm_type
>
> def svm_get_nr_class(model):
>     return _svmc.svm_get_nr_class(model)
> svm_get_nr_class = _svmc.svm_get_nr_class
>
> def svm_get_labels(model, label):
>     return _svmc.svm_get_labels(model, label)
> svm_get_labels = _svmc.svm_get_labels
>
> def svm_get_svr_probability(model):
>     return _svmc.svm_get_svr_probability(model)
> svm_get_svr_probability = _svmc.svm_get_svr_probability
>
> def svm_predict_values(model, x, decvalue):
>     return _svmc.svm_predict_values(model, x, decvalue)
> svm_predict_values = _svmc.svm_predict_values
>
> def svm_predict(model, x):
>     return _svmc.svm_predict(model, x)
> svm_predict = _svmc.svm_predict
>
> def svm_predict_probability(model, x, prob_estimates):
>     return _svmc.svm_predict_probability(model, x, prob_estimates)
> svm_predict_probability = _svmc.svm_predict_probability
>
> def svm_check_parameter(prob, param):
>     return _svmc.svm_check_parameter(prob, param)
> svm_check_parameter = _svmc.svm_check_parameter
>
> def svm_check_probability_model(model):
>     return _svmc.svm_check_probability_model(model)
> svm_check_probability_model = _svmc.svm_check_probability_model
>
> def svm_node_matrix2numpy_array(matrix, rows, cols):
>     return _svmc.svm_node_matrix2numpy_array(matrix, rows, cols)
> svm_node_matrix2numpy_array = _svmc.svm_node_matrix2numpy_array
>
> def doubleppcarray2numpy_array(data, rows, cols):
>     return _svmc.doubleppcarray2numpy_array(data, rows, cols)
> doubleppcarray2numpy_array = _svmc.doubleppcarray2numpy_array
>
> def new_int(nelements):
>     return _svmc.new_int(nelements)
> new_int = _svmc.new_int
>
> def delete_int(ary):
>     return _svmc.delete_int(ary)
> delete_int = _svmc.delete_int
>
> def int_getitem(ary, index):
>     return _svmc.int_getitem(ary, index)
> int_getitem = _svmc.int_getitem
>
> def int_setitem(ary, index, value):
>     return _svmc.int_setitem(ary, index, value)
> int_setitem = _svmc.int_setitem
>
> def new_double(nelements):
>     return _svmc.new_double(nelements)
> new_double = _svmc.new_double
>
> def delete_double(ary):
>     return _svmc.delete_double(ary)
> delete_double = _svmc.delete_double
>
> def double_getitem(ary, index):
>     return _svmc.double_getitem(ary, index)
> double_getitem = _svmc.double_getitem
>
> def double_setitem(ary, index, value):
>     return _svmc.double_setitem(ary, index, value)
> double_setitem = _svmc.double_setitem
>
> def svm_node_array(size):
>     return _svmc.svm_node_array(size)
> svm_node_array = _svmc.svm_node_array
>
> def svm_node_array_set(*args):
>     return _svmc.svm_node_array_set(*args)
> svm_node_array_set = _svmc.svm_node_array_set
>
> def svm_node_array_destroy(array):
>     return _svmc.svm_node_array_destroy(array)
> svm_node_array_destroy = _svmc.svm_node_array_destroy
>
> def svm_node_matrix(size):
>     return _svmc.svm_node_matrix(size)
> svm_node_matrix = _svmc.svm_node_matrix
>
> def svm_node_matrix_set(matrix, i, array):
>     return _svmc.svm_node_matrix_set(matrix, i, array)
> svm_node_matrix_set = _svmc.svm_node_matrix_set
>
> def svm_node_matrix_destroy(matrix):
>     return _svmc.svm_node_matrix_destroy(matrix)
> svm_node_matrix_destroy = _svmc.svm_node_matrix_destroy
>
> def svm_destroy_model_helper(model_ptr):
>     return _svmc.svm_destroy_model_helper(model_ptr)
> svm_destroy_model_helper = _svmc.svm_destroy_model_helper
> # This file is compatible with both classic and new-style classes.
>
>
>
>
>
> ################
> # *Working* mvpa2/clfs/libsvmc/svmc.py
> ################
>
>
> # This file was automatically generated by SWIG (http://www.swig.org).
> # Version 3.0.2
> #
> # Do not make changes to this file unless you know what you are
> doing--modify
> # the SWIG interface file instead.
>
>
>
>
>
> from sys import version_info
> if version_info >= (2,6,0):
>     def swig_import_helper():
>         from os.path import dirname
>         import imp
>         fp = None
>         try:
>             fp, pathname, description = imp.find_module('_svmc',
> [dirname(__file__)])
>         except ImportError:
>             import _svmc
>             return _svmc
>         if fp is not None:
>             try:
>                 _mod = imp.load_module('_svmc', fp, pathname, description)
>             finally:
>                 fp.close()
>             return _mod
>     _svmc = swig_import_helper()
>     del swig_import_helper
> else:
>     import _svmc
> del version_info
> try:
>     _swig_property = property
> except NameError:
>     pass # Python < 2.2 doesn't have 'property'.
> def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
>     if (name == "thisown"): return self.this.own(value)
>     if (name == "this"):
>         if type(value).__name__ == 'SwigPyObject':
>             self.__dict__[name] = value
>             return
>     method = class_type.__swig_setmethods__.get(name,None)
>     if method: return method(self,value)
>     if (not static):
>         self.__dict__[name] = value
>     else:
>         raise AttributeError("You cannot add attributes to %s" % self)
>
> def _swig_setattr(self,class_type,name,value):
>     return _swig_setattr_nondynamic(self,class_type,name,value,0)
>
> def _swig_getattr(self,class_type,name):
>     if (name == "thisown"): return self.this.own()
>     method = class_type.__swig_getmethods__.get(name,None)
>     if method: return method(self)
>     raise AttributeError(name)
>
> def _swig_repr(self):
>     try: strthis = "proxy of " + self.this.__repr__()
>     except: strthis = ""
>     return "<%s.%s; %s >" % (self.__class__.__module__,
> self.__class__.__name__, strthis,)
>
> try:
>     _object = object
>     _newclass = 1
> except AttributeError:
>     class _object : pass
>     _newclass = 0
>
>
> __version__ = _svmc.__version__
> C_SVC = _svmc.C_SVC
> NU_SVC = _svmc.NU_SVC
> ONE_CLASS = _svmc.ONE_CLASS
> EPSILON_SVR = _svmc.EPSILON_SVR
> NU_SVR = _svmc.NU_SVR
> LINEAR = _svmc.LINEAR
> POLY = _svmc.POLY
> RBF = _svmc.RBF
> SIGMOID = _svmc.SIGMOID
> PRECOMPUTED = _svmc.PRECOMPUTED
> class svm_parameter(_object):
>     __swig_setmethods__ = {}
>     __setattr__ = lambda self, name, value: _swig_setattr(self,
> svm_parameter, name, value)
>     __swig_getmethods__ = {}
>     __getattr__ = lambda self, name: _swig_getattr(self, svm_parameter,
> name)
>     __repr__ = _swig_repr
>     __swig_setmethods__["svm_type"] = _svmc.svm_parameter_svm_type_set
>     __swig_getmethods__["svm_type"] = _svmc.svm_parameter_svm_type_get
>     if _newclass:svm_type =
> _swig_property(_svmc.svm_parameter_svm_type_get,
> _svmc.svm_parameter_svm_type_set)
>     __swig_setmethods__["kernel_type"] =
> _svmc.svm_parameter_kernel_type_set
>     __swig_getmethods__["kernel_type"] =
> _svmc.svm_parameter_kernel_type_get
>     if _newclass:kernel_type =
> _swig_property(_svmc.svm_parameter_kernel_type_get,
> _svmc.svm_parameter_kernel_type_set)
>     __swig_setmethods__["degree"] = _svmc.svm_parameter_degree_set
>     __swig_getmethods__["degree"] = _svmc.svm_parameter_degree_get
>     if _newclass:degree = _swig_property(_svmc.svm_parameter_degree_get,
> _svmc.svm_parameter_degree_set)
>     __swig_setmethods__["gamma"] = _svmc.svm_parameter_gamma_set
>     __swig_getmethods__["gamma"] = _svmc.svm_parameter_gamma_get
>     if _newclass:gamma = _swig_property(_svmc.svm_parameter_gamma_get,
> _svmc.svm_parameter_gamma_set)
>     __swig_setmethods__["coef0"] = _svmc.svm_parameter_coef0_set
>     __swig_getmethods__["coef0"] = _svmc.svm_parameter_coef0_get
>     if _newclass:coef0 = _swig_property(_svmc.svm_parameter_coef0_get,
> _svmc.svm_parameter_coef0_set)
>     __swig_setmethods__["cache_size"] = _svmc.svm_parameter_cache_size_set
>     __swig_getmethods__["cache_size"] = _svmc.svm_parameter_cache_size_get
>     if _newclass:cache_size =
> _swig_property(_svmc.svm_parameter_cache_size_get,
> _svmc.svm_parameter_cache_size_set)
>     __swig_setmethods__["eps"] = _svmc.svm_parameter_eps_set
>     __swig_getmethods__["eps"] = _svmc.svm_parameter_eps_get
>     if _newclass:eps = _swig_property(_svmc.svm_parameter_eps_get,
> _svmc.svm_parameter_eps_set)
>     __swig_setmethods__["C"] = _svmc.svm_parameter_C_set
>     __swig_getmethods__["C"] = _svmc.svm_parameter_C_get
>     if _newclass:C = _swig_property(_svmc.svm_parameter_C_get,
> _svmc.svm_parameter_C_set)
>     __swig_setmethods__["nr_weight"] = _svmc.svm_parameter_nr_weight_set
>     __swig_getmethods__["nr_weight"] = _svmc.svm_parameter_nr_weight_get
>     if _newclass:nr_weight =
> _swig_property(_svmc.svm_parameter_nr_weight_get,
> _svmc.svm_parameter_nr_weight_set)
>     __swig_setmethods__["weight_label"] =
> _svmc.svm_parameter_weight_label_set
>     __swig_getmethods__["weight_label"] =
> _svmc.svm_parameter_weight_label_get
>     if _newclass:weight_label =
> _swig_property(_svmc.svm_parameter_weight_label_get,
> _svmc.svm_parameter_weight_label_set)
>     __swig_setmethods__["weight"] = _svmc.svm_parameter_weight_set
>     __swig_getmethods__["weight"] = _svmc.svm_parameter_weight_get
>     if _newclass:weight = _swig_property(_svmc.svm_parameter_weight_get,
> _svmc.svm_parameter_weight_set)
>     __swig_setmethods__["nu"] = _svmc.svm_parameter_nu_set
>     __swig_getmethods__["nu"] = _svmc.svm_parameter_nu_get
>     if _newclass:nu = _swig_property(_svmc.svm_parameter_nu_get,
> _svmc.svm_parameter_nu_set)
>     __swig_setmethods__["p"] = _svmc.svm_parameter_p_set
>     __swig_getmethods__["p"] = _svmc.svm_parameter_p_get
>     if _newclass:p = _swig_property(_svmc.svm_parameter_p_get,
> _svmc.svm_parameter_p_set)
>     __swig_setmethods__["shrinking"] = _svmc.svm_parameter_shrinking_set
>     __swig_getmethods__["shrinking"] = _svmc.svm_parameter_shrinking_get
>     if _newclass:shrinking =
> _swig_property(_svmc.svm_parameter_shrinking_get,
> _svmc.svm_parameter_shrinking_set)
>     __swig_setmethods__["probability"] =
> _svmc.svm_parameter_probability_set
>     __swig_getmethods__["probability"] =
> _svmc.svm_parameter_probability_get
>     if _newclass:probability =
> _swig_property(_svmc.svm_parameter_probability_get,
> _svmc.svm_parameter_probability_set)
>     def __init__(self):
>         this = _svmc.new_svm_parameter()
>         try: self.this.append(this)
>         except: self.this = this
>     __swig_destroy__ = _svmc.delete_svm_parameter
>     __del__ = lambda self : None;
> svm_parameter_swigregister = _svmc.svm_parameter_swigregister
> svm_parameter_swigregister(svm_parameter)
>
> class svm_problem(_object):
>     __swig_setmethods__ = {}
>     __setattr__ = lambda self, name, value: _swig_setattr(self,
> svm_problem, name, value)
>     __swig_getmethods__ = {}
>     __getattr__ = lambda self, name: _swig_getattr(self, svm_problem, name)
>     __repr__ = _swig_repr
>     __swig_setmethods__["l"] = _svmc.svm_problem_l_set
>     __swig_getmethods__["l"] = _svmc.svm_problem_l_get
>     if _newclass:l = _swig_property(_svmc.svm_problem_l_get,
> _svmc.svm_problem_l_set)
>     __swig_setmethods__["y"] = _svmc.svm_problem_y_set
>     __swig_getmethods__["y"] = _svmc.svm_problem_y_get
>     if _newclass:y = _swig_property(_svmc.svm_problem_y_get,
> _svmc.svm_problem_y_set)
>     __swig_setmethods__["x"] = _svmc.svm_problem_x_set
>     __swig_getmethods__["x"] = _svmc.svm_problem_x_get
>     if _newclass:x = _swig_property(_svmc.svm_problem_x_get,
> _svmc.svm_problem_x_set)
>     def __init__(self):
>         this = _svmc.new_svm_problem()
>         try: self.this.append(this)
>         except: self.this = this
>     __swig_destroy__ = _svmc.delete_svm_problem
>     __del__ = lambda self : None;
> svm_problem_swigregister = _svmc.svm_problem_swigregister
> svm_problem_swigregister(svm_problem)
>
> class svm_model(_object):
>     __swig_setmethods__ = {}
>     __setattr__ = lambda self, name, value: _swig_setattr(self, svm_model,
> name, value)
>     __swig_getmethods__ = {}
>     __getattr__ = lambda self, name: _swig_getattr(self, svm_model, name)
>     __repr__ = _swig_repr
>     __swig_setmethods__["param"] = _svmc.svm_model_param_set
>     __swig_getmethods__["param"] = _svmc.svm_model_param_get
>     if _newclass:param = _swig_property(_svmc.svm_model_param_get,
> _svmc.svm_model_param_set)
>     __swig_setmethods__["nr_class"] = _svmc.svm_model_nr_class_set
>     __swig_getmethods__["nr_class"] = _svmc.svm_model_nr_class_get
>     if _newclass:nr_class = _swig_property(_svmc.svm_model_nr_class_get,
> _svmc.svm_model_nr_class_set)
>     __swig_setmethods__["l"] = _svmc.svm_model_l_set
>     __swig_getmethods__["l"] = _svmc.svm_model_l_get
>     if _newclass:l = _swig_property(_svmc.svm_model_l_get,
> _svmc.svm_model_l_set)
>     __swig_setmethods__["SV"] = _svmc.svm_model_SV_set
>     __swig_getmethods__["SV"] = _svmc.svm_model_SV_get
>     if _newclass:SV = _swig_property(_svmc.svm_model_SV_get,
> _svmc.svm_model_SV_set)
>     __swig_setmethods__["sv_coef"] = _svmc.svm_model_sv_coef_set
>     __swig_getmethods__["sv_coef"] = _svmc.svm_model_sv_coef_get
>     if _newclass:sv_coef = _swig_property(_svmc.svm_model_sv_coef_get,
> _svmc.svm_model_sv_coef_set)
>     __swig_setmethods__["rho"] = _svmc.svm_model_rho_set
>     __swig_getmethods__["rho"] = _svmc.svm_model_rho_get
>     if _newclass:rho = _swig_property(_svmc.svm_model_rho_get,
> _svmc.svm_model_rho_set)
>     __swig_setmethods__["probA"] = _svmc.svm_model_probA_set
>     __swig_getmethods__["probA"] = _svmc.svm_model_probA_get
>     if _newclass:probA = _swig_property(_svmc.svm_model_probA_get,
> _svmc.svm_model_probA_set)
>     __swig_setmethods__["probB"] = _svmc.svm_model_probB_set
>     __swig_getmethods__["probB"] = _svmc.svm_model_probB_get
>     if _newclass:probB = _swig_property(_svmc.svm_model_probB_get,
> _svmc.svm_model_probB_set)
>     __swig_setmethods__["label"] = _svmc.svm_model_label_set
>     __swig_getmethods__["label"] = _svmc.svm_model_label_get
>     if _newclass:label = _swig_property(_svmc.svm_model_label_get,
> _svmc.svm_model_label_set)
>     __swig_setmethods__["nSV"] = _svmc.svm_model_nSV_set
>     __swig_getmethods__["nSV"] = _svmc.svm_model_nSV_get
>     if _newclass:nSV = _swig_property(_svmc.svm_model_nSV_get,
> _svmc.svm_model_nSV_set)
>     __swig_setmethods__["free_sv"] = _svmc.svm_model_free_sv_set
>     __swig_getmethods__["free_sv"] = _svmc.svm_model_free_sv_get
>     if _newclass:free_sv = _swig_property(_svmc.svm_model_free_sv_get,
> _svmc.svm_model_free_sv_set)
>     def __init__(self):
>         this = _svmc.new_svm_model()
>         try: self.this.append(this)
>         except: self.this = this
>     __swig_destroy__ = _svmc.delete_svm_model
>     __del__ = lambda self : None;
> svm_model_swigregister = _svmc.svm_model_swigregister
> svm_model_swigregister(svm_model)
>
>
> def svm_set_verbosity(*args):
>   return _svmc.svm_set_verbosity(*args)
> svm_set_verbosity = _svmc.svm_set_verbosity
>
> def svm_train(*args):
>   return _svmc.svm_train(*args)
> svm_train = _svmc.svm_train
>
> def svm_cross_validation(*args):
>   return _svmc.svm_cross_validation(*args)
> svm_cross_validation = _svmc.svm_cross_validation
>
> def svm_save_model(*args):
>   return _svmc.svm_save_model(*args)
> svm_save_model = _svmc.svm_save_model
>
> def svm_load_model(*args):
>   return _svmc.svm_load_model(*args)
> svm_load_model = _svmc.svm_load_model
>
> def svm_get_svm_type(*args):
>   return _svmc.svm_get_svm_type(*args)
> svm_get_svm_type = _svmc.svm_get_svm_type
>
> def svm_get_nr_class(*args):
>   return _svmc.svm_get_nr_class(*args)
> svm_get_nr_class = _svmc.svm_get_nr_class
>
> def svm_get_labels(*args):
>   return _svmc.svm_get_labels(*args)
> svm_get_labels = _svmc.svm_get_labels
>
> def svm_get_svr_probability(*args):
>   return _svmc.svm_get_svr_probability(*args)
> svm_get_svr_probability = _svmc.svm_get_svr_probability
>
> def svm_predict_values(*args):
>   return _svmc.svm_predict_values(*args)
> svm_predict_values = _svmc.svm_predict_values
>
> def svm_predict(*args):
>   return _svmc.svm_predict(*args)
> svm_predict = _svmc.svm_predict
>
> def svm_predict_probability(*args):
>   return _svmc.svm_predict_probability(*args)
> svm_predict_probability = _svmc.svm_predict_probability
>
> def svm_check_parameter(*args):
>   return _svmc.svm_check_parameter(*args)
> svm_check_parameter = _svmc.svm_check_parameter
>
> def svm_check_probability_model(*args):
>   return _svmc.svm_check_probability_model(*args)
> svm_check_probability_model = _svmc.svm_check_probability_model
>
> def svm_node_matrix2numpy_array(*args):
>   return _svmc.svm_node_matrix2numpy_array(*args)
> svm_node_matrix2numpy_array = _svmc.svm_node_matrix2numpy_array
>
> def doubleppcarray2numpy_array(*args):
>   return _svmc.doubleppcarray2numpy_array(*args)
> doubleppcarray2numpy_array = _svmc.doubleppcarray2numpy_array
>
> def new_int(*args):
>   return _svmc.new_int(*args)
> new_int = _svmc.new_int
>
> def delete_int(*args):
>   return _svmc.delete_int(*args)
> delete_int = _svmc.delete_int
>
> def int_getitem(*args):
>   return _svmc.int_getitem(*args)
> int_getitem = _svmc.int_getitem
>
> def int_setitem(*args):
>   return _svmc.int_setitem(*args)
> int_setitem = _svmc.int_setitem
>
> def new_double(*args):
>   return _svmc.new_double(*args)
> new_double = _svmc.new_double
>
> def delete_double(*args):
>   return _svmc.delete_double(*args)
> delete_double = _svmc.delete_double
>
> def double_getitem(*args):
>   return _svmc.double_getitem(*args)
> double_getitem = _svmc.double_getitem
>
> def double_setitem(*args):
>   return _svmc.double_setitem(*args)
> double_setitem = _svmc.double_setitem
>
> def svm_node_array(*args):
>   return _svmc.svm_node_array(*args)
> svm_node_array = _svmc.svm_node_array
>
> def svm_node_array_set(*args):
>   return _svmc.svm_node_array_set(*args)
> svm_node_array_set = _svmc.svm_node_array_set
>
> def svm_node_array_destroy(*args):
>   return _svmc.svm_node_array_destroy(*args)
> svm_node_array_destroy = _svmc.svm_node_array_destroy
>
> def svm_node_matrix(*args):
>   return _svmc.svm_node_matrix(*args)
> svm_node_matrix = _svmc.svm_node_matrix
>
> def svm_node_matrix_set(*args):
>   return _svmc.svm_node_matrix_set(*args)
> svm_node_matrix_set = _svmc.svm_node_matrix_set
>
> def svm_node_matrix_destroy(*args):
>   return _svmc.svm_node_matrix_destroy(*args)
> svm_node_matrix_destroy = _svmc.svm_node_matrix_destroy
>
> def svm_destroy_model_helper(*args):
>   return _svmc.svm_destroy_model_helper(*args)
> svm_destroy_model_helper = _svmc.svm_destroy_model_helper
> # This file is compatible with both classic and new-style classes.
>
>
>
> _______________________________________________
> Pkg-ExpPsy-PyMVPA mailing list
> Pkg-ExpPsy-PyMVPA at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-exppsy-pymvpa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/pkg-exppsy-pymvpa/attachments/20150722/e30c0d90/attachment-0001.html>


More information about the Pkg-ExpPsy-PyMVPA mailing list