Closed Proteusiq closed 1 month ago
Ah, that should indeed be changed. No comments here, LGTM!
I'm not sure if the online docs have been re-rendered since this branch was merged, but the definition of the River
class in the river section for Online Topic Modelling still has the incorrect assignment syntax for self.model.learn_one(umap_embedding)
, i.e.:
from river import stream
from river import cluster
class River:
def __init__(self, model):
self.model = model
def partial_fit(self, umap_embeddings):
for umap_embedding, _ in stream.iter_array(umap_embeddings):
self.model = self.model.learn_one(umap_embedding)
labels = []
for umap_embedding, _ in stream.iter_array(umap_embeddings):
label = self.model.predict_one(umap_embedding)
labels.append(label)
self.labels_ = labels
return self
@hamedbh Ah right, I forgot to update that documentation. I just did and it should now be correct.
@MaartenGr that's great, thank you!
removed the assignment as it would self.model to None. self.model.predict_one returns None. Just like dictionary update. So assignment kill the object.