Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sphinx Docstring Update - Nearest Centroid #782

Merged
merged 4 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions verticapy/machine_learning/memmodel/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def __init__(
clusters_names: Optional[ArrayLike] = None,
) -> None:
clusters_names = format_type(clusters_names, dtype=list)
self.clusters_ = np.array(clusters)
self.clusters_ = np.array(clusters).astype(float)
self.classes_ = np.array(clusters_names)
self.p_ = p

Expand Down Expand Up @@ -380,7 +380,7 @@ def object_type(self) -> Literal["KMeans"]:
# System & Special Methods.

def __init__(self, clusters: ArrayLike, p: int = 2) -> None:
self.clusters_ = np.array(clusters)
self.clusters_ = np.array(clusters).astype(float)
self.p_ = p


Expand Down Expand Up @@ -518,7 +518,7 @@ def __init__(
classes: ArrayLike,
p: int = 2,
) -> None:
self.clusters_ = np.array(clusters)
self.clusters_ = np.array(clusters).astype(float)
self.classes_ = np.array(classes)
self.p_ = p

Expand Down Expand Up @@ -720,7 +720,7 @@ def __init__(
cluster_size, cluster_score = format_type(
cluster_size, cluster_score, dtype=list
)
self.clusters_ = np.array(clusters)
self.clusters_ = np.array(clusters).astype(float)
self.children_left_ = np.array(children_left)
self.children_right_ = np.array(children_right)
self.cluster_size_ = np.array(cluster_size)
Expand Down
2 changes: 1 addition & 1 deletion verticapy/machine_learning/metrics/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def _compute_final_score(
"Parameter 'pos_label' can only be used when parameter 'average' is set to 'binary' or undefined."
)
if not (isinstance(pos_label, NoneType)) and not (isinstance(labels, NoneType)):
raise ValueError("Parameters 'pos_label' and 'labels' can not be both defined.")
labels = None
if (
isinstance(pos_label, NoneType)
and isinstance(labels, NoneType)
Expand Down
2 changes: 1 addition & 1 deletion verticapy/machine_learning/vertica/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2215,7 +2215,7 @@ def score(
kwargs = {}
if metric not in ("aic", "bic"):
labels = None
if isinstance(pos_label, NoneType):
if isinstance(pos_label, NoneType) or not (self._is_native):
labels = self.classes_
kwargs = {
"average": average,
Expand Down
Loading