Skip to content

Commit

Permalink
Removed unnecessary include and using statements
Browse files Browse the repository at this point in the history
  • Loading branch information
dscolby committed Oct 29, 2024
1 parent d1a381b commit 1897aba
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 29 deletions.
6 changes: 5 additions & 1 deletion docs/src/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Release Notes
These release notes adhere to the [keep a changelog](https://keepachangelog.com/en/1.0.0/) format. Below is a list of changes since CausalELM was first released.

## Version [v0.7.0](https://github.com/dscolby/CausalELM.jl/releases/tag/v0.6.1) - 2024-06-22
## Version [v0.8.0](https://github.com/dscolby/CausalELM.jl/releases/tag/v0.6.1) - 2024-10-28
### Fixed
* Removed unnecessary include and using statements

## Version [v0.7.0](https://github.com/dscolby/CausalELM.jl/releases/tag/v0.7.0) - 2024-06-22
### Added
* Implemented bagged ensemble of extreme learning machines to use with estimators [#67](https://github.com/dscolby/CausalELM.jl/issues/67)
* Implemented multithreading for testing the sensitivity of estimators to the counterfactual consistency assumption
Expand Down
1 change: 0 additions & 1 deletion src/models.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Random: shuffle
using CausalELM: mean, var_type, clip_if_binary

"""
ExtremeLearner(X, Y, hidden_neurons, activation)
Expand Down
2 changes: 0 additions & 2 deletions test/test_estimators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ using Test
using CausalELM
using DataFrames

include("../src/models.jl")

x₀, y₀, x₁, y₁ = Float64.(rand(1:200, 100, 5)), rand(100), rand(10, 5), rand(10)
its = InterruptedTimeSeries(x₀, y₀, x₁, y₁)
estimate_causal_effect!(its)
Expand Down
2 changes: 0 additions & 2 deletions test/test_metalearners.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ using CausalELM
using Test
using DataFrames

include("../src/models.jl")

x, t, y = rand(100, 5), Float64.([rand() < 0.4 for i in 1:100]), vec(rand(1:100, 100, 1))
slearner1 = SLearner(x, t, y)
estimate_causal_effect!(slearner1)
Expand Down
42 changes: 20 additions & 22 deletions test/test_models.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Test
using CausalELM

include("../src/models.jl")

# Test classification functionality using a simple XOR test borrowed from
# ExtremeLearning.jl
x = [1.0 1.0; 0.0 1.0; 0.0 0.0; 1.0 0.0]
Expand All @@ -15,27 +13,27 @@ x1 = rand(20, 5)
y1 = rand(20)
x1test = rand(30, 5)

mock_model = ExtremeLearner(x, y, 10, σ)
mock_model = CausalELM.ExtremeLearner(x, y, 10, σ)

m1 = ExtremeLearner(x, y, 10, σ)
f1 = fit!(m1)
predictions1 = predict(m1, x_test)
predict_counterfactual!(m1, x_test)
placebo1 = placebo_test(m1)
m1 = CausalELM.ExtremeLearner(x, y, 10, σ)
f1 = CausalELM.fit!(m1)
predictions1 = CausalELM.predict(m1, x_test)
CausalELM.predict_counterfactual!(m1, x_test)
placebo1 = CausalELM.placebo_test(m1)

m3 = ExtremeLearner(x1, y1, 10, σ)
fit!(m3)
predictions3 = predict(m3, x1test)
m3 = CausalELM.ExtremeLearner(x1, y1, 10, σ)
CausalELM.fit!(m3)
predictions3 = CausalELM.predict(m3, x1test)

m4 = ExtremeLearner(rand(100, 5), rand(100), 5, relu)
fit!(m4)
m4 = CausalELM.ExtremeLearner(rand(100, 5), rand(100), 5, relu)
CausalELM.fit!(m4)

nofit = ExtremeLearner(x1, y1, 10, σ)
set_weights_biases(nofit)
nofit = CausalELM.ExtremeLearner(x1, y1, 10, σ)
CausalELM.set_weights_biases(nofit)

ensemble = ELMEnsemble(big_x, big_y, 10000, 100, 5, 10, relu)
fit!(ensemble)
predictions = predict(ensemble, big_x)
ensemble = CausalELM.ELMEnsemble(big_x, big_y, 10000, 100, 5, 10, relu)
CausalELM.fit!(ensemble)
predictions = CausalELM.predict(ensemble, big_x)

@testset "Extreme Learning Machines" begin
@testset "Extreme Learning Machine Structure" begin
Expand Down Expand Up @@ -71,8 +69,8 @@ predictions = predict(ensemble, big_x)

@testset "Predict Before Fit" begin
@test isdefined(nofit, :H) == true
@test_throws ErrorException predict(nofit, x1test)
@test_throws ErrorException placebo_test(nofit)
@test_throws ErrorException CausalELM.predict(nofit, x1test)
@test_throws ErrorException CausalELM.placebo_test(nofit)
end

@testset "Print Models" begin
Expand All @@ -84,10 +82,10 @@ end

@testset "Extreme Learning Machine Ensembles" begin
@testset "Initializing Ensembles" begin
@test ensemble isa ELMEnsemble
@test ensemble isa CausalELM.ELMEnsemble
@test ensemble.X isa Array{Float64}
@test ensemble.Y isa Array{Float64}
@test ensemble.elms isa Array{ExtremeLearner}
@test ensemble.elms isa Array{CausalELM.ExtremeLearner}
@test length(ensemble.elms) == 100
@test ensemble.feat_indices isa Vector{Vector{Int64}}
@test length(ensemble.feat_indices) == 100
Expand Down
2 changes: 1 addition & 1 deletion test/test_utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ estimate_causal_effect!(dm)
x_fold, t_fold, y_fold = CausalELM.generate_folds(dm.X, dm.T, dm.Y, dm.folds)

@testset "Moments" begin
@test mean([1, 2, 3]) == 2
@test CausalELM.mean([1, 2, 3]) == 2
@test CausalELM.var([1, 2, 3]) == 1
end

Expand Down

0 comments on commit 1897aba

Please sign in to comment.