title: How to convert numpy array into libsvm format
body: <p>I have a numpy array for an image and am trying to dump it into the libsvm format of <code>LABEL I0:V0 I1:V1 I2:V2..IN:VN</code>. I see that scikit-learn has a <code>dump_svmlight_file</code> and would like to use that if possible since it's optimized and stable. </p>
  
  <p>It takes parameters of X, y, and file output name. The values I'm thinking about would be:
  X - numpy array
  y - ????
  file output name - self-explanatory </p>
  
  <p>Would this be a correct assumption for X? I'm very confused about what I should do for y though. 
  It appears it needs to be a feature set of some kind. I don't know how I would go about obtaining that however. Thanks in advance for the help!</p>