Skip to content

Commit d89bff3

Browse files
committed
restored assert and removed Bayesregressor from the atomic_models list
1 parent e69143c commit d89bff3

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ComputationalResources = "ed09eef8-17a6-5b46-8889-db040fac31e3"
1010
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
1111
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
1212
InferOpt = "4846b161-c94e-4150-8dac-c7ae193c601f"
13+
LaplaceRedux = "c52c1a26-f7c5-402b-80be-ba1e638ad478"
1314
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1415
MLJBase = "a7f614a8-145f-11e9-1d2a-a57a1082229d"
1516
MLJEnsembles = "50ed68f4-41fd-4504-931a-ed422449fee0"
@@ -30,6 +31,7 @@ ComputationalResources = "0.3"
3031
Distributions = "0.25.109"
3132
Flux = "0.13, 0.14"
3233
InferOpt = "0.6.1"
34+
LaplaceRedux = "1.0.2"
3335
LinearAlgebra = " 1.9, 1.10"
3436
MLJBase = "0.20, 0.21, 1"
3537
MLJEnsembles = "0.3.3, 0.4"

src/conformal_models/conformal_models.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ const tested_atomic_models = Dict(
126126
:nearest_neighbor => :(@load KNNRegressor pkg = NearestNeighborModels),
127127
:decision_tree_regressor => :(@load DecisionTreeRegressor pkg = DecisionTree),
128128
:random_forest_regressor => :(@load RandomForestRegressor pkg = DecisionTree),
129-
:bayesregressor => :(@load BayesRegressor pkg = LaplaceRedux),
129+
#:bayesregressor => :(@load BayesRegressor pkg = LaplaceRedux),
130130
# :light_gbm => :(@load LGBMRegressor pkg = LightGBM),
131131
# :neural_network => :(@load NeuralNetworkRegressor pkg = MLJFlux),
132132
# :symbolic_regression => (@load SRRegressor pkg = SymbolicRegression),

src/conformal_models/inductive_bayes_regression.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11

2+
using LaplaceRedux: LaplaceRegression
23
@doc raw"""
34
The `BayesRegressor` is the simplest approach to Inductive Conformalized Bayes. As explained in https://arxiv.org/abs/2107.07511,
45
the conformal score is defined as the opposite of the probability of observing y given x : `` s= -P(Y|X) ``. Once the treshold ``\hat{q}`` is chosen, The credible interval is then
@@ -19,6 +20,7 @@ function BayesRegressor(
1920
heuristic::Function=conformal_bayes_score,
2021
train_ratio::AbstractFloat=0.5,
2122
)
23+
@assert typeof(model) == LaplaceRegression "Model must be of type Laplace"
2224
return BayesRegressor(model, coverage, nothing, heuristic, train_ratio)
2325
end
2426

0 commit comments

Comments
 (0)