@Override
  public void writeModel(String file) {
    if (debug) {
      PrintWriter writer = null;
      try {
        writer = new PrintWriter(new FileWriter(file + ".debug"));
        int k = 0;
        for (int i = 0; i < labelFactory.allLabels.size(); i++) {
          for (int j = 0; j < featureFactory.allFeatures.size(); j++) {
            writer.println(labelFactory.allLabels.get(i) + ":" + featureFactory.allFeatures.get(j)
                + "\t" + ((LRParameter) para).lambda[k]);
            k++;
          }
        }
        writer.close();
      } catch (Exception e) {
        if (writer != null)
          writer.close();
      }
    }
    Serializer.serialize(this, file);
  }