bratao/prediction-io

Laravel PredictionIO 客户端

1.0.6 2014-09-16 21:56 UTC

This package is not auto-updated.

Last update: 2024-09-24 01:49:09 UTC


README

基于endroid

Laravel PredictionIO 库提供了一个客户端,它提供了对 PredictionIO 推荐引擎的简单访问。PredictionIO 是一个开源的机器学习服务器,软件开发者可以使用它创建预测功能,如个性化、推荐和内容发现。

通过一组简单的调用,将所有服务器功能暴露给您的应用程序。您可以为用户和物品添加,在这些用户和物品之间注册动作,并通过任何PredictionIO 推荐引擎从这些信息中检索推荐。应用程序范围从在网店中显示推荐产品到发现社交协作网络中的相关专家。

安装

  • 安装库及其依赖项
$ composer require "bratao/prediction-io:1.*@dev"
  • app/config/app.php 中添加一个 provider
    'Bratao\PredictionIO\PredictionServiceProvider'
  • app/config/app.php 中添加一个 别名
    'Prediction'      => 'Bratao\PredictionIO\Facade',
	'predictionio' => array(
		'api' => 'https://:8000/',
		'key' => '0250b3f85ce33284f77c77f36b41010ef2c4fc5c',
	),

使用方法

<?php

// populate with users, items and actions
Prediction::createUser($userId);
Prediction::createItem($itemId);
Prediction::recordAction($userId, $itemId, 'view');

//Get a User or a Item
$item = Prediction::getUser($userId);
$user = Prediction::getItem($itemId);

//Delete a user or a item
Prediction::deleteUser($userId);
Prediction::deleteItem($itemId);

// get recommendations and similar items
$recommendations = Prediction::getRecommendations($userId, $engine, $count);
$similarItems = Prediction::getSimilarItems($itemId, $engine, $count);

许可协议

此软件包受 MIT 许可协议的约束。有关完整的版权和许可信息,请查看与源代码一起分发的 LICENSE 文件。

感谢

  • Braunson Yager
  • Laurent Goussard