object
tfidf_recommender
Content-based recommender using TF-IDF item vectors, positive-feedback centroid profiles, and cosine relevance scores.
logtalk_load(tfidf_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 batch validates 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 content of the trained representation without changing the model. Features use the fitted vocabulary and weighting; vectors use the stored normalization.
staticscore_content(Recommender,User,Content,Score)score_content(+compound,+atomic,+compound,-number) - one_or_errorinstantiation_errordomain_error(recommender,Recommender)type_error(atomic,User)domain_error(item_content,Content)domain_error(content_representation,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)update_ratings/3
Returns a model with inserted or replaced 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)domain_error(positive_rating_weight,Rating)remove_ratings/3
Returns a model with requested 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,[])domain_error(positive_rating_weight,Rating)extend_catalog/3
Returns a model with new catalog items, refitting the full feature corpus and rebuilding 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(non_empty_vocabulary,Corpus)domain_error(option,Option)domain_error(positive_rating_weight,Rating)replace_content/3
Returns a model with replaced catalog content, refitting the full feature corpus and rebuilding 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(non_empty_vocabulary,Corpus)domain_error(option,Option)domain_error(positive_rating_weight,Rating)Protected predicates
(no local declarations; see entity ancestors if any)
Private predicates
check_content_kind/3
Checks that supplied content matches the stored representation.
staticcheck_content_kind(Kind,Content,Diagnostics)check_content_kind(+atom,+compound,+list(compound)) - one_or_errordomain_error(content_representation,Content)check_catalog_replacements/2
Checks that replacement declarations have atomic catalog identifiers.
staticcheck_catalog_replacements(ItemContents,Contents)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 have atomic identifiers absent from the catalog.
staticcheck_catalog_additions(ItemContents,Contents)check_catalog_additions(+list(pair),+list(pair)) - one_or_errorinstantiation_errortype_error(pair,Entry)type_error(atomic,Item)domain_error(new_catalog_item,Item)rebuild_catalog_model/5
Rebuilds the full catalog fitted state, profiles, and diagnostics using the stored options.
staticrebuild_catalog_model(Ratings,Contents,Scale,Diagnostics,UpdatedRecommender)rebuild_catalog_model(+list(compound),+list(pair),+term,+list(compound),-compound) - one_or_errordomain_error(non_empty_vocabulary,Corpus)domain_error(option,Option)domain_error(option,vectorizer_options(Options))domain_error(positive_rating_weight,Rating)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)rebuild_feedback_model/7
Rebuilds profiles and diagnostics while retaining the fitted catalog state.
staticrebuild_feedback_model(Ratings,Contents,Vectors,Vectorizer,Scale,Diagnostics,UpdatedRecommender)rebuild_feedback_model(+list(compound),+list(pair),+list(pair),+term,+term,+list(compound),-compound) - one_or_errordomain_error(positive_rating_weight,Rating)catalog_score/5
Scores a catalog identifier using validated model data.
staticcatalog_score(Vectors,Profiles,User,Item,Score)catalog_score(+list(pair),+list(pair),+atomic,+atomic,-number) - one_or_errordomain_error(catalog_item,Item)score_catalog_items/5
Validates and scores catalog identifiers in input 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)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)build_vectors/5
Fits catalog feature vectors or normalizes supplied vectors using the effective options.
staticbuild_vectors(Kind,Contents,Options,Vectorizer,Vectors)build_vectors(+atom,+list(pair),+list(compound),-term,-list(pair)) - one_or_errordomain_error(non_empty_vocabulary,Corpus)domain_error(option,Option)domain_error(option,vectorizer_options(Options))profile_weights/3
Assigns uniform or strictly positive raw-rating weights to selected item vectors.
staticprofile_weights(Selected,Weighting,Weighted)profile_weights(+list(pair),+atom,-list(pair)) - one_or_errordomain_error(positive_rating_weight,Rating)Operators
(none)