1

I'm using Liblinear in order to train models for a classification problem. I have noticed that changing the order of samples in the training data can result in different models. To test this i have created two different liblinear problems which include the same data in different order.

Problem 1:
x:
[FeatureNode(idx=1, value=1.0), FeatureNode(idx=2, value=1.0), FeatureNode(idx=5, value=1.0)]
[FeatureNode(idx=1, value=1.0), FeatureNode(idx=2, value=1.0), FeatureNode(idx=3, value=1.0), FeatureNode(idx=5, value=1.0)]
y:
[1.0, 0.0]
Generated model:
[0.0, 0.0, -1.0, 0.0, 0.0]

Problem2:
x:
[FeatureNode(idx=1, value=1.0), FeatureNode(idx=2, value=1.0), FeatureNode(idx=3, value=1.0), FeatureNode(idx=5, value=1.0)]
[FeatureNode(idx=1, value=1.0), FeatureNode(idx=2, value=1.0), FeatureNode(idx=5, value=1.0)]
y:
[0.0, 1.0]
Generated model:
[0.04166666666666674, 0.04166666666666674, 0.875, 0.0, 0.04166666666666674]

What is the reason for this? Can this be avoided?

Yonanam
  • 321
  • 1
  • 3
  • 6
  • I do not know the answer here, but i am interest and might reproduce this. Which version of liblinear do you use? The output looks like the java version of liblinear (otherwise i cannot help). Which solver do you use? Your code snippet would be helpful to see your setup. –  Aug 21 '15 at 19:17
  • I'm using liblinear-java-1.95, using solver L2R_L1LOSS_SVC_DUAL. idx=5 is the bias feature. After creating the problem which is stated above, i use: Model model = Linear.train(prob, parameter); – Yonanam Aug 23 '15 at 07:26

0 Answers0