Apache PredictionIO Java SDK: Client

The Apache PredictionIO Java SDK includes an API client and sample code.

Лицензия

Лицензия

Категории

Категории

Java Языки программирования CLI Взаимодействие с пользователем
Группа

Группа

org.apache.predictionio
Идентификатор

Идентификатор

predictionio-sdk-java-client
Последняя версия

Последняя версия

0.13.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

Apache PredictionIO Java SDK: Client
The Apache PredictionIO Java SDK includes an API client and sample code.
Организация-разработчик

Организация-разработчик

The Apache Software Foundation

Скачать predictionio-sdk-java-client

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.apache.predictionio/predictionio-sdk-java-client/ -->
<dependency>
    <groupId>org.apache.predictionio</groupId>
    <artifactId>predictionio-sdk-java-client</artifactId>
    <version>0.13.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.apache.predictionio/predictionio-sdk-java-client/
implementation 'org.apache.predictionio:predictionio-sdk-java-client:0.13.0'
// https://jarcasting.com/artifacts/org.apache.predictionio/predictionio-sdk-java-client/
implementation ("org.apache.predictionio:predictionio-sdk-java-client:0.13.0")
'org.apache.predictionio:predictionio-sdk-java-client:jar:0.13.0'
<dependency org="org.apache.predictionio" name="predictionio-sdk-java-client" rev="0.13.0">
  <artifact name="predictionio-sdk-java-client" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.apache.predictionio', module='predictionio-sdk-java-client', version='0.13.0')
)
libraryDependencies += "org.apache.predictionio" % "predictionio-sdk-java-client" % "0.13.0"
[org.apache.predictionio/predictionio-sdk-java-client "0.13.0"]

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
com.ning : async-http-client jar 1.9.33
com.google.code.gson : gson jar 2.2.4
joda-time : joda-time jar 2.3
com.google.guava : guava jar 18.0

test (3)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.11
com.github.tomakehurst : wiremock jar 1.48
org.hamcrest : hamcrest-all jar 1.3

Модули Проекта

Данный проект не имеет модулей.

Apache PredictionIO Java SDK

This bulk of this README is divided into two sections: Using the SDK and developing the SDK. Choose the one the suits you. For support please see the bottom of this README.

Using the SDK

With Maven

If you have a Maven project, simply add the dependency to your pom.xml.

<project ...>
    ...
    <dependencies>
        <dependency>
            <groupId>org.apache.predictionio</groupId>
            <artifactId>predictionio-sdk-java-client</artifactId>
            <version>0.13.0</version>
        </dependency>
    </dependencies>
    ...

With Ivy

If you use Ivy, simply add the dependency to your ivy.xml.

<ivy-module ...>
    ...
    <dependencies>
        <dependency org="org.apache.predictionio" name="predictionio-sdk-java-client" rev="0.13.0" />
        ...
    </dependencies>
    ...

With sbt

If you have an sbt project, add the library dependency to your build definition.

libraryDependencies += "org.apache.predictionio" % "predictionio-sdk-java-client" % "0.13.0"

Examples

Please check out the examples under examples/.

Developing SDK - Building from Source

Fork and clone from GitHub. The following assumes you are cloning to your home directory.

cd ~
git clone https://github.com/<your_github_handle>/predictionio-sdk-java.git

To build this SDK you will need Maven 3+. Run the following to publish the module to your local Maven repository.

cd ~/predictionio-sdk-java
mvn clean install

Run the following to generate API documentation.

mvn javadoc:javadoc

Running CLI Examples

Building

If your PredictionIO server is not at localhost, edit the source and replace API URLs with your redictionIO server host.

To build these examples you will need Maven 3+. Run the following in each example's directory, e.g.

cd ~/predictionio-sdk-java/examples/quickstart_import
mvn clean compile assembly:single
cd ~/predictionio-sdk-java/examples/import
mvn clean compile assembly:single

These will create JAR files with all dependencies built in.

Try It Now

For running the quick start example (quickstart_import), please refer to the "Quick Start" page of the PredictionIO documentation. Most importantly, create an App with pio new app MyApp and take note of the Access Key produced, which will be <your accessKey here> in the following.

For quickstart_import,

cd ~/predictionio-sdk-java/examples/quickstart_import
java -jar target/quickstart-import-<latest version>-jar-with-dependencies.jar <your accessKey here>

To check the data has been imported successfully, run

curl -i -X GET http://localhost:7070/events.json?accessKey=<your accessKey here>

To import the provided small sample data for the import example using asynchronous calls:

cd ~/predictionio-sdk-java/examples/import
java -jar target/sample-import-<latest version>-jar-with-dependencies.jar <your accessKey here> sampledata/sample1.txt

To check the data is imported properly, run

curl -i -X GET http://localhost:7070/events.json?accessKey=<your accessKey here>

Enjoy!

Support

Bugs and Feature Requests

Use Apache JIRA to report bugs or request new features.

Community

Keep track of development and community news.

Contributing

Read the Contribute Code page.

License

Apache PredictionIO is under Apache 2 license.

org.apache.predictionio

The Apache Software Foundation

Версии библиотеки

Версия
0.13.0