Examples of SerializedObject


Examples of weka.core.SerializedObject

  public static Kernel[] makeCopies(Kernel model, int num) throws Exception {
    if (model == null)
      throw new Exception("No model kernel set");

    Kernel[] kernels = new Kernel[num];
    SerializedObject so = new SerializedObject(model);
    for (int i = 0; i < kernels.length; i++)
      kernels[i] = (Kernel) so.getObject();

    return kernels;
  }
View Full Code Here

Examples of weka.core.SerializedObject

   * @param source the object to copy
   * @return a copy of the source object
   * @exception Exception if the copy fails
   */
  public static Object makeCopy(Object source) throws Exception {
    SerializedObject so = new SerializedObject(source);
    Object result = so.getObject();
    return result;
  }
View Full Code Here

Examples of weka.core.SerializedObject

   * @param model the clusterer to copy
   * @return a deep copy of the clusterer
   * @exception Exception if an error occurs
   */
  public static Clusterer makeCopy(Clusterer model) throws Exception {
    return (Clusterer) new SerializedObject(model).getObject();
  }
View Full Code Here

Examples of weka.core.SerializedObject

          int num) throws Exception {
     if (model == null) {
      throw new Exception("No model clusterer set");
    }
    Clusterer [] clusterers = new Clusterer [num];
    SerializedObject so = new SerializedObject(model);
    for(int i = 0; i < clusterers.length; i++) {
      clusterers[i] = (Clusterer) so.getObject();
    }
    return clusterers;
  }
View Full Code Here

Examples of weka.core.SerializedObject

   * @return a deep copy of the classifier
   * @exception Exception if an error occurs
   */
  public static Classifier makeCopy(Classifier model) throws Exception {

    return (Classifier)new SerializedObject(model).getObject();
  }
View Full Code Here

Examples of weka.core.SerializedObject

    if (model == null) {
      throw new Exception("No model classifier set");
    }
    Classifier [] classifiers = new Classifier [num];
    SerializedObject so = new SerializedObject(model);
    for(int i = 0; i < classifiers.length; i++) {
      classifiers[i] = (Classifier) so.getObject();
    }
    return classifiers;
  }
View Full Code Here

Examples of weka.core.SerializedObject

      clone.m_trainInstances = new Instances(m_trainInstances); // copy training instances
     
      // deep copy the random object
      if (m_random != null) {
  SerializedObject randomSerial = null;
  try {
    randomSerial = new SerializedObject(m_random);
  } catch (Exception ignored) {} // we know that Random is serializable
  clone.m_random = (Random) randomSerial.getObject();
      }

      clone.m_lastAddedSplitNum = m_lastAddedSplitNum;
      clone.m_numericAttIndices = m_numericAttIndices;
      clone.m_nominalAttIndices = m_nominalAttIndices;
View Full Code Here

Examples of weka.core.SerializedObject

        // unbiased predictions
        insts.randomize(random);
        insts.stratify(numFolds);
        for (int i = 0; i < numFolds; i++) {
          Instances train = insts.trainCV(numFolds, i, random);
          SerializedObject so = new SerializedObject(this);
          BinaryMISMO smo = (BinaryMISMO)so.getObject();
          smo.buildClassifier(train, cl1, cl2, false, -1, -1);
          Instances test = insts.testCV(numFolds, i);
          for (int j = 0; j < test.numInstances(); j++) {
            double[] vals = new double[2];
            vals[0] = smo.SVMOutput(-1, test.instance(j));
View Full Code Here

Examples of weka.core.SerializedObject

   * The environment variables.
   */
  protected transient Environment m_env;
 
  private weka.core.converters.Saver makeCopy() throws Exception {
    return (weka.core.converters.Saver)new SerializedObject(m_SaverTemplate).getObject();
  }
View Full Code Here

Examples of weka.core.SerializedObject

    DeleteNodeAction(int nTargetNode) {
      m_nTargetNode = nTargetNode;
      m_att = m_Instances.attribute(nTargetNode);
      try {
        SerializedObject so = new SerializedObject(m_Distributions[nTargetNode]);
        m_CPT = (Estimator[]) so.getObject();
        ;
        so = new SerializedObject(m_ParentSets[nTargetNode]);
        m_ParentSet = (ParentSet) so.getObject();
      } catch (Exception e) {
        e.printStackTrace();
      }
      m_deleteArcActions = new FastVector();
      for (int iNode = 0; iNode < getNrOfNodes(); iNode++) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.