Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asafschers/scorystal
Crystal Scoring API for PMML
https://github.com/asafschers/scorystal
crystal gbm gradient-boosting-classifier machine-learning pmml random-forest
Last synced: about 1 month ago
JSON representation
Crystal Scoring API for PMML
- Host: GitHub
- URL: https://github.com/asafschers/scorystal
- Owner: asafschers
- License: mit
- Created: 2017-04-27T21:12:42.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-14T20:53:10.000Z (over 7 years ago)
- Last Synced: 2024-08-03T17:14:38.367Z (4 months ago)
- Topics: crystal, gbm, gradient-boosting-classifier, machine-learning, pmml, random-forest
- Language: Crystal
- Size: 149 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-crystal - scorystal - Scoring API for PMML - supports RF and GBM (Science and Data analysis)
README
[![Build Status](https://travis-ci.org/asafschers/scorystal.svg?branch=master)](https://travis-ci.org/asafschers/scorystal)
# Scorystal
Crystal scoring API for Predictive Model Markup Language (PMML).
Currently supports random forest and gradient boosted models.
Will be happy to implement new kinds of models by demand, or assist with any other issue.
Contact me here or at [email protected].
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
scorystal:
github: asafschers/scorystal
```## Usage
```crystal
require "scorystal"# Parse PMML file
pmml_text = File.read("spec/pmmls/gbm.pmml")
parsed_pmml = XML.parse(pmml_text, XML::ParserOptions::NOBLANKS)# Set features hash
json = %({"F1":null,"F2":21371,"F3":"AA"}")
features = Scorystal.features_hash(json)# Gradient Boosted Model
gbm = Gbm.new(parsed_pmml)
puts gbm.score(features)# Random Forest
rf = RandomForest.new(parsed_pmml)
puts rf.decisions_count(features)```
## Contributing
1. Fork it ( https://github.com/asafschers/scorystal/fork )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request## Contributors
- [[asafschers]](https://github.com/asafschers) asaf schers - creator, maintainer