在信息爆炸的时代,如何从海量信息中找到我们真正需要的内容,成为了一个重要问题。JStarCraft RNS 应运而生,它是一款专注于解决推荐领域与搜索领域的两个核心问题:排序预测(Ranking)和评分预测(Rating)的Java推荐与搜索引擎。它为相关领域的研发人员提供完整的通用设计与参考实现,涵盖了70多种排序预测与评分预测算法,是目前最快速、最全面的Java推荐与搜索引擎之一。
友情链接:ACEJoy
JStarCraft RNS 的核心优势
JStarCraft RNS 拥有以下几个核心优势:
- 跨平台: 支持多种操作系统,方便用户在不同环境下使用。
- 串行与并行计算: 灵活适应不同场景,提高计算效率。
- CPU与GPU硬件加速: 充分利用硬件资源,提升性能。
- 模型保存与装载: 方便用户保存和复用训练好的模型。
- 丰富的推荐与搜索算法: 提供了多种排序和评分算法,满足不同需求。
- 丰富的脚本支持: 支持多种脚本语言,例如 Groovy、JS、Lua、MVEL、Python 和 Ruby,方便用户定制化开发。
- 丰富的评估指标: 提供了多种排序和评分指标,帮助用户评估模型性能。
JStarCraft RNS 的安装与使用
JStarCraft RNS 要求使用者具备以下环境:
- JDK 8 或者以上
- Maven 3
安装步骤:
- 安装 JStarCraft-Core 框架:
git clone https://github.com/HongZhaoHua/jstarcraft-core.git
mvn install -Dmaven.test.skip=true
- 安装 JStarCraft-AI 框架:
git clone https://github.com/HongZhaoHua/jstarcraft-ai.git
mvn install -Dmaven.test.skip=true
- 安装 JStarCraft-RNS 引擎:
git clone https://github.com/HongZhaoHua/jstarcraft-rns.git
mvn install -Dmaven.test.skip=true
使用步骤:
- 设置依赖: 在您的项目中添加 JStarCraft RNS 的 Maven 或 Gradle 依赖。
- 构建配置器: 使用
Configurator
类加载配置文件,配置模型训练和评估参数。 - 训练与评估模型: 使用
RankingTask
或RatingTask
类训练和评估模型,并获取模型评估指标。 - 获取模型: 使用
task.getModel()
方法获取训练好的模型。
JStarCraft RNS 的架构与概念
JStarCraft RNS 的核心概念包括:
- 信息检索: 由于信息过载,信息检索的任务就是联系用户和信息,帮助用户找到对自己有价值的信息,并帮助信息暴露给对它感兴趣的用户。
- 搜索与推荐: 搜索是主动明确的,推荐是被动模糊的。两者是互补的工具。
- 排序预测(Ranking)与评分预测(Rating): Ranking 算法基于隐式反馈数据,关注用户的排序偏好;Rating 算法基于显示反馈数据,关注用户的评分满意度。
JStarCraft RNS 的示例
JStarCraft RNS 支持多种脚本语言,例如 BeanShell、Groovy、JS、Kotlin、Lua、Python 和 Ruby。用户可以使用这些脚本语言定制化开发模型训练和评估流程。
例如,以下代码展示了如何使用 BeanShell 脚本训练和评估模型:
// 构建配置
keyValues = new Properties();
keyValues.load(loader.getResourceAsStream("data.properties"));
keyValues.load(loader.getResourceAsStream("model/benchmark/randomguess-test.properties"));
configurator = new Configurator(keyValues);
// 此对象会返回给Java程序
_data = new HashMap();
// 构建排序任务
task = new RankingTask(RandomGuessModel.class, configurator);
// 训练与评估模型并获取排序指标
measures = task.execute();
_data.put("precision", measures.get(PrecisionEvaluator.class));
_data.put("recall", measures.get(RecallEvaluator.class));
// 构建评分任务
task = new RatingTask(RandomGuessModel.class, configurator);
// 训练与评估模型并获取评分指标
measures = task.execute();
_data.put("mae", measures.get(MAEEvaluator.class));
_data.put("mse", measures.get(MSEEvaluator.class));
_data;
JStarCraft RNS 的对比
JStarCraft RNS 提供了丰富的排序和评分算法,用户可以根据自己的需求选择合适的算法。它还提供了一系列评估指标,帮助用户评估模型性能。
例如,以下表格展示了 JStarCraft RNS 中提供的部分排序算法和评分算法的对比:
算法名称 | 问题 | 说明/论文 |
---|---|---|
RandomGuess | Ranking Rating | 随机猜测 |
MostPopular | Ranking | 最受欢迎 |
ConstantGuess | Rating | 常量猜测 |
GlobalAverage | Rating | 全局平均 |
ItemAverage | Rating | 物品平均 |
ItemCluster | Rating | 物品聚类 |
UserAverage | Rating | 用户平均 |
UserCluster | Rating | 用户聚类 |
AoBPR | Ranking | Improving pairwise learning for item recommendation from implicit feedback |
BPR | Ranking | BPR: Bayesian Personalized Ranking from Implicit Feedback |
CLiMF | Ranking | CLiMF: learning to maximize reciprocal rank with collaborative less-is-more filtering |
EALS | Ranking | Collaborative filtering for implicit feedback dataset |
FISM | Ranking | FISM: Factored Item Similarity Models for Top-N Recommender Systems |
GBPR | Ranking | GBPR: Group Preference Based Bayesian Personalized Ranking for One-Class Collaborative Filtering |
HMMForCF | Ranking | A Hidden Markov Model Purpose: A class for the model, including parameters |
ItemBigram | Ranking | Topic Modeling: Beyond Bag-of-Words |
LambdaFM | Ranking | LambdaFM: Learning Optimal Ranking with Factorization Machines Using Lambda Surrogates |
LDA | Ranking | Latent Dirichlet Allocation for implicit feedback |
ListwiseMF | Ranking | List-wise learning to rank with matrix factorization for collaborative filtering |
PLSA | Ranking | Latent semantic models for collaborative filtering |
RankALS | Ranking | Alternating Least Squares for Personalized Ranking |
RankSGD | Ranking | Collaborative Filtering Ensemble for Ranking |
SLIM | Ranking | SLIM: Sparse Linear Methods for Top-N Recommender Systems |
WBPR | Ranking | Bayesian Personalized Ranking for Non-Uniformly Sampled Items |
WRMF | Ranking | Collaborative filtering for implicit feedback datasets |
Rank-GeoFM | Ranking | Rank-GeoFM: A ranking based geographical factorization method for point of interest recommendation |
SBPR | Ranking | Leveraging Social Connections to Improve Personalized Ranking for Collaborative Filtering |
AssociationRule | Ranking | A Recommendation Algorithm Using Multi-Level Association Rules |
PRankD | Ranking | Personalised ranking with diversity |
AsymmetricSVD++ | Rating | Factorization Meets the Neighborhood: a Multifaceted Collaborative Filtering Model |
AutoRec | Rating | AutoRec: Autoencoders Meet Collaborative Filtering |
BPMF | Rating | Bayesian Probabilistic Matrix Factorization using Markov Chain Monte Carlo |
CCD | Rating | Large-Scale Parallel Collaborative Filtering for the Netflix Prize |
FFM | Rating | Field Aware Factorization Machines for CTR Prediction |
GPLSA | Rating | Collaborative Filtering via Gaussian Probabilistic Latent Semantic Analysis |
IRRG | Rating | Exploiting Implicit Item Relationships for Recommender Systems |
MFALS | Rating | Large-Scale Parallel Collaborative Filtering for the Netflix Prize |
NMF | Rating | Algorithms for Non-negative Matrix Factorization |
PMF | Rating | PMF: Probabilistic Matrix Factorization |
RBM | Rating | Restricted Boltzman Machines for Collaborative Filtering |
RF-Rec | Rating | RF-Rec: Fast and Accurate Computation of Recommendations based on Rating Frequencies |
SVD++ | Rating | Factorization Meets the Neighborhood: a Multifaceted Collaborative Filtering Model |
URP | Rating | User Rating Profile: a LDA model for rating prediction |
RSTE | Rating | Learning to Recommend with Social Trust Ensemble |
SocialMF | Rating | A matrix factorization technique with trust propagation for recommendation in social networks |
SoRec | Rating | SoRec: Social recommendation using probabilistic matrix factorization |
SoReg | Rating | Recommender systems with social regularization |
TimeSVD++ | Rating | Collaborative Filtering with Temporal Dynamics |
TrustMF | Rating | Social Collaborative Filtering by Trust |
TrustSVD | Rating | TrustSVD: Collaborative Filtering with Both the Explicit and Implicit Influence of User Trust and of Item Ratings |
PersonalityDiagnosis | Rating | A brief introduction to Personality Diagnosis |
SlopeOne | Rating | Slope One Predictors for Online Rating-Based Collaborative Filtering |
EFM | Ranking Rating | Explicit factor models for explainable recommendation based on phrase-level sentiment analysis |
TF-IDF | Ranking | 词频-逆文档频率 |
HFT | Rating | Hidden factors and hidden topics: understanding rating dimensions with review text |
TopicMF | Rating | TopicMF: Simultaneously Exploiting Ratings and Reviews for Recommendation |
总结
JStarCraft RNS 是一款功能强大、易于使用、性能优异的 Java 推荐与搜索引擎。它为相关领域的研发人员提供了全面的通用设计与参考实现,是构建推荐与搜索系统不可或缺的工具。
参考文献: