Skip to content

Commit

Permalink
hintssss
Browse files Browse the repository at this point in the history
  • Loading branch information
deadsoul44 committed Aug 1, 2024
1 parent 207e6bc commit fb409b3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "perpetual"
version = "0.3.6"
version = "0.3.7"
edition = "2021"
authors = ["Mutlu Simsek <msimsek@perpetual-ml.com>"]
homepage = "https://perpetual-ml.com"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pip install perpetual
To use in a Rust project, add the following to your Cargo.toml file to get the package from [crates.io](https://crates.io/crates/perpetual).

```toml
perpetual = "0.3.6"
perpetual = "0.3.7"
```

## Paper
Expand Down
4 changes: 2 additions & 2 deletions python-package/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "py-perpetual"
version = "0.3.6"
version = "0.3.7"
edition = "2021"
authors = ["Mutlu Simsek <msimsek@perpetual-ml.com>"]
homepage = "https://perpetual-ml.com"
Expand All @@ -19,7 +19,7 @@ crate-type = ["cdylib", "rlib"]

[dependencies]
pyo3 = { version = "0.21", features = ["extension-module"] }
perpetual_rs = {package="perpetual", version = "0.3.6", path = "../" }
perpetual_rs = {package="perpetual", version = "0.3.7", path = "../" }
numpy = "0.21"
ndarray = "0.15"
serde_plain = { version = "1.0" }
Expand Down
2 changes: 1 addition & 1 deletion python-package/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "maturin"

[project]
name = "perpetual"
version = "0.3.6"
version = "0.3.7"
description = "A self-generalizing gradient boosting machine which doesn't need hyperparameter optimization"
license = { file = "LICENSE" }
keywords = [
Expand Down
8 changes: 4 additions & 4 deletions python-package/python/perpetual/booster.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ def partial_dependence(

def calculate_feature_importance(
self, method: str = "Gain", normalize: bool = True
) -> Union[Dict[int, float], dict[str, float]]:
) -> Union[Dict[int, float], Dict[str, float]]:
"""Feature importance values can be calculated with the `calculate_feature_importance` method. This function will return a dictionary of the features and their importance values. It should be noted that if a feature was never used for splitting it will not be returned in importance dictionary.
Args:
Expand Down Expand Up @@ -719,15 +719,15 @@ def number_of_trees(self) -> Union[int, Iterable[int]]:
return self.booster.number_of_trees

# Make picklable with getstate and setstate
def __getstate__(self) -> dict[Any, Any]:
def __getstate__(self) -> Dict[Any, Any]:
booster_json = self.json_dump()
# Delete booster
# Doing it like this, so it doesn't delete it globally.
res = {k: v for k, v in self.__dict__.items() if k != "booster"}
res["__booster_json_file__"] = booster_json
return res

def __setstate__(self, d: dict[Any, Any]) -> None:
def __setstate__(self, d: Dict[Any, Any]) -> None:
# Load the booster object the pickled JSon string.
booster_object = CratePerpetualBooster.from_json(d["__booster_json_file__"])
d["booster"] = booster_object
Expand All @@ -750,7 +750,7 @@ def get_params(self, deep=True) -> Dict[str, Any]:
deep (bool, optional): This argument does nothing, and is simply here for scikit-learn compatibility.. Defaults to True.
Returns:
dict[str, Any]: The parameters of the booster.
Dict[str, Any]: The parameters of the booster.
"""
args = inspect.getfullargspec(PerpetualBooster).kwonlyargs
return {param: getattr(self, param) for param in args}
Expand Down

0 comments on commit fb409b3

Please sign in to comment.