public SVMExamples(ObjectInputStream in) throws IOException {
  this(in.readInt(),in.readDouble());
  this.dim=in.readInt();
  String scaleString=in.readUTF();
  if (scaleString.equals("scale")) {
    int numberOfAttributes=in.readInt();
    this.meanVarianceMap=new HashMap<Integer,MeanVariance>();
    for (int i=0; i < numberOfAttributes; i++) {
      int index=in.readInt();
      double mean=in.readDouble();
      double variance=in.readDouble();
      meanVarianceMap.put(Integer.valueOf(index),new MeanVariance(mean,variance));
    }
  }
  for (int e=0; e < this.train_size; e++) {
    index[e]=new int[in.readInt()];
    atts[e]=new double[index[e].length];
    for (int a=0; a < index[e].length; a++) {
      index[e][a]=in.readInt();
      atts[e][a]=in.readDouble();
    }
    alphas[e]=in.readDouble();
    ys[e]=in.readDouble();
  }
}

public SVMExamples ( ObjectInputStream in ) throws IOException { this ( in . readInt ( ) , in . readDouble ( ) ) ; this . dim = in . readInt ( ) ; String scaleString = in . readUTF ( ) ; if ( scaleString . equals ( "scale" ) ) { int numberOfAttributes = in . readInt ( ) ; this . meanVarianceMap = new HashMap < Integer , MeanVariance > ( ) ; for ( int i = 0 ; i < numberOfAttributes ; i ++ ) { int index = in . readInt ( ) ; double mean = in . readDouble ( ) ; double variance = in . readDouble ( ) ; meanVarianceMap . put ( Integer . valueOf ( index ) , new MeanVariance ( mean , variance ) ) ; } } for ( int e = 0 ; e < this . train_size ; e ++ ) { index [ e ] = new int [ in . readInt ( ) ] ; atts [ e ] = new double [ index [ e ] . length ] ; for ( int a = 0 ; a < index [ e ] . length ; a ++ ) { index [ e ] [ a ] = in . readInt ( ) ; atts [ e ] [ a ] = in . readDouble ( ) ; } alphas [ e ] = in . readDouble ( ) ; ys [ e ] = in . readDouble ( ) ; } }
reads an example set from the given input stream .
