Add method to check if item already has been added.
This commit is contained in:
@@ -47,6 +47,10 @@ impl BinaryModel {
|
||||
);
|
||||
}
|
||||
|
||||
pub fn contains_item(&self, name: &str) -> bool {
|
||||
self.storage.contains_key(name)
|
||||
}
|
||||
|
||||
pub fn item_score(&self, name: &str, t: f64) -> (f64, f64) {
|
||||
let id = self.storage.get_id(name);
|
||||
let (ms, vs) = self.storage.item(id).fitter.predict(&[t]);
|
||||
|
||||
Reference in New Issue
Block a user