Class V1JsonToV2StateConverter

java.lang.Object
com.amazon.randomcutforest.serialize.json.v1.V1JsonToV2StateConverter

public class V1JsonToV2StateConverter
extends java.lang.Object
  • Constructor Details

  • Method Details

    • convert

      public RandomCutForestState convert​(java.lang.String json, Precision precision) throws java.io.IOException
      Throws:
      java.io.IOException
    • convert

      public java.util.Optional<RandomCutForestState> convert​(java.util.ArrayList<java.lang.String> jsons, int numberOfTrees, Precision precision) throws java.io.IOException
      Throws:
      java.io.IOException
    • convert

      public RandomCutForestState convert​(java.io.Reader reader, Precision precision) throws java.io.IOException
      Throws:
      java.io.IOException
    • convert

      public RandomCutForestState convert​(java.net.URL url, Precision precision) throws java.io.IOException
      Throws:
      java.io.IOException
    • convert

      public RandomCutForestState convert​(V1SerializedRandomCutForest serializedForest, Precision precision)
    • convert

      public RandomCutForestState convert​(java.util.List<V1SerializedRandomCutForest> serializedForests, int numberOfTrees, Precision precision)
      the function merges a collection of RCF-1.0 models with same model parameters and fixes the number of trees in the new model (which has to be less or equal than the sum of the old models) The conversion uses the execution context of the first forest and can be adjusted subsequently by setters
      Parameters:
      serializedForests - A non-empty list of forests (together having more trees than numberOfTrees)
      numberOfTrees - the new number of trees
      precision - the precision of the new forest
      Returns:
      a merged RCF with the first numberOfTrees trees