1- using AutoAD: AutoMLFlowAnomalyDetections
2- using Distributed
1+ using AutoAD
32using ArgParse
43using CSV
54using DataFrames
6- using AutoAI
75using Statistics
6+ using AutoAD
87
98
109function parse_commandline ()
@@ -17,7 +16,7 @@ function parse_commandline()
1716 " --prediction_type" , " -t"
1817 help = " timeseriesprediction, anomalydetection"
1918 arg_type = String
20- default = " anomalydetecion "
19+ default = " anomalydetection "
2120 " --output_file" , " -o"
2221 help = " output location"
2322 arg_type = String
@@ -37,24 +36,15 @@ function parse_commandline()
3736 return parse_args (s; as_symbols= true )
3837end
3938
40- const _cliargs = (; parse_commandline ()... )
41- # _cliargs = parse_commandline()
42- const _workers = _cliargs[:workers ]
43- # _workers = _cliargs[:nworkers]
44-
45- nprocs () == 1 && addprocs (_workers; exeflags= [" --project=$(Base. active_project ()) " ])
46-
47- @everywhere using AutoAD
39+ const _cliargs = parse_commandline ()
4840
4941function autoadmode (args:: Dict )
5042 url = args[:url ]
51- prediction_type = args[:prediction_type ]
5243 votepercent = args[:votepercent ]
53- dictargs = (; votepercent, prediction_type) |> pairs |> Dict
5444 fname = args[:csvfile ]
5545 df = CSV. read (fname, DataFrame)
5646 X = df[:, 1 : 1 ]
57- autoad = AutoMLFlowAnomalyDetections (Dict (:url => url, dictargs ... ))
47+ autoad = AutoMLFlowAnomalyDetection (Dict (:url => url, :impl_args => Dict ( :votepercent => votepercent) ))
5848 Yc = fit_transform! (autoad, X)
5949 println (" output:" , Yc |> x -> first (x, 5 ))
6050 return Yc
@@ -68,9 +58,9 @@ function main(args)
6858 if predtype == " anomalydetection"
6959 autoadmode (args)
7060 elseif predtype == " timeseriesprediction"
71- autotsmode (_cliargs )
72- elseif predtype == " anomalydetection "
73- autoadmode (_cliargs)
61+ autotsmode (args )
62+ else
63+ @error " check cli arguments: $args "
7464 end
7565end
7666
0 commit comments