Giter Club home page Giter Club logo

client_golang's Introduction



Slack license

Overview

A helper library to interact with Arize AI APIs.

Arize is an end-to-end ML observability and model monitoring platform. The platform is designed to help ML engineers and data science practitioners surface and fix issues with ML models in production faster with:

  • Automated ML monitoring and model monitoring
  • Workflows to troubleshoot model performance
  • Real-time visualizations for model performance monitoring, data quality monitoring, and drift monitoring
  • Model prediction cohort analysis
  • Pre-deployment model validation
  • Integrated model explainability

Quickstart

This guide will help you instrument your code to log observability data for model monitoring and ML observability. The types of data supported include prediction labels, human readable/debuggable model features and tags, actual labels (once the ground truth is learned), and other model-related data. Logging model data allows you to generate powerful visualizations in the Arize platform to better monitor model performance, understand issues that arise, and debug your model's behavior. Additionally, Arize provides data quality monitoring, data drift detection, and performance management of your production models.

Start logging your model data with the following steps:

1. Sign up for your account

Sign up for a free account at https://arize.com/join.



2. Get your service API key

When you create an account, we generate a service API key. You will need this API Key and your Space Key for logging authentication.



Initialize Golang Client

Initialize arize at the start of your service using your previously created API Key and Space Key.

NOTE: We strongly suggest storing the API key as a secret.

package main

import (
   "github.com/Arize-ai/client_golang"
)

func main() {
	c := arize.NewClient("YOUR_SPACE_KEY", "YOUR_API_KEY")
}

Collect your model input features and labels you'd like to track

Real-time single prediction:

For a single real-time prediction, you can track all input features used at prediction time by logging them via a key:value map.

package main

import (
   "context"
   "fmt"
   "github.com/Arize-ai/client_golang"
   "github.com/google/uuid"
   "net/http"
   "time"
)

func main() {
   c := arize.NewClient("YOUR_SPACE_KEY", "YOUR_API_KEY")

   modelVersion := "v1"
   features := map[string]interface{}{"exampleFeatureName": 0.5}
   shapValues := map[string]float64{"exampleFeatureName": 1.0}
   eventMetadata := map[string]interface{}{"exampleEventMetadata": "xyz"}
   prediction := 0.9
   actual := 1.0
   now := time.Now()

   resp, err := c.Log(context.Background(), "exampleModelId", &modelVersion, uuid.NewString(), features, eventMetadata, shapValues, prediction, actual, &now, nil)
   if err != nil {
	   fmt.Printf("Log failed with err=%v \n", err)
   }
   if resp.StatusCode != http.StatusOK {
	   fmt.Printf("Request failed with status=%v, body=%v\n")
   }
   fmt.Println("Successfully logged a record to Arize")
}

client_golang's People

Contributors

fjcasti1 avatar harrisonchu avatar svadakat avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.