Skip to content

Commit

Permalink
enh: expose n clusters
Browse files Browse the repository at this point in the history
  • Loading branch information
maffettone committed Apr 12, 2024
1 parent 0740ef7 commit 66a4770
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pdf_agents/sklearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,17 @@ def close_and_restart(self, *, clear_tell_cache=False, retell_all=False, reason=
self.clear_caches()
return super().close_and_restart(clear_tell_cache=clear_tell_cache, retell_all=retell_all, reason=reason)

@property
def n_clusters(self):
return self.model.n_clusters

@n_clusters.setter
def n_clusters(self, value):
self.model.set_params(n_clusters=int(value))

def server_registrations(self) -> None:
self._register_method("clear_caches")
self._register_property("n_clusters")
return super().server_registrations()

def tell(self, x, y):
Expand Down

0 comments on commit 66a4770

Please sign in to comment.