-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace MLJ dependency with MLJBase and StatisticalMeasures (#4)
- Loading branch information
1 parent
c0b6c52
commit 366f53a
Showing
8 changed files
with
46 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Revise | ||
|
||
using SpeciesDistributionModels, GLMakie | ||
import SpeciesDistributionModels as SDM | ||
|
||
presences = (a = rand(200), b = rand(200), c = rand(200)) | ||
background = (a = rand(200), b = sqrt.(rand(200)), c = rand(200).^2) | ||
|
||
models = [ | ||
SDM.linear_model(), | ||
SDM.boosted_regression_tree(), | ||
SDM.random_forest(), | ||
SDM.random_forest(; n_trees = 10, max_depth = 3)] | ||
|
||
ensemble = sdm(presences, background, models, [SDM.MLJBase.CV(; shuffle = true)]) | ||
|
||
interactive_evaluation(ensemble) | ||
|
||
shapley = shap(ensemble; n_samples = 5) | ||
|
||
interactive_response_curves(shapley) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
# Load in models and wrap them to hide @load | ||
# Load in models and wrap them to hide the interfaces | ||
# Do we want to get ride of these as dependencies? | ||
|
||
const lbc = MLJ.@load LinearBinaryClassifier pkg=GLM verbosity = 0 | ||
const etc = MLJ.@load EvoTreeClassifier pkg=EvoTrees verbosity = 0 | ||
const rf = MLJ.@load RandomForestClassifier pkg=DecisionTree verbosity = 0 | ||
using MLJGLMInterface: LinearBinaryClassifier | ||
using EvoTrees: EvoTreeClassifier | ||
using MLJDecisionTreeInterface: RandomForestClassifier | ||
|
||
linear_model(; kw...) = lbc(; kw...) | ||
boosted_regression_tree(; kw...) = etc(; kw...) | ||
random_forest(; kw...) = rf(; kw...) | ||
linear_model = LinearBinaryClassifier | ||
boosted_regression_tree = EvoTreeClassifier | ||
random_forest = RandomForestClassifier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters