github.com/pachyderm/pachyderm@v1.13.4/examples/ml/iris/julia/iris-infer-julia/infer.jl (about)

     1  using DataFrames
     2  using DecisionTree
     3  using JLD
     4  
     5  # Load our model.
     6  model = load(ARGS[1], "model")
     7  
     8  # Walk over the directory with input attribute files.
     9  attributes = readdir(ARGS[2])
    10  for file in attributes
    11    p = joinpath(ARGS[2], file)
    12    if isdir(p)
    13      continue
    14    elseif isfile(p)
    15      df = readtable(p, header = false)
    16      open(joinpath(ARGS[3], file), "a") do x
    17        for r in eachrow(df)
    18          prediction = DecisionTree.predict(model, convert(Array, r))
    19          write(x, string(prediction[1], "\n"))
    20        end
    21      end
    22    end
    23  end
    24