Orange Forum • View topic - Extract logistic model

Extract logistic model

A place to ask questions about methods in Orange and how they are used and other general support.

Extract logistic model

Postby Guest » Sun Dec 13, 2009 20:31

Hello

How do I extract the actual mathematical model that the logistic regression widget has created using the Orange canvas?

How do I do it with scripting?

Thank you

Postby Ales » Wed Dec 16, 2009 11:35

I dont't think it is possible to get the model from the canvas. With scripting however the beta coefficients are stored in the classifier's beta attribute.

Code: Select all
c = orngLR.LogRegLearner(data)
print c.beta


See the documentation for orange.LogRegLearner at http://www.ailab.si/orange/doc/reference/LogisticLearner.htm and orngLR module at http://www.ailab.si/orange/doc/modules/orngLR.htm

build model from beta's

Postby michaelhecht » Wed Jan 13, 2010 16:40

Is it also possible to build the LogRegClassifier from the beta's?

Since I don't want to train the model every time before I want to make predictions.

build model from beta's

Postby michaelhecht » Wed Jan 13, 2010 17:42

Meanwhile I tried to use pickle, but got the error

ValueError: invalid literal for float(): 1.#INF

while executing

f = open("model.mod","rb")
u = pickle.Unpickler(f)
self.model = u.load()
f.close()

(stored with:
f = open("model.mod","wb")
p = pickle.Pickler(f)
p.dump(self.model)
f.close()
)


Return to Questions & Support



cron