Skip to content

Commit

Permalink
Fix missing docs, feature_importance input type (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerjthomas9 authored Jun 27, 2023
1 parent 09c16b3 commit 3fbbafe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions docs/src/wrapper.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ Pool
CatBoost.CatBoostClassifier
CatBoost.CatBoostRegressor
cv
to_catboost
to_pandas
CatBoost.to_catboost
CatBoost.to_pandas
pandas_to_tbl
feature_importance
CatBoost.feature_importance
load_dataset
```
10 changes: 5 additions & 5 deletions src/wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ cv(pool::Py; kwargs...) = pandas_to_tbl(catboost.cv(pool; kwargs...))
#####

"""
to_catboost(arg)
CatBoost.to_catboost(arg)
`to_catboost` is called on each argument passed to [`fit`](@ref), [`predict`](@ref), [`predict_proba`](@ref), and [`cv`](@ref)
`CatBoost.to_catboost` is called on each argument passed to [`fit`](@ref), [`predict`](@ref), [`predict_proba`](@ref), and [`cv`](@ref)
to allow customization of the conversion of Julia types to python types.
By default, `to_catboost` simply checks if the argument satisfies `Tables.istable(arg)`, and if so, it outputs
Expand All @@ -55,7 +55,7 @@ to_catboost(arg) = Tables.istable(arg) ? to_pandas(arg) : arg
all_to_catboost(args) = (to_catboost(arg) for arg in args)

"""
to_pandas(X)
CatBoost.to_pandas(X)
Convert a table/array to a pandas dataframe
"""
Expand Down Expand Up @@ -83,11 +83,11 @@ end
#####

"""
feature_importance(py_model)
CatBoost.feature_importance(py_model::Py)
Generate a Vector{Pair{Symbol, Float64}} of feature importances
"""
function feature_importance(py_model)
function feature_importance(py_model::Py)
py_df_importance = pandas.DataFrame()
py_df_importance["name"] = py_model.feature_names_
py_df_importance["importance"] = py_model.feature_importances_
Expand Down

0 comments on commit 3fbbafe

Please sign in to comment.