Skip to content

Commit

Permalink
fix hpf
Browse files Browse the repository at this point in the history
  • Loading branch information
mdekstrand committed Jan 11, 2025
1 parent d7316c9 commit 09e05f7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lenskit-hpf/lenskit/hpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import hpfrec
import numpy as np
from pydantic import BaseModel
from pydantic import BaseModel, JsonValue
from typing_extensions import override

from lenskit.data import Dataset, ItemList, QueryInput, RecQuery, Vocabulary
Expand All @@ -18,6 +18,7 @@


class HPFConfig(BaseModel, extra="allow"):
__pydantic_extra__: dict[str, JsonValue]
features: int = 50


Expand Down Expand Up @@ -61,9 +62,9 @@ def train(self, data: Dataset):
}
)

hpf = hpfrec.HPF(self.config.features, reindex=False, **self.config.__pydantic_extra__)
hpf = hpfrec.HPF(self.config.features, reindex=False, **self.config.__pydantic_extra__) # type: ignore

_logger.info("fitting HPF model with %d features", self.features)
_logger.info("fitting HPF model with %d features", self.config.features)
hpf.fit(log)

self.users_ = data.users
Expand Down

0 comments on commit 09e05f7

Please sign in to comment.