object
jaccard_recommender
Content-based recommender using binary item features, support-filtered positive-feedback profiles, and Jaccard relevance scores.
logtalk_load(jaccard_recommender(loader))static, context_switching_callsPublic predicates
score_all/4
Scores catalog items in input order, preserving duplicates and validating the model once. An empty list returns an empty list after validating the model and user.
staticscore_all(Recommender,User,Items,Scores)score_all(+compound,+atomic,+list(atomic),-list(pair)) - one_or_errorinstantiation_errordomain_error(recommender,Recommender)type_error(atomic,Identifier)type_error(list,Items)domain_error(catalog_item,Item)score_content/4
Scores supplied binary content against a learned user profile without changing the model or catalog. Either descriptor kind is accepted regardless of the training representation.
staticscore_content(Recommender,User,Content,Score)score_content(+compound,+atomic,+compound,-float) - one_or_errorinstantiation_errordomain_error(recommender,Recommender)type_error(atomic,User)domain_error(item_content,Content)type_error(list,List)type_error(pair,Entry)domain_error(duplicate_feature,Feature)type_error(number,Weight)domain_error(non_negative_finite_weight,Weight)domain_error(binary_weight,Weight)extend_catalog/3
Returns a model with additional unrated items of the existing content representation, preserving ratings and profiles. An empty extension returns the validated original model.
staticextend_catalog(Recommender,ItemContents,UpdatedRecommender)extend_catalog(+compound,+list(pair),-compound) - one_or_errorinstantiation_errordomain_error(recommender,Recommender)type_error(list,List)type_error(pair,Entry)type_error(atomic,Item)domain_error(new_catalog_item,Item)domain_error(duplicate_item,Item)domain_error(item_content,Content)domain_error(content_representation,Content)domain_error(duplicate_feature,Feature)type_error(number,Weight)domain_error(non_negative_finite_weight,Weight)domain_error(binary_weight,Weight)replace_content/3
Returns a model with replaced catalog content and rebuilt profiles. An empty replacement returns the validated original model.
staticreplace_content(Recommender,ItemContents,UpdatedRecommender)replace_content(+compound,+list(pair),-compound) - one_or_errorinstantiation_errordomain_error(recommender,Recommender)type_error(list,List)type_error(pair,Entry)type_error(atomic,Item)domain_error(catalog_item,Item)domain_error(duplicate_item,Item)domain_error(item_content,Content)domain_error(content_representation,Content)domain_error(duplicate_feature,Feature)type_error(number,Weight)domain_error(non_negative_finite_weight,Weight)domain_error(binary_weight,Weight)update_ratings/3
Returns a model with inserted or replaced user-item ratings and rebuilt profiles, accepting new users but requiring catalog items. An empty update returns the validated original model.
staticupdate_ratings(Recommender,Ratings,UpdatedRecommender)update_ratings(+compound,+list(compound),-compound) - one_or_errorinstantiation_errordomain_error(recommender,Recommender)type_error(list,Ratings)type_error(rating,Entry)type_error(atomic,Identifier)type_error(number,Rating)domain_error(finite_rating,Rating)domain_error(rating_scale(Min,Max),Rating)domain_error(catalog_item,Item)domain_error(duplicate_rating,User-Item)remove_ratings/3
Returns a model with requested user-item ratings removed and profiles rebuilt. Missing and repeated pairs are accepted; no matching ratings returns the validated original model.
staticremove_ratings(Recommender,UserItemPairs,UpdatedRecommender)remove_ratings(+compound,+list(pair),-compound) - one_or_errorinstantiation_errordomain_error(recommender,Recommender)type_error(list,UserItemPairs)type_error(pair,Entry)type_error(atomic,Identifier)domain_error(non_empty_ratings,[])Protected predicates
(no local declarations; see entity ancestors if any)
Private predicates
rating_removal_records/3
Validates user-item pairs and collects matching stored ratings, ignoring missing pairs.
staticrating_removal_records(UserItemPairs,Ratings,Removals)rating_removal_records(+list(pair),+list(compound),-list(compound)) - one_or_errorinstantiation_errortype_error(pair,Entry)type_error(atomic,Identifier)check_rating_updates/3
Checks rating records against the catalog and stored rating scale.
staticcheck_rating_updates(Ratings,Vectors,Scale)check_rating_updates(+list(compound),+list(pair),+term) - one_or_errorinstantiation_errortype_error(rating,Entry)type_error(atomic,Identifier)type_error(number,Rating)domain_error(finite_rating,Rating)domain_error(rating_scale(Min,Max),Rating)domain_error(catalog_item,Item)check_catalog_replacements/2
Checks that replacement declarations are pairs with atomic catalog identifiers.
staticcheck_catalog_replacements(ItemContents,Vectors)check_catalog_replacements(+list(pair),+list(pair)) - one_or_errorinstantiation_errortype_error(pair,Entry)type_error(atomic,Item)domain_error(catalog_item,Item)check_catalog_additions/2
Checks that content declarations are pairs with atomic identifiers absent from the existing catalog.
staticcheck_catalog_additions(ItemContents,Vectors)check_catalog_additions(+list(pair),+list(pair)) - one_or_errorinstantiation_errortype_error(pair,Entry)type_error(atomic,Item)domain_error(new_catalog_item,Item)catalog_score/5
Scores an instantiated catalog identifier using validated model data.
staticcatalog_score(Vectors,Profiles,User,Item,Score)catalog_score(+list(pair),+list(pair),+atomic,+atomic,-float) - one_or_errordomain_error(catalog_item,Item)score_catalog_items/5
Validates and scores catalog identifiers in order using validated model data.
staticscore_catalog_items(Vectors,Profiles,User,Items,Scores)score_catalog_items(+list(pair),+list(pair),+atomic,+list(atomic),-list(pair)) - one_or_errorinstantiation_errortype_error(atomic,Item)domain_error(catalog_item,Item)binary_contents/2
Converts canonical descriptors into sorted binary feature vectors, ignoring feature multiplicity.
staticbinary_contents(Contents,Vectors)binary_contents(+list(pair),-list(pair)) - one_or_errordomain_error(binary_weight,Weight)binary_descriptor/2
Converts a canonical descriptor to a binary feature vector.
staticbinary_descriptor(Content,Vector)binary_descriptor(+compound,-list(pair)) - one_or_errordomain_error(binary_weight,Weight)binary_pairs/2
Checks that nonzero canonical weights are one and replaces them with integer unit weights.
staticbinary_pairs(Pairs,Vector)binary_pairs(+list(pair),-list(pair)) - one_or_errordomain_error(binary_weight,Weight)check_finite_ratings/1
Checks that rating values are finite.
staticcheck_finite_ratings(Ratings)check_finite_ratings(+list(compound)) - one_or_errordomain_error(finite_rating,Rating)Operators
(none)