docs: public Classifier<String, String> loadFromFilename(String file) {
      try {
        File tgtFile = new File(file);
        BufferedReader in = new BufferedReader(new FileReader(tgtFile));
  
        // Format: read indicies first, weights, then thresholds
        Index<String> labelIndex = HashIndex.loadFromReader(in);
        Index<String> featureIndex = HashIndex.loadFromReader(in);
        double[][] weights = new double[featureIndex.size()][labelIndex.size()];
        String line = in.readLine();
        int currLine = 1;
        while (line != null && line.length()>0) {
          String[] tuples = line.split(LinearClassifier.TEXT_SERIALIZATION_DELIMITER);
          if (tuples.length != 3) {
              throw new Exception("Error: incorrect number of tokens in weight specifier, line="
              +currLine+" in file "+tgtFile.getAbsolutePath());
          }
          currLine++;
          int feature = Integer.valueOf(tuples[0]);
          int label = Integer.valueOf(tuples[1]);
          double value = Double.valueOf(tuples[2]);
          weights[feature][label] = value;
          line = in.readLine();
        }
  
        // First line in thresholds is the number of thresholds
        int numThresholds = Integer.valueOf(in.readLine());
        double[] thresholds = new double[numThresholds];
        int curr = 0;
        while ((line = in.readLine()) != null) {
          double tval = Double.valueOf(line.trim());
          thresholds[curr++] = tval;
        }
        in.close();
        LinearClassifier<String, String> classifier = new LinearClassifier<String, String>(weights, featureIndex, labelIndex);
        return classifier;
      } catch (Exception e) {
        System.err.println("Error in LinearClassifierFactory, loading from file="+file);
        e.printStackTrace();
        return null;
      }
    }