PredictionIO SDK alternatives and similar libraries
Based on the "API" category.
Alternatively, view PredictionIO SDK alternatives based on common mentions on social networks and blogs.
-
Typhoon
Powerful dependency injection for Objective-C ✨✨ (https://PILGRIM.PH is the pure Swift successor to Typhoon!!)✨✨ -
Dip
Simple Swift Dependency container. Use protocols to resolve your dependencies and avoid singletons / sharedInstances! -
Telegram Vapor Bot (SDK for creating Telegram Bots in Swift)
🤖 The wrapper for the Telegram Bot API written in Swift. It's not a framework. There is no special syntax here. This is a library that implements all Telegram Bot API methods, which is available to you to work with Vapor, Smoke, Hummingbird, FlyingFox. -
Federal Data SDK
DISCONTINUED. Federal Data SDK built in the Swift programming language. Follow the link for the documentation: -
Kraken
Simple Dependency Injection container for Swift. Use protocols to resolve dependencies with easy-to-use syntax! -
PPWeatherCheck
Incorporate with CoreLocation, Cocoapods, REST APIs, Alamofire, JSON, and UI Animation to Create a Weather Check Application.
InfluxDB - Purpose built for real-time analytics at any scale.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of PredictionIO SDK or a related project?
README
PredictionIO Swift SDK
The Swift SDK provides a convenient API for your iOS and macOS application to record your users' behaviors in the PredictionIO event server and retrieve predictions from PredictionIO engines.
Requirements
- iOS 10+ or macOS 10.10+
- Xcode 11+
- Swift 5+
- PredictionIO 0.12.0+
Installation
Cocoapods
Install CocoaPods, the dependency manager for Cocoa project.
$ gem install cocoapods
To integrate PredictionIO, add the following lines to your Podfile
.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target '<Your target name>' do
pod 'PredictionIO', '~> 3.0'
end
Then run the following command.
$ pod install
Finally, import the SDK in your Swift files before using.
import PredictionIO
Usage
EngineClient
Use EngineClient
to query predictions from the PredictionIO Engines.
// Response format of a Recommendation engine.
struct RecommendationResponse: Decodable {
struct ItemScore: Decodable {
let item: String
let score: Double
}
let itemScores: [ItemScore]
}
let engineClient = EngineClient(baseURL: "http://localhost:8000")
let query = [
"user": "1",
"num": 2
]
engineClient.sendQuery(query, responseType: RecommendationResponse.self) { result in
guard let response = result.value else { return }
print(response.itemScores)
}
EventClient
Use EventClient
to send information to the PredictionIO Event Server.
let eventClient = EventClient(accessKey: "Access key of the app", baseURL: "http://localhost:7070")
let event = Event(
event: "rate",
entityType: "user",
entityID: "1",
targetEntity: (type: "item", id: "9"),
properties: [
"rating": 5
]
)
eventClient.createEvent(event) { result in
guard let response = result.value else { return }
print(response.eventID)
}
There are other convenience methods to manage User and Item entity types. Please see the API documentation for more details.
Documentation
The documentation is generated by jazzy. To build the documentation, run
$ jazzy
The latest API documentation is available at http://minhtule.github.io/PredictionIO-Swift-SDK/index.html.
iOS Demo App
Please follow this quick guide to start the Event Server and set up a Recommendation Engine on your local machine first.
You also need to:
- Include your app's access key in
RatingViewController.swift
. - Import some data using the python script as instructed in step 4. Alternatively, you can use the demo app to record new rating events; however, remember to re-train and deploy the engine before querying for recommendations.
- Run the simulator!
There are 2 screens in the demo app:
- Rating: corresponding to step 4. Collecting Data in the quick guide.
- Recommendation: corresponding to step 6. Use the Engine in the quick guide.
Tapster iOS Demo
Also check out Tapster iOS, a recommender for comics, to see a more extensive intergration of the SDK.
License
PredictionIO Swift SDK is released under the Apache License 2.0. Please see LICENSE for details.
*Note that all licence references and agreements mentioned in the PredictionIO SDK README section above
are relevant to that project's source code only.