LIBIRWLS
pythonmodule.h
Go to the documentation of this file.
1 /*
2  ============================================================================
3  Author : Roberto Diaz Morales
4  ============================================================================
5 
6  Copyright (c) 2016 Roberto Díaz Morales
7 
8  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
9  (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge,
10  publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
11  subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14 
15  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
17  FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
18  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 
20  ============================================================================
21  */
22 
41 void delModel(PyObject* pymodel);
42 
43 
55 static PyObject *predict (PyObject *dummy, PyObject *args, PyObject *kwds);
56 
68 static PyObject *save (PyObject *dummy, PyObject *args, PyObject *kwds);
69 
70 
82 static PyObject *load (PyObject *dummy, PyObject *args, PyObject *kwds);
83 
84 
95 svm_dataset numpy2dataset(PyObject *arr1,PyObject *arr2);
96 
107 svm_dataset numpy2datasetWithAverage(PyObject *arr1,PyObject *arr2);
119 static PyObject*
120 PSIRWLStrain (PyObject *dummy, PyObject *args, PyObject *kwds);
121 
133 static PyObject*
134 PIRWLStrain (PyObject *dummy, PyObject *args, PyObject *kwds);
135 
136 
143 static PyMethodDef LIBIRWLSMethods[] = {
144  {"load", (PyCFunction)load, METH_VARARGS|METH_KEYWORDS, "It loads a model from a file"},
145  {"PIRWLStrain", (PyCFunction)PIRWLStrain, METH_VARARGS|METH_KEYWORDS, "It trains a model using the PIRWLS algorithm"},
146  {"PSIRWLStrain", (PyCFunction)PSIRWLStrain, METH_VARARGS|METH_KEYWORDS, "It trains a model using the PSIRWLS algorithm"},
147  {"save", (PyCFunction)save, METH_VARARGS|METH_KEYWORDS, "It saves a model in a file"},
148  {"predict", (PyCFunction)predict, METH_VARARGS|METH_KEYWORDS, "Predictions using a trained model"},
149  { NULL, NULL, 0, NULL}
150 };
151 
159 PyMODINIT_FUNC
160 initLIBIRWLS(void);
161 
162 
163 
164 
A dataset.
Definition: IOStructures.h:108
PyMODINIT_FUNC initLIBIRWLS(void)
Initialization of the python module.
Definition: pythonmodule.c:512
svm_dataset numpy2datasetWithAverage(PyObject *arr1, PyObject *arr2)
Convert numpy array to a dataset and the average of every class data.
Definition: pythonmodule.c:276
void delModel(PyObject *pymodel)
Model capsule destructor.
Definition: pythonmodule.c:54
svm_dataset numpy2dataset(PyObject *arr1, PyObject *arr2)
Convert numpy array to a dataset.
Definition: pythonmodule.c:212