Go Scoring API for PMML

Build Status Go Report Card Coverage Status GoDoc

Goscore

Go scoring API for Predictive Model Markup Language (PMML).

Currently supports Neural Network, Decision Tree, Random Forest and Gradient Boosted Models

Will be happy to implement new models by demand, or assist with any other issue.

Contact me here or at [email protected].

Tutorial - Deploy Machine Learning Models from R Research to Go Production with PMML

Installation

go get github.com/asafschers/goscore

Usage

Random Forest / Gradient Boosted Model

Generate PMML - R

Fetch model from PMML file -

modelXml, _ := ioutil.ReadFile("fixtures/model.pmml")
var model goscore.RandomForest // or goscore.GradientBoostedModel
xml.Unmarshal([]byte(modelXml), &model)

Set features -

features := map[string]interface{}{
  "Sex": "male",
  "Parch": 0,
  "Age": 30,
  "Fare": 9.6875,
  "Pclass": 2,
  "SibSp": 0,
  "Embarked": "Q",
}

Score features by model -

score, _ := model.Score(features, "1") // gbm.score doesn't recieve label

Score faster -

runtime.GOMAXPROCS(runtime.NumCPU()) // use all cores
score, _ := model.ScoreConcurrently(features, "1") // parallelize tree traversing  

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/asafschers/goscore. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Similar Resources

弹弹play 资源搜索节点 API 实现,基于 Cloudflare Workers 或 Golang 的两种实现。 || API implementations for "dandanplay" resource search service.

dandanplay-resource-service API implementations for "dandanplay" resource search service. 弹弹play 资源搜索节点的 API 实现。 提供基于 Cloudflare Workers 和 Golang 的两种实

Dec 5, 2022

Feishu/Lark Open API Go Sdk, Support ALL Open API and Event Callback.

lark 中文版 README Feishu/Lark Open API Go Sdk, Support ALL Open API and Event Callback. Created By Code Generation. Install go get github.com/chyroc/lar

Jan 5, 2023

Golang API wrapper for MangaDex v5's MVP API.

mangodex Golang API wrapper for MangaDex v5's MVP API. Full documentation is found here. This API is still in Open Beta, so testing may not be complet

Oct 23, 2022

Kubernetes OS Server - Kubernetes Extension API server exposing OS configuration like sysctl via Kubernetes API

KOSS is a Extension API Server which exposes OS properties and functionality using Kubernetes API, so it can be accessed using e.g. kubectl. At the moment this is highly experimental and only managing sysctl is supported. To make things actually usable, you must run KOSS binary as root on the machine you will be managing.

May 19, 2021

An API client for the Notion API implemented in Golang

An API client for the Notion API implemented in Golang

Dec 30, 2022

lambda-go-api-proxy makes it easy to port APIs written with Go frameworks such as Gin to AWS Lambda and Amazon API Gateway.

aws-lambda-go-api-proxy makes it easy to run Golang APIs written with frameworks such as Gin with AWS Lambda and Amazon API Gateway.

Jan 6, 2023

An API Client package for Studyplus for School SYNC API

Studyplus for School SYNC API Client This project is currently alpha, possibility having breaking changes. studyplus_for_school_sync_go is a API clien

Aug 2, 2021

A microservice gateway developed based on golang.With a variety of plug-ins which can be expanded by itself, plug and play. what's more,it can quickly help enterprises manage API services and improve the stability and security of API services.

A microservice gateway developed based on golang.With a variety of plug-ins which can be expanded by itself, plug and play. what's more,it can quickly help enterprises manage API services and improve the stability and security of API services.

Goku API gateway is a microservice gateway developed based on golang. It can achieve the purposes of high-performance HTTP API forwarding, multi tenant management, API access control, etc. it has a powerful custom plug-in system, which can be expanded by itself, and can quickly help enterprises manage API services and improve the stability and security of API services.

Dec 29, 2022

Couper is a lightweight API gateway designed to support developers in building and operating API-driven Web projects

Couper is a lightweight API gateway designed to support developers in building and operating API-driven Web projects

Couper Couper is a lightweight API gateway designed to support developers in building and operating API-driven Web projects. Getting started The quick

Nov 18, 2022

A API scanner written in GOLANG to scan files recursively and look for API keys and IDs.

GO FIND APIS _____ ____ ______ _____ _ _ _____ _____ _____ _____ / ____|/ __ \ | ____|_ _| \ | | __ \ /\ | __ \_

Oct 25, 2021

Go API Client for Metasploit RPC API

go-msf-rpc Golang based RPC client to communicate with Metasploit. Based on code initially developed by Wyatt Dahlenburg repo. Extended to include oth

Nov 18, 2022

The NVD API is an unofficial Go wrapper around the NVD API.

NVD API The NVD API is an unofficial Go wrapper around the NVD API. Supports: CVE CPE How to use The following shows how to basically use the wrapper

Jan 7, 2023

go-whatsapp-rest-API is a Go library for the WhatsApp web which use Swagger as api interface

go-whatsapp-rest-API go-whatsapp-rest-API is a Go library for the WhatsApp web which use Swagger as api interface Multi-devices (MD) Support. This ver

Dec 15, 2022

REST API made using native Golang libraries. This API resembles the basic working of Instagram.

REST API made using native Golang libraries. This API resembles the basic working of Instagram.

Golang RESTful API for Instagram A Go based REST API built using native libraries. The API has been thoroughly worked through with Postman. Routes inc

Mar 16, 2022

iceportal-api is a Golang client implementation to interact with the REST API of iceportal.de when connected to the WiFi-Network offered in German ICE Trains.

iceportal-api is a Golang client implementation to interact with the REST API of iceportal.de when connected to the WiFi-Network offered in German ICE Trains.

iceportal-api is a Golang client implementation to interact with the REST API of iceportal.de when connected to the WiFi-Network offered in German ICE Trains.

Aug 20, 2022

GoTrue is a small open-source API written in Golang, that can act as a self-standing API service for handling user registration and authentication for Jamstack projects.

GoTrue is a small open-source API written in Golang, that can act as a self-standing API service for handling user registration and authentication for Jamstack projects.

GoTrue is a small open-source API written in Golang, that can act as a self-standing API service for handling user registration and authentication for Jamstack projects.

Dec 13, 2021

go-api-crud: API Rest CRUD

go-api-crud API Rest CRUD Estrutura de pacotes cfg (config) Utilizando variáveis de ambiente. Arquivo [cfg/config.go] é possível "setar" configuração.

Oct 27, 2021

Fully serverless CAPTCHA API created with API Gateway, Lambda, Dynamodb and Go

Fully serverless CAPTCHA API created with API Gateway, Lambda, Dynamodb and Go

Fully serverless CAPTCHA API created with API Gateway, Lambda, Dynamodb and Go

Mar 4, 2022
Comments
  • Can goscore be used for regression problems?

    Can goscore be used for regression problems?

    I use goscore for GradientBoostingRegressor problem(the pmml file is generated by sklearn2pmml), but it failed to parse the nodes. Does goscore only support classification problems?

  • Question: performance

    Question: performance

    Hello, @asafschers ! Can you, please, provide some information on performance of model?

    1. What's the biggest size of PMML model, that can be served with goscore?
    2. What about memory consumption and scale of time for predictions?
  • Support for Decision Trees?

    Support for Decision Trees?

    Hi, I read it in your Readme that this repo supports PMML Decision Trees. However, I am not able to find a module that actually implements a decision tree scorer. The tree.go seems to implement and support GBT and Random Forest, but does not seem to be a standalone model that can be used to score. Do you know if Decision Trees are supported currently?

  • pmml format issue

    pmml format issue

    hello , i have a pmml file look likes logistic_regression ,but not have same labels (eg: RegressionModel, RegressionTable ,NumericPredictor ...) , i read the source code , it read the labels that my pmml file not have. why ? Is my pmml file format wrong? Or does this project only support specific formats ?
    Look forward to your reply

go-paddle is a Go client library for accessing the Paddle API.

go-paddle go-paddle is a Go client library for accessing the Paddle API. Installation go get github.com/Fakerr/go-paddle Alternatively the same can be

Aug 22, 2022
Suricate-bank - API to transfer money between accounts at Suricate Bank,written in Go

⚠️ WORK IN PROGRESS ⚠️ Suricate Bank is an api that creates accounts and transfe

Oct 8, 2022
Go-hubspot - An auto-generated go client library of all of Hubspot's API

go-hubspot This is an auto-generated go client library of all of Hubspot's API (

Jan 22, 2022
🤼‍♂️ a simple FIFO matchmaker supporting scoring

Matchmaker This package is a simple FIFO matchmaker that supports player rank & latency (as tags). The rank & latency tags help you to group the playe

Oct 4, 2022
cluster-api-state-metrics (CASM) is a service that listens to the Kubernetes API server and generates metrics about the state of custom resource objects related of Kubernetes Cluster API.

Overview cluster-api-state-metrics (CASM) is a service that listens to the Kubernetes API server and generates metrics about the state of custom resou

Oct 27, 2022
Simple-Weather-API - Simple weather api app created using golang and Open Weather API key
Simple-Weather-API - Simple weather api app created using golang and Open Weather API key

Simple Weather API Simple weather api app created using golang and Open Weather

Feb 6, 2022
Go bindings for OpenCV / 2.x API in gocv / 1.x API in opencv

Go OpenCV binding A Golang binding for OpenCV. OpenCV 1.x C API bindings through CGO, and OpenCV 2+ C++ API (GoCV) through SWIG. Disclaimer This is a

Dec 21, 2022
Go library for accessing the MyAnimeList API: http://myanimelist.net/modules.php?go=api

go-myanimelist go-myanimelist is a Go client library for accessing the MyAnimeList API. Project Status The MyAnimeList API has been stable for years a

Sep 28, 2022
Go client for the YNAB API. Unofficial. It covers 100% of the resources made available by the YNAB API.

YNAB API Go Library This is an UNOFFICIAL Go client for the YNAB API. It covers 100% of the resources made available by the YNAB API. Installation go

Oct 6, 2022
The Akita CLI for watching network traffic, automatically generating API specs, and diffing API specs.

Catch breaking changes faster Akita builds models of your APIs to help you: Catch breaking changes on every pull request, including added/removed endp

Jan 2, 2023