Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions AutoAD/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name = "AutoAD"
uuid = "a90a1e1f-13cb-41ec-be1f-24b06fd2b474"
authors = ["Paulito Palmes, PhD <ppalmes@gmail.com>"]
version = "0.1.0"
68 changes: 68 additions & 0 deletions AutoAD/src/AutoAD.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
module AutoAD

greet() = print("Hello World!")

using Reexport
@reexport using AutoMLPipeline
@reexport using AMLPipelineBase

using CSV
using DataFrames
using AMLPipelineBase.AbsTypes
export fit, fit!, transform, transform!, fit_transform, fit_transform!
import AMLPipelineBase.AbsTypes: fit!, transform!, fit, transform
using AMLPipelineBase: AbsTypes, Utils

export get_iris


function get_iris()
iris = CSV.read(joinpath(Base.@__DIR__, "../../data", "iris.csv"), DataFrame)
return iris
end

# -------------
include("autoclassification.jl")
using .AutoClassifications
export AutoClassification

include("autoregression.jl")
using .AutoRegressions
export AutoRegression

include("skanomalydetector.jl")
using .SKAnomalyDetectors
export SKAnomalyDetector, skanomalydetectors
export skaddriver

include("caretanomalydetector.jl")
using .CaretAnomalyDetectors
export CaretAnomalyDetectors, CaretAnomalyDetector
export caretdriver


include("carettspredictor.jl")
using .CaretTSPredictors
export CaretTSPredictor, carettsdriver

include("autoanomalydetection.jl")
using .AutoAnomalyDetections
export AutoAnomalyDetection
export autoaddriver

include("automlflowclassification.jl")
using .AutoMLFlowClassifications
export AutoMLFlowClassification
export mlfcldriver

include("automlflowregression.jl")
using .AutoMLFlowRegressions
export AutoMLFlowRegression
export mlfregdriver

include("automlflowanomalydetection.jl")
using .AutoMLFlowAnomalyDetections
export AutoMLFlowAnomalyDetection
export mlfaddriver

end # module AutoAD
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
module AutoAnomalyDetections
using Distributed
using AutoMLPipeline
using ..AutoMLPipeline
using DataFrames: DataFrame, nrow, rename!
using AutoMLPipeline: score
using Random
using Statistics
using ..AbsTypes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ using Random
using ..AbsTypes
using ..Utils
using ..AutoAnomalyDetections
using ..AutoMLPipeline: getiris

import ..AbsTypes: fit, fit!, transform, transform!
export fit, fit!, transform, transform!
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions AutoAD/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module TestAutoAI
using Distributed

nprocs() == 1 && addprocs()
@everywhere using AutoAI

@everywhere include("./test_automl.jl")
@everywhere include("./test_caret_anomalydetector.jl")
include("./test_skanomalydetector.jl")
@everywhere include("./test_caret_tspredictor.jl")
end
File renamed without changes.
File renamed without changes.
18 changes: 8 additions & 10 deletions AutoAI/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,11 @@ CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
IJulia = "7073ff75-c697-5162-941a-fcdaad2a7d2a"
K8sClusterManagers = "5aeab163-63d2-4171-9fbf-e22244d80acb"
PDFmerger = "3beb2ed1-af7d-458f-b727-6e9beb3586c0"
PackageCompiler = "9b87118b-4619-50d2-8e1e-99f35a4d4d9d"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Expand All @@ -33,19 +29,21 @@ CondaPkg = "0.2.29"
DataFrames = "1.7.0"
Dates = "1.11.0"
Distributed = "1.11.0"
GR = "0.73.16"
IJulia = "1.29.0"
K8sClusterManagers = "0.1.5"
PDFmerger = "0.3.3"
PackageCompiler = "2.2.1"
Plots = "1.40.18"
PrecompileTools = "1.2.1"
PythonCall = "0.9.25"
Random = "1.11.0"
Reexport = "1.2.2"
Serialization = "1.11.0"
Statistics = "1.11.1"
StatsBase = "0.34.5"
Test = "1.11.0"

[extras]
CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Distributed", "Statistics", "CondaPkg", "Test"]
31 changes: 4 additions & 27 deletions AutoAI/src/AutoAI.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
module AutoAI

using Reexport
@reexport using AutoMLPipeline
@reexport using AMLPipelineBase

using CSV
using DataFrames
using AMLPipelineBase
using AMLPipelineBase.AbsTypes
export fit, fit!, transform, transform!, fit_transform, fit_transform!
import AMLPipelineBase.AbsTypes: fit!, transform!, fit, transform
using AMLPipelineBase: AbsTypes, Utils
using AutoMLPipeline

export get_iris

Expand All @@ -26,26 +28,6 @@ include("autoregression.jl")
using .AutoRegressions
export AutoRegression

include("skanomalydetector.jl")
using .SKAnomalyDetectors
export SKAnomalyDetector, skanomalydetectors
export skaddriver

include("caretanomalydetector.jl")
using .CaretAnomalyDetectors
export CaretAnomalyDetectors, CaretAnomalyDetector
export caretdriver


include("carettspredictor.jl")
using .CaretTSPredictors
export CaretTSPredictor, carettsdriver

include("autoanomalydetection.jl")
using .AutoAnomalyDetections
export AutoAnomalyDetection
export autoaddriver

include("automlflowclassification.jl")
using .AutoMLFlowClassifications
export AutoMLFlowClassification
Expand All @@ -56,9 +38,4 @@ using .AutoMLFlowRegressions
export AutoMLFlowRegression
export mlfregdriver

include("automlflowanomalydetection.jl")
using .AutoMLFlowAnomalyDetections
export AutoMLFlowAnomalyDetection
export mlfaddriver

end # module AutoAI
Empty file removed AutoAI/src/autoad.jl
Empty file.
5 changes: 2 additions & 3 deletions AutoAI/src/autoclassification.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ module AutoClassifications


using Distributed
using AutoMLPipeline
using DataFrames: DataFrame
using AutoMLPipeline: score
using Random
using ..AutoMLPipeline
using ..AbsTypes
using ..Utils

Expand Down Expand Up @@ -44,7 +43,7 @@ mutable struct AutoClassification <: Workflow
function AutoClassification(args=Dict())
default_args = Dict(
:name => "autoclass",
:complexity => "high",
:complexity => "low",
:prediction_type => "classification",
:nfolds => 3,
:metric => "balanced_accuracy_score",
Expand Down
26 changes: 13 additions & 13 deletions AutoAI/src/automlflowclassification.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,26 +110,26 @@ function mlfcldriver()
X = df[:, 1:end-1]
Y = df[:, end] |> collect

#mlfclass = AutoMLFlowClassification(Dict(:url => url))
#Yc = fit_transform!(mlfclass, X, Y)
#println("accuracy = ", mean(Y .== Yc))
mlfclass = AutoMLFlowClassification(Dict(:url => url))
Yc = fit_transform!(mlfclass, X, Y)
println("accuracy = ", mean(Y .== Yc))

# newmfclass = AutoMLFlowClassification(Dict(:url => url, :impl_args => Dict(:nfolds => 2)))
# Yc = fit_transform!(newmfclass, X, Y)
# println("accuracy = ", mean(Y .== Yc))
newmfclass = AutoMLFlowClassification(Dict(:url => url, :impl_args => Dict(:nfolds => 2)))
Yc = fit_transform!(newmfclass, X, Y)
println("accuracy = ", mean(Y .== Yc))

nclass = AutoMLFlowClassification(Dict(:url => url))
nclass.model[:automodel](; nfolds=2)
Yc = fit_transform!(nclass, X, Y)
println("accuracy = ", mean(Y .== Yc))

## test prediction using exisiting trained model from artifacts
#run_id = mlfclass.model[:run_id]
#newmfclass = AutoMLFlowClassification(Dict(:run_id => run_id, :url => url))
#newmfclass = AutoMLFlowClassification(Dict(:url => url))
#newmfclass(; run_id=run_id)
#Yn = transform!(newmfclass, X)
#println("accuracy = ", mean(Yn .== Y))
# test prediction using exisiting trained model from artifacts
run_id = mlfclass.model[:run_id]
newmfclass = AutoMLFlowClassification(Dict(:run_id => run_id, :url => url))
newmfclass = AutoMLFlowClassification(Dict(:url => url))
newmfclass(; run_id=run_id)
Yn = transform!(newmfclass, X)
println("accuracy = ", mean(Yn .== Y))

return nothing
end
Expand Down
7 changes: 2 additions & 5 deletions AutoAI/src/autoregression.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
module AutoRegressions
# classification search blocks


using Distributed
using AutoMLPipeline
using DataFrames: DataFrame
using AutoMLPipeline: score
using Random
using ..AutoMLPipeline
using ..AbsTypes
using ..Utils

Expand Down Expand Up @@ -44,7 +41,7 @@ mutable struct AutoRegression <: Workflow
function AutoRegression(args=Dict())
default_args = Dict(
:name => "autoreg",
:complexity => "high",
:complexity => "low",
:prediction_type => "regression",
:nfolds => 3,
:metric => "mean_squared_error",
Expand Down
7 changes: 0 additions & 7 deletions AutoAI/test/Project.toml

This file was deleted.

19 changes: 15 additions & 4 deletions AutoAI/test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
module TestAutoAI
using CondaPkg
using Distributed

nprocs() == 1 && addprocs()

@everywhere using AutoAI

@everywhere include("./test_automl.jl")
@everywhere include("./test_caret_anomalydetector.jl")
include("./test_skanomalydetector.jl")
@everywhere include("./test_caret_tspredictor.jl")
include("./test_automl.jl")

const tmpdir = tempdir()
const mlflowpath = joinpath(CondaPkg.envdir(), "bin", "mlflow")
const backendpath = joinpath("sqlite:///", tmpdir, "mlflow.db")
const artifactpath = joinpath(tmpdir, "mlruns")
cmd = "$mlflowpath server --host 127.0.0.1 --port 8080 --backend-store-uri $backendpath --default-artifact-root $artifactpath "
mlflowprocess = run(Cmd(`sh -c "$cmd"`), wait=false)

include("./test_automlflow.jl")

kill(mlflowprocess)

end
4 changes: 0 additions & 4 deletions AutoAI/test/test_automl.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
module TestAutoML
using Test
using CSV
using AutoAI
using DataFrames: DataFrame
using Serialization
using Distributed
using Statistics

const df = get_iris()
Expand Down
Loading
Loading