Skip to content

Commit

Permalink
convert_input_array
Browse files Browse the repository at this point in the history
  • Loading branch information
deadsoul44 committed Nov 21, 2024
1 parent 492afa7 commit 2104641
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 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.7.6"
version = "0.7.7"
edition = "2021"
authors = ["Mutlu Simsek <[email protected]>"]
homepage = "https://perpetual-ml.com"
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.7.6"
version = "0.7.7"
edition = "2021"
authors = ["Mutlu Simsek <[email protected]>"]
homepage = "https://perpetual-ml.com"
Expand All @@ -19,7 +19,7 @@ crate-type = ["cdylib", "rlib"]

[dependencies]
pyo3 = { version = "0.22.6", features = ["extension-module"] }
perpetual_rs = {package="perpetual", version = "0.7.6", path = "../" }
perpetual_rs = {package="perpetual", version = "0.7.7", path = "../" }
numpy = "0.22.1"
ndarray = "0.16.1"
serde_plain = { version = "1.0" }
Expand Down
2 changes: 1 addition & 1 deletion python-package/examples/openml.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"source": [
"from perpetual.utils import convert_input_frame\n",
"\n",
"features_, df_flat, rows, cols, categorical_features_, cat_mapping = convert_input_frame(df, \"auto\")\n",
"features_, df_flat, rows, cols, categorical_features_, cat_mapping = convert_input_frame(df, \"auto\", 1000)\n",
"\n",
"pd.Series(df_flat).to_csv(\"../../resources/christine_flat.csv\", index=False, header=False)\n",
"pd.Series(y).to_csv(\"../../resources/christine_y.csv\", index=False, header=False)"
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.7.6"
version = "0.7.7"
description = "A self-generalizing gradient boosting machine which doesn't need hyperparameter optimization"
license = { file = "LICENSE" }
keywords = [
Expand Down
4 changes: 2 additions & 2 deletions python-package/python/perpetual/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ def convert_input_array(x, objective) -> np.ndarray:

if type(x).__module__.split(".")[0] == "numpy":
if len(x.shape) == 2:
classes_, x_, *_ = convert_input_frame(x, None)
classes_, x_, *_ = convert_input_frame(x, None, 1000)
else:
x_ = x
elif type_series(x) == "pandas_series":
x_ = x.to_numpy()
elif type_series(x) == "polars_series":
x_ = x.to_numpy(allow_copy=False)
elif type_df(x) == "polars_df" or type_df(x) == "pandas_df":
classes_, x_, *_ = convert_input_frame(x, None)
classes_, x_, *_ = convert_input_frame(x, None, 1000)
else:
x_ = x.to_numpy()

Expand Down

0 comments on commit 2104641

Please sign in to comment.