julia_train_model.jl 1014 B

123456789101112131415161718192021222324252627282930313233343536
  1. using DataFrames
  2. using CSV
  3. using PyCall, JLD, PyCallJLD
  4. using ArgParse
  5. function main(args)
  6. # initialize the settings (the description is for the help screen)
  7. s = ArgParseSettings(description = "Example 1 for argparse.jl: minimal usage.")
  8. @add_arg_table s begin
  9. "--data"
  10. # arg_type = Int # only Int arguments allowed
  11. # nargs = '?' # '?' means optional argument
  12. # default = 0 # this is used when the option is not passed
  13. # constant = 1 # this is used if --opt1 is paseed with no argument
  14. help = "Data file for train and test"
  15. "--output"
  16. help = "output model name"
  17. "choice"
  18. help = "Model choice"
  19. end
  20. parsed_args = parse_args(s) # the result is a Dict{String,Any}
  21. println(parsed_args["data"])
  22. println("Parsed args:")
  23. for (key,val) in parsed_args
  24. println(" $key => $(repr(val))")
  25. end
  26. end
  27. main(ARGS)