|
1 | 1 | module AutoMLPipeline |
2 | 2 |
|
| 3 | +using PrecompileTools: @setup_workload, @compile_workload |
3 | 4 | using AMLPipelineBase |
4 | 5 | using AMLPipelineBase.AbsTypes |
5 | 6 | export fit, fit!, transform, transform!,fit_transform, fit_transform! |
@@ -35,39 +36,54 @@ import AMLPipelineBase.AbsTypes: fit!, transform! |
35 | 36 |
|
36 | 37 | # -------------------------------------------- |
37 | 38 |
|
38 | | -include("skpreprocessor.jl") |
| 39 | +@setup_workload begin |
| 40 | + @compile_workload begin |
| 41 | + include("skpreprocessor.jl") |
| 42 | + end |
| 43 | +end |
39 | 44 | using .SKPreprocessors |
40 | 45 | export SKPreprocessor, skpreprocessors |
41 | 46 |
|
42 | | -include("sklearners.jl") |
| 47 | +@setup_workload begin |
| 48 | + @compile_workload begin |
| 49 | + include("sklearners.jl") |
| 50 | + end |
| 51 | +end |
43 | 52 | using .SKLearners |
44 | 53 | export SKLearner, sklearners |
45 | 54 |
|
46 | | -include("skcrossvalidator.jl") |
| 55 | +@setup_workload begin |
| 56 | + @compile_workload begin |
| 57 | + include("skcrossvalidator.jl") |
| 58 | + end |
| 59 | +end |
47 | 60 | using .SKCrossValidators |
48 | 61 | export crossvalidate |
49 | 62 |
|
50 | 63 | export skoperator |
| 64 | +@setup_workload begin |
| 65 | + @compile_workload begin |
| 66 | + function skoperator(name::String; args...)::Machine |
| 67 | + sklr = keys(SKLearners.learner_dict) |
| 68 | + skpr = keys(SKPreprocessors.preprocessor_dict) |
| 69 | + if name ∈ sklr |
| 70 | + obj = SKLearner(name; args...) |
| 71 | + elseif name ∈ skpr |
| 72 | + obj = SKPreprocessor(name; args...) |
| 73 | + else |
| 74 | + skoperator() |
| 75 | + throw(ArgumentError("$name does not exist")) |
| 76 | + end |
| 77 | + return obj |
| 78 | + end |
51 | 79 |
|
52 | | -function skoperator(name::String; args...)::Machine |
53 | | - sklr = keys(SKLearners.learner_dict) |
54 | | - skpr = keys(SKPreprocessors.preprocessor_dict) |
55 | | - if name ∈ sklr |
56 | | - obj = SKLearner(name; args...) |
57 | | - elseif name ∈ skpr |
58 | | - obj = SKPreprocessor(name; args...) |
59 | | - else |
60 | | - skoperator() |
61 | | - throw(ArgumentError("$name does not exist")) |
62 | | - end |
63 | | - return obj |
64 | | -end |
65 | | - |
66 | | -function skoperator() |
67 | | - sklr = keys(SKLearners.learner_dict) |
68 | | - skpr = keys(SKPreprocessors.preprocessor_dict) |
69 | | - println("Please choose among these pipeline elements:") |
70 | | - println([sklr..., skpr...]) |
| 80 | + function skoperator() |
| 81 | + sklr = keys(SKLearners.learner_dict) |
| 82 | + skpr = keys(SKPreprocessors.preprocessor_dict) |
| 83 | + println("Please choose among these pipeline elements:") |
| 84 | + println([sklr..., skpr...]) |
| 85 | + end |
| 86 | + end |
71 | 87 | end |
72 | 88 |
|
73 | 89 | end # module |
0 commit comments