MCPcopy Index your code
hub / github.com/clips/pattern / toPyModel

Function toPyModel

pattern/vector/svm/libsvm.py:299–309  ·  view source on GitHub ↗

toPyModel(model_ptr) -> svm_model Convert a ctypes POINTER(svm_model) to a Python svm_model

(model_ptr)

Source from the content-addressed store, hash-verified

297 return result
298
299def toPyModel(model_ptr):
300 """
301 toPyModel(model_ptr) -> svm_model
302
303 Convert a ctypes POINTER(svm_model) to a Python svm_model
304 """
305 if bool(model_ptr) == False:
306 raise ValueError("Null pointer")
307 m = model_ptr.contents
308 m.__createfrom__ = 'C'
309 return m
310
311fillprototype(libsvm.svm_train, POINTER(svm_model), [POINTER(svm_problem), POINTER(svm_parameter)])
312fillprototype(libsvm.svm_cross_validation, None, [POINTER(svm_problem), POINTER(svm_parameter), c_int, POINTER(c_double)])

Callers 4

svm_load_modelFunction · 0.70
svm_trainFunction · 0.70
load_modelFunction · 0.70
trainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…