From 70ba9820d242931fe4847adbfa7f8e6c72111751 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Tue, 8 Mar 2022 09:53:45 +1300 Subject: [PATCH 1/3] doc-string improvement --- src/MLJDecisionTreeInterface.jl | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/MLJDecisionTreeInterface.jl b/src/MLJDecisionTreeInterface.jl index 7ab781f..0d74811 100644 --- a/src/MLJDecisionTreeInterface.jl +++ b/src/MLJDecisionTreeInterface.jl @@ -338,10 +338,11 @@ where - `X`: any table of input features (eg, a `DataFrame`) whose columns each have one of the following element scitypes: `Continuous`, - `Count`, or `<:OrderedFactor`. + `Count`, or `<:OrderedFactor`; check column scitypes with `schema(X)` - `y`: is the target, which can be any `AbstractVector` whose element - scitype is `<:OrderedFactor` or `<:Multiclass`. + scitype is `<:OrderedFactor` or `<:Multiclass`; check the scitype + with `scitype(y)` Train the machine using `fit!(mach, rows=...)`. @@ -470,10 +471,11 @@ where - `X`: any table of input features (eg, a `DataFrame`) whose columns each have one of the following element scitypes: `Continuous`, - `Count`, or `<:OrderedFactor`. + `Count`, or `<:OrderedFactor`; check column scitypes with `schema(X)` - `y`: the target, which can be any `AbstractVector` whose element - scitype is `<:OrderedFactor` or `<:Multiclass`. + scitype is `<:OrderedFactor` or `<:Multiclass`; check the scitype + with `scitype(y)` Train the machine with `fit!(mach, rows=...)`. @@ -556,10 +558,11 @@ where: - `X`: any table of input features (eg, a `DataFrame`) whose columns each have one of the following element scitypes: `Continuous`, - `Count`, or `<:OrderedFactor`. + `Count`, or `<:OrderedFactor`; check column scitypes with `schema(X)` - `y`: the target, which can be any `AbstractVector` whose element - scitype is `<:OrderedFactor` or `<:Multiclass`. + scitype is `<:OrderedFactor` or `<:Multiclass`; check the scitype + with `scitype(y)` Train the machine with `fit!(mach, rows=...)`. @@ -629,10 +632,10 @@ where - `X`: any table of input features (eg, a `DataFrame`) whose columns each have one of the following element scitypes: `Continuous`, - `Count`, or `<:OrderedFactor`. + `Count`, or `<:OrderedFactor`; check column scitypes with `schema(X)` - `y`: the target, which can be any `AbstractVector` whose element - scitype is `Continuous`. + scitype is `Continuous`; check the scitype with `scitype(y)` Train the machine with `fit!(mach, rows=...)`. @@ -709,10 +712,10 @@ where - `X`: any table of input features (eg, a `DataFrame`) whose columns each have one of the following element scitypes: `Continuous`, - `Count`, or `<:OrderedFactor`. + `Count`, or `<:OrderedFactor`; check column scitypes with `schema(X)` - `y`: the target, which can be any `AbstractVector` whose element - scitype is `Continuous`. + scitype is `Continuous`; check the scitype with `scitype(y)` Train the machine with `fit!(mach, rows=...)`. From da2d2abe135aa80b80226c7d7bee9ea74777cf60 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Tue, 8 Mar 2022 09:54:23 +1300 Subject: [PATCH 2/3] bump 0.2.1 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index ce212e9..3140be6 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "MLJDecisionTreeInterface" uuid = "c6f25543-311c-4c74-83dc-3ea6d1015661" authors = ["Anthony D. Blaom "] -version = "0.2.0" +version = "0.2.1" [deps] DecisionTree = "7806a523-6efd-50cb-b5f6-3fa6f1930dbb" From f8f2b5bee684b793d05a0fb2d761aecb30618576 Mon Sep 17 00:00:00 2001 From: "Anthony D. Blaom" Date: Tue, 8 Mar 2022 16:41:01 +1300 Subject: [PATCH 3/3] add reference for algorithms to doc-strings --- src/MLJDecisionTreeInterface.jl | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/MLJDecisionTreeInterface.jl b/src/MLJDecisionTreeInterface.jl index 0d74811..6ac287d 100644 --- a/src/MLJDecisionTreeInterface.jl +++ b/src/MLJDecisionTreeInterface.jl @@ -325,9 +325,20 @@ MMI.metadata_model( # # DOCUMENT STRINGS +const DOC_CART = "[CART algorithm](https://en.wikipedia.org/wiki/Decision_tree_learning)"* +", originally published in Breiman, Leo; Friedman, J. H.; Olshen, R. A.; "* +"Stone, C. J. (1984): \"Classification and regression trees\". *Monterey, "* +"CA: Wadsworth & Brooks/Cole Advanced Books & Software.*" + +const DOC_RANDOM_FOREST = "[Random Forest algorithm]"* + "(https://en.wikipedia.org/wiki/Random_forest), originally published in "* + "Breiman, L. (2001): \"Random Forests.\", *Machine Learning*, vol. 45, pp. 5–32" + """ $(MMI.doc_header(DecisionTreeClassifier)) +`DecisionTreeClassifier` implements the $DOC_CART. + # Training data In MLJ or MLJBase, bind an instance `model` to data with @@ -461,6 +472,9 @@ DecisionTreeClassifier """ $(MMI.doc_header(RandomForestClassifier)) +`RandomForestClassifier` implements the standard $DOC_RANDOM_FOREST. + + # Training data In MLJ or MLJBase, bind an instance `model` to data with @@ -548,6 +562,7 @@ RandomForestClassifier """ $(MMI.doc_header(AdaBoostStumpClassifier)) + # Training data In MLJ or MLJBase, bind an instance `model` to data with @@ -622,6 +637,9 @@ AdaBoostStumpClassifier """ $(MMI.doc_header(DecisionTreeRegressor)) +`DecisionTreeRegressor` implements the $DOC_CART. + + # Training data In MLJ or MLJBase, bind an instance `model` to data with @@ -702,6 +720,9 @@ DecisionTreeRegressor """ $(MMI.doc_header(RandomForestRegressor)) +`DecisionTreeRegressor` implements the standard $DOC_RANDOM_FOREST + + # Training data In MLJ or MLJBase, bind an instance `model` to data with