Orange Forum • View topic - How to see estimated coefficients of LibLinear LogReg model

How to see estimated coefficients of LibLinear LogReg model

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

How to see estimated coefficients of LibLinear LogReg model

Postby lefterav » Sun Jun 30, 2013 2:39

Function Orange.classification.logreg.dump(classifier) allows for seeing the coefficients that the model training has estimated, for a LogReg classifier. Unfortunately this function does not work for a LibLinearLogRegLearner classifier. But knowing the estimated coefficients is essential for knowing what the fitting actually did. How is it possible to get this information for LibLinearLogRegLearner?

Re: How to see estimated coefficients of LibLinear LogReg mo

Postby Ales » Mon Jul 01, 2013 9:33

The weights are stored in classifier.weights. This is a 2D table of coefficients, one row for each underlining binary classifier (LibLinear uses one vs. rest strategy to handle multi class problems).
Example for a binary classification case:
Code: Select all
import Orange
titanic = Orange.data.Table("titanic")
c = Orange.classification.logreg.LibLinearLogRegLearner(titanic)
for feat, w in zip(c.domain.features, c.weights[0]):
    print feat.name, ":", w

Note that if bias parameter is greater than 0 than the bias term is included as the last component of the weight vector.


Return to Questions & Support



cron