rafan corrects a bug in svm.py When we specify instances by dictionary:
rafan corrects a bug in svm.py
When we specify instances by dictionary:

samples = [{}, {2:1}, {1:1}, {1:1, 2:1}]

First instance is (0, 0), the x[i].keys()
return nothing, it causes error in max().
Here is simple fix:

@@ -137,7 +144,8 @@
                        self.data.append(data);
                        svmc.svm_node_matrix_set(x_matrix,i,data)
                        if type(x[i]) == dict:
-                               self.maxlen = max(self.maxlen,max(x[i].keys()))
+                               if (len(x[i]) > 0):
+                                       self.maxlen = max(self.maxlen,max(x[i].keys()))
                        else:
                                self.maxlen = max(self.maxlen,len(x[i]))


dejon97/libsvm,cypro666/libsvm,androidYibo/libsvm,Maluuba/libsvm,cypro666/libsvm,ChinaQuants/libsvm,Guokr1991/libsvm,ntucllab/hintsvm,TKlerx/libsvm,Adoni/libsvm,toothacher17/libsvm,Guokr1991/libsvm,mvtuong/Yelp-Challenge,melissa-mccoy/libsvm,caidongyun/libsvm,dejon97/libsvm,melissa-mccoy/libsvm,androidYibo/libsvm,G-P-S/libsvm,mvtuong/Yelp-Challenge,mvtuong/Yelp-Challenge,ChinaQuants/libsvm,DaveGeneral/libsvm,DaveGeneral/libsvm,melissa-mccoy/libsvm,melissa-mccoy/libsvm,sdgdsffdsfff/libsvm,caidongyun/libsvm,caidongyun/libsvm,mhdella/libsvm,cjlin1/libsvm,Maluuba/libsvm,sdgdsffdsfff/libsvm,cypro666/libsvm,mvtuong/Yelp-Challenge,DaveGeneral/libsvm,ChinaQuants/libsvm,sdgdsffdsfff/libsvm,phoenixstar7/libsvm,ntucllab/hintsvm,asifmadnan/libsvm,DaveGeneral/libsvm,dejon97/libsvm,toothacher17/libsvm,TKlerx/libsvm,DaveGeneral/libsvm,cjlin1/libsvm,asifmadnan/libsvm,dejon97/libsvm,G-P-S/libsvm,toothacher17/libsvm,TKlerx/libsvm,asifmadnan/libsvm,sdgdsffdsfff/libsvm,androidYibo/libsvm,ntucllab/hintsvm,G-P-S/libsvm,cypro666/libsvm,Adoni/libsvm,toothacher17/libsvm,Maluuba/libsvm,mhdella/libsvm,phoenixstar7/libsvm,melissa-mccoy/libsvm,cjlin1/libsvm,G-P-S/libsvm,ntucllab/hintsvm,cjlin1/libsvm,Guokr1991/libsvm,mhdella/libsvm,androidYibo/libsvm,dejon97/libsvm,sdgdsffdsfff/libsvm,sdgdsffdsfff/libsvm,toothacher17/libsvm,asifmadnan/libsvm,TKlerx/libsvm,caidongyun/libsvm,melissa-mccoy/libsvm,asifmadnan/libsvm,androidYibo/libsvm,G-P-S/libsvm,phoenixstar7/libsvm,toothacher17/libsvm,asifmadnan/libsvm,TKlerx/libsvm,cjlin1/libsvm,Guokr1991/libsvm,cypro666/libsvm,DaveGeneral/libsvm,Maluuba/libsvm,Maluuba/libsvm,Guokr1991/libsvm,ntucllab/hintsvm,mhdella/libsvm,androidYibo/libsvm,mhdella/libsvm,Maluuba/libsvm,ChinaQuants/libsvm,phoenixstar7/libsvm,caidongyun/libsvm,Adoni/libsvm,ChinaQuants/libsvm,Guokr1991/libsvm,caidongyun/libsvm,dejon97/libsvm,Adoni/libsvm,mhdella/libsvm,cjlin1/libsvm,phoenixstar7/libsvm,TKlerx/libsvm,phoenixstar7/libsvm,ntucllab/hintsvm,cypro666/libsvm,G-P-S/libsvm,ChinaQuants/libsvm