LogoLogo
Python SDKSlack
  • Documentation
  • Cookbooks
  • Self-Hosting
  • Release Notes
  • Reference
  • Arize AI
  • Quickstarts
  • โœจArize Copilot
  • Arize AI for Agents
  • Concepts
    • Agent Evaluation
    • Tracing
      • What is OpenTelemetry?
      • What is OpenInference?
      • Openinference Semantic Conventions
    • Evaluation
  • ๐ŸงชDevelop
    • Quickstart: Experiments
    • Datasets
      • Create a dataset
      • Update a dataset
      • Export a dataset
    • Experiments
      • Run experiments
      • Run experiments with code
        • Experiments SDK differences in AX vs Phoenix
        • Log experiment results via SDK
      • Evaluate experiments
      • Evaluate experiment with code
      • CI/CD with experiments
        • Github Action Basics
        • Gitlab CI/CD Basics
      • Download experiment
    • Prompt Playground
      • Use tool calling
      • Use image inputs
      • Replay spans
      • Compare prompts side-by-side
      • Load a dataset into playground
      • Save playground outputs as an experiment
      • โœจCopilot: prompt builder
    • Playground Integrations
      • OpenAI
      • Azure OpenAI
      • AWS Bedrock
      • VertexAI
      • Custom LLM Models
    • Prompt Hub
  • ๐Ÿง Evaluate
    • Online Evals
      • Run evaluations in the UI
      • Run evaluations with code
      • Test LLM evaluator in playground
      • View task details & logs
      • โœจCopilot: Eval Builder
      • โœจCopilot: Eval Analysis
      • โœจCopilot: RAG Analysis
    • Experiment Evals
    • LLM as a Judge
      • Custom Eval Templates
      • Arize Templates
        • Agent Tool Calling
        • Agent Tool Selection
        • Agent Parameter Extraction
        • Agent Path Convergence
        • Agent Planning
        • Agent Reflection
        • Hallucinations
        • Q&A on Retrieved Data
        • Summarization
        • Code Generation
        • Toxicity
        • AI vs Human (Groundtruth)
        • Citation
        • User Frustration
        • SQL Generation
    • Code Evaluations
    • Human Annotations
  • ๐Ÿ”ญObserve
    • Quickstart: Tracing
    • Tracing
      • Setup tracing
      • Trace manually
        • Trace inputs and outputs
        • Trace function calls
        • Trace LLM, Retriever and Tool Spans
        • Trace prompt templates & variables
        • Trace as Inferences
        • Send Traces from Phoenix -> Arize
        • Advanced Tracing (OTEL) Examples
      • Add metadata
        • Add events, exceptions and status
        • Logging Latent Metadata
        • Add attributes, metadata and tags
        • Send data to a specific project
        • Get the current span context and tracer
      • Configure tracing options
        • Configure OTEL tracer
        • Mask span attributes
        • Redact sensitive data from traces
        • Instrument with OpenInference helpers
      • Query traces
        • Filter Traces
          • Time Filtering
        • Export Traces
        • โœจAI Powered Search & Filter
        • โœจAI Powered Trace Analysis
        • โœจAI Span Analysis & Evaluation
    • Tracing Integrations
      • OpenAI
      • OpenAI Agents SDK
      • LlamaIndex
      • LlamaIndex Workflows
      • LangChain
      • LangGraph
      • Hugging Face smolagents
      • Autogen
      • Google GenAI (Gemini)
      • Model Context Protocol (MCP)
      • Vertex AI
      • Amazon Bedrock
      • Amazon Bedrock Agents
      • MistralAI
      • Anthropic
      • LangFlow
      • Haystack
      • LiteLLM
      • CrewAI
      • Groq
      • DSPy
      • Guardrails AI
      • Prompt flow
      • Vercel AI SDK
      • Llama
      • Together AI
      • OpenTelemetry (arize-otel)
      • BeeAI
    • Evals on Traces
    • Guardrails
    • Sessions
    • Dashboards
      • Dashboard Widgets
      • Tracking Token Usage
      • โœจCopilot: Dashboard Widget Creation
    • Monitors
      • Integrations: Monitors
        • Slack
          • Manual Setup
        • OpsGenie
        • PagerDuty
      • LLM Red Teaming
    • Custom Metrics & Analytics
      • Arize Query Language Syntax
        • Conditionals and Filters
        • All Operators
        • All Functions
      • Custom Metric Examples
      • โœจCopilot: ArizeQL Generator
  • ๐Ÿ“ˆMachine Learning
    • Machine Learning
      • User Guide: ML
      • Quickstart: ML
      • Concepts: ML
        • What Is A Model Schema
        • Delayed Actuals and Tags
        • ML Glossary
      • How To: ML
        • Upload Data to Arize
          • Pandas SDK Example
          • Local File Upload
            • File Upload FAQ
          • Table Ingestion Tuning
          • Wildcard Paths for Cloud Storage
          • Troubleshoot Data Upload
          • Sending Data FAQ
        • Monitors
          • ML Monitor Types
          • Configure Monitors
            • Notifications Providers
          • Programmatically Create Monitors
          • Best Practices for Monitors
        • Dashboards
          • Dashboard Widgets
          • Dashboard Templates
            • Model Performance
            • Pre-Production Performance
            • Feature Analysis
            • Drift
          • Programmatically Create Dashboards
        • Performance Tracing
          • Time Filtering
          • โœจCopilot: Performance Insights
        • Drift Tracing
          • โœจCopilot: Drift Insights
          • Data Distribution Visualization
          • Embeddings for Tabular Data (Multivariate Drift)
        • Custom Metrics
          • Arize Query Language Syntax
            • Conditionals and Filters
            • All Operators
            • All Functions
          • Custom Metric Examples
          • Custom Metrics Query Language
          • โœจCopilot: ArizeQL Generator
        • Troubleshoot Data Quality
          • โœจCopilot: Data Quality Insights
        • Explainability
          • Interpreting & Analyzing Feature Importance Values
          • SHAP
          • Surrogate Model
          • Explainability FAQ
          • Model Explainability
        • Bias Tracing (Fairness)
        • Export Data to Notebook
        • Automate Model Retraining
        • ML FAQ
      • Use Cases: ML
        • Binary Classification
          • Fraud
          • Insurance
        • Multi-Class Classification
        • Regression
          • Lending
          • Customer Lifetime Value
          • Click-Through Rate
        • Timeseries Forecasting
          • Demand Forecasting
          • Churn Forecasting
        • Ranking
          • Collaborative Filtering
          • Search Ranking
        • Natural Language Processing (NLP)
        • Common Industry Use Cases
      • Integrations: ML
        • Google BigQuery
          • GBQ Views
          • Google BigQuery FAQ
        • Snowflake
          • Snowflake Permissions Configuration
        • Databricks
        • Google Cloud Storage (GCS)
        • Azure Blob Storage
        • AWS S3
          • Private Image Link Access Via AWS S3
        • Kafka
        • Airflow Retrain
        • Amazon EventBridge Retrain
        • MLOps Partners
          • Algorithmia
          • Anyscale
          • Azure & Databricks
          • BentoML
          • CML (DVC)
          • Deepnote
          • Feast
          • Google Cloud ML
          • Hugging Face
          • LangChain ๐Ÿฆœ๐Ÿ”—
          • MLflow
          • Neptune
          • Paperspace
          • PySpark
          • Ray Serve (Anyscale)
          • SageMaker
            • Batch
            • RealTime
            • Notebook Instance with Greater than 20GB of Data
          • Spell
          • UbiOps
          • Weights & Biases
      • API Reference: ML
        • Python SDK
          • Pandas Batch Logging
            • Client
            • log
            • Schema
            • TypedColumns
            • EmbeddingColumnNames
            • ObjectDetectionColumnNames
            • PromptTemplateColumnNames
            • LLMConfigColumnNames
            • LLMRunMetadataColumnNames
            • NLP_Metrics
            • AutoEmbeddings
            • utils.types.ModelTypes
            • utils.types.Metrics
            • utils.types.Environments
          • Single Record Logging
            • Client
            • log
            • TypedValue
            • Ranking
            • Multi-Class
            • Object Detection
            • Embedding
            • LLMRunMetadata
            • utils.types.ModelTypes
            • utils.types.Metrics
            • utils.types.Environments
        • Java SDK
          • Constructor
          • log
          • bulkLog
          • logValidationRecords
          • logTrainingRecords
        • R SDK
          • Client$new()
          • Client$log()
        • Rest API
    • Computer Vision
      • How to: CV
        • Generate Embeddings
          • How to Generate Your Own Embedding
          • Let Arize Generate Your Embeddings
        • Embedding & Cluster Analyzer
        • โœจCopilot: Embedding Summarization
        • Similarity Search
        • Embedding Drift
        • Embeddings FAQ
      • Integrations: CV
      • Use Cases: CV
        • Image Classification
        • Image Segmentation
        • Object Detection
      • API Reference: CV
Powered by GitBook

Support

  • Chat Us On Slack
  • support@arize.com

Get Started

  • Signup For Free
  • Book A Demo

Copyright ยฉ 2025 Arize AI, Inc

On this page
  • Overview
  • API
  • API Arguments
  • Sample Code
  • Sample Code - Sending Data for Ranking Models

Was this helpful?

  1. Machine Learning
  2. Machine Learning
  3. API Reference: ML
  4. Java SDK

bulkLog

Call arize.bulkLog to publish the features, predicted label, actual, and SHAP for a single data point to Arize for monitoring, analysis, and explainability in bulk.

Last updated 2 years ago

Was this helpful?

Overview

Use the to call arize.bulkLog() with collections of predicted labels, observed actuals, their feature inputs, their shap values, and corresponding prediction ids. Once records are sent to Arize's platform, you'll be able to visualize and analyze data holistically or within aggregated slices.

arize.bulkLog() returns a Response. You can await on the Response to complete to ensure successful delivery of records.

When logging a prediction for the first time for a new model, we classify the model in the Arize platform based on the data type of the prediction.

For more information on model schema discovery, visit here:

API

<T> Response bulkLog( final String modelId, final String modelVersion, final List<String> predictionIds, final List<Map<String, ?>> features, final List<Map<String, ?>> tags, final List<Map<String, Embedding>> embeddingFeatures, final List<T> predictionLabels, final List<T> actualLabels, final List<Map<String, Double>> shapValues final List<Long> predictionTimestamps) throws IOException, IllegalArgumentException;

Important: If multiple iterable arguments (i.e prediction, actual, and explainability) are passed in the same call, they must be (1) the same length, (2) map to the same predictionIds by entry.

API Arguments

Paramater

Data Type

Description

modelId

String

The unique identifier for your model.

Required

modelVersion

String

Used to group together a subset of predictions and actuals for a given model_id.

Required for logging predictions. Optional for logging actuals or shap values.

predictionIds

List<Strings>

Unique identifiers for all your bulk predictions contained in a List<Strings>

Important: The values are used to match predictions to actual labels or feature importances (SHAP) in the Arize platform.

Required

features

List<Map<String, ?>>

Where value can be oneOf: String, int, long, short, double, float, boolean, List<String>

List of Maps containing human readable and debuggable model features. Keys must be Strings and values one of: String, int, long, short, double, float, boolean, List<String>

Optional

embeddingFeatures

Map<String, Embedding>

Map containing human readable and debuggable model embedding features. Map keys must be String and values Embedding

Optional

tags

Map<String, ?> Where value can be oneOf: String, int, long, short, double, float, boolean, List<String>

Map containing human readable and debuggable model features. Map keys must be String and values one of: String, int, long, short, double, float, boolean, List<String>

Optional

predictionLabels

List<T> where T is oneof String, boolean, int, long, short, float, double, ScoreCategorical

The predicted labels for your given model inputs contained in a List<T>

Important: If sent in as an argument, entries are matched respectively to the entries in prediction ids, feature values, and feature importances in the same index.

Important: Must have the same number of elements as feature, actuals, and importances is all sent together.

Optional

actualLabels

List<T> where T is oneof String, boolean, int, long, short, float, double, ScoreCategorical

The actual observed labels for a given model input.

Important: If passed together in a single call with predictionLabels, both inputs must have the same shape.

Important: If model is Score Categorical, Arize.ScoreCategorical object should be passed in with corresponding predictedLabel, probabilityScore.

Optional

shapValues

List<Map<String, Double>>

The SHAP value sets for a set of predictions.

SHAP value sets are correspond to the prediction ids with the same index.

Optional

predictionTimestamps

List<int>

List of int representing Unix epoch time in seconds, set to overwrite the timestamp for prediction.

If null, defaults to using the current timestamp.

Important: Future and Historical predictions are supported up to 1 year from current wall clock time.

Optional

Sample Code

import com.arize.ArizeClient;
import com.arize.Response;
import com.arize.types.Embedding;

// You only need to instantiate the client once
final ArizeClient arize = new ArizeClient(System.getenv("ARIZE_API_KEY"), System.getenv("ARIZE_SPACE_KEY"));
        
final List<Map<String, ?>> features = new ArrayList<Map<String, ?>>();
features.add(new HashMap<String, Object>() {{ put("days", 5); put("is_organic", 1);}});
features.add(new HashMap<String, Object>() {{ put("days", 3); put("is_organic", 0);}});
features.add(new HashMap<String, Object>() {{ put("days", 7); put("is_organic", 0);}});

final List<Map<String, Embedding>> embeddingFeatures = new ArrayList<Map<String, Embedding>>();
embeddingFeatures.add(new HashMap<String, Embedding>() {{ put("embedding_feature_1", new Embedding(Arrays.asList(1.0, 0.5), Arrays.asList("test", "token", "array"), "https://example.com/image.jpg")); put("embedding_feature_2", new Embedding(Arrays.asList(1.0, 0.8), Arrays.asList("this", "is"), "https://example.com/image_3.jpg"));}});
embeddingFeatures.add(new HashMap<String, Embedding>() {{ put("embedding_feature_1", new Embedding(Arrays.asList(0.0, 0.6), Arrays.asList("another", "example"), "https://example.com/image_2.jpg")); put("embedding_feature_2", new Embedding(Arrays.asList(0.1, 1.0), Arrays.asList("an", "example"), "https://example.com/image_4.jpg"));}});
embeddingFeatures.add(new HashMap<String, Embedding>() {{ put("embedding_feature_1", new Embedding(Arrays.asList(1.0, 0.8), Arrays.asList("third"), "https://example.com/image_3.jpg")); put("embedding_feature_2", new Embedding(Arrays.asList(1.0, 0.4), Arrays.asList("token", "array"), "https://example.com/image_5.jpg"));}});

final List<Map<String, ?>> tags = new ArrayList<Map<String, ?>>();
tags.add(new HashMap<String, Object>() {{ put("metadata", 5); put("my business metric", 1);}});
tags.add(new HashMap<String, Object>() {{ put("metadata", 3); put("my business metric", 0);}});
tags.add(new HashMap<String, Object>() {{ put("metadata", 7); put("my business metric", 8);}});

final List<Map<String, Double>> shapValues = new ArrayList<>();
shapValues.add(new HashMap<String, Double>(){{ put("days", 1.0); put("is_organic", -1.5);}});
shapValues.add(new HashMap<String, Double>(){{ put("days", 1.0); put("is_organic", -1.1);}});
shapValues.add(new HashMap<String, Double>(){{ put("days", 1.0); put("is_organic", -1.1);}});

final List<String> labels = new ArrayList<String>(Arrays.asList("pear", "banana", "apple"));
final List<String> predictionIds = new ArrayList<String>(Arrays.asList(UUID.randomUUID().toString(), UUID.randomUUID().toString(), UUID.randomUUID().toString()));

final Response asyncResponse = arize.bulkLog("exampleModelId", "v1", predictionIds, features, embeddingFeatures, tags, labels, null, shapValues,null);

// This is a blocking call similar to future.get()
asyncResponse.resolve();

// Check that the API call was successful
switch (asyncResponse.getResponseCode()) {
    case OK:
        // TODO: Success!
        System.out.println("Success!!!");
        break;
    case AUTHENTICATION_ERROR:
        // TODO: Check to make sure your Arize API KEY and Space key are correct
        break;
    case BAD_REQUEST:
        // TODO: Malformed request
        System.out.println("Failure Reason: " + asyncResponse.getResponseBody());
    case NOT_FOUND:
        // TODO: API endpoint not found, client is likely malconfigured, make sure you
        // are not overwriting Arize's endpoint URI
        break;
    case UNEXPECTED_FAILURE:
        // TODO: Unexpected failure, check for a reason on response body
        System.out.println("Failure Reason: " + asyncResponse.getResponseBody());
        break;
}

System.out.println("Response Code: " + asyncResponse.getResponseCode());
System.out.println("Response Body: " + asyncResponse.getResponseBody());

// Don't forget to shutdown the client with your application shutdown hook.
arize.close();
System.out.println("Done");

Sample Code - Sending Data for Ranking Models

ArizeClient arize = new ArizeClient(System.getenv("ARIZE_API_KEY"), System.getenv("ARIZE_SPACE_KEY"));

final List<String> predictionIds =
        new ArrayList<>(
                Arrays.asList(
                        UUID.randomUUID().toString(),
                        UUID.randomUUID().toString(),
                        UUID.randomUUID().toString(),
                        UUID.randomUUID().toString(),
                        UUID.randomUUID().toString(),
                        UUID.randomUUID().toString()));


final List<ArizeClient.Ranking> predictionLabels =
        Arrays.asList(
                new ArizeClient.Ranking.RankingBuilder().setPredictionGroupId("XX").setPredictionScore(9.8).setRank(1).build(),
                new ArizeClient.Ranking.RankingBuilder().setPredictionGroupId("XX").setPredictionScore(9.5).setRank(2).build(),
                new ArizeClient.Ranking.RankingBuilder().setPredictionGroupId("XX").setPredictionScore(9.0).setRank(3).build(),
                new ArizeClient.Ranking.RankingBuilder().setPredictionGroupId("YY").setPredictionScore(9.7).setRank(1).build(),
                new ArizeClient.Ranking.RankingBuilder().setPredictionGroupId("YY").setPredictionScore(9.2).setRank(2).build(),
                new ArizeClient.Ranking.RankingBuilder().setPredictionGroupId("YY").setPredictionScore(8.0).setRank(3).build()
        );

final List<ArizeClient.Ranking> actualLabels =
        Arrays.asList(
                new ArizeClient.Ranking.RankingBuilder().setRelevanceScore(1).setRelevanceLabels(MultiValue.newBuilder().addAllValues(Arrays.asList("click", "purchase")).build()).build(),
                new ArizeClient.Ranking.RankingBuilder().setRelevanceScore(1).setRelevanceLabels(MultiValue.newBuilder().addAllValues(Collections.singletonList("click")).build()).build(),
                new ArizeClient.Ranking.RankingBuilder().setRelevanceScore(1).setRelevanceLabels(MultiValue.newBuilder().addAllValues(Collections.singletonList("no-event")).build()).build(),
                new ArizeClient.Ranking.RankingBuilder().setRelevanceScore(1).setRelevanceLabels(MultiValue.newBuilder().addAllValues(Collections.singletonList("click")).build()).build(),
                new ArizeClient.Ranking.RankingBuilder().setRelevanceScore(1).setRelevanceLabels(MultiValue.newBuilder().addAllValues(Collections.singletonList("no-event")).build()).build(),
                new ArizeClient.Ranking.RankingBuilder().setRelevanceScore(1).setRelevanceLabels(MultiValue.newBuilder().addAllValues(Arrays.asList("click", "purchase")).build()).build()

        );
final List<Map<String, ?>> tags = new ArrayList<>();
for (ArizeClient.Ranking predictionLabel : predictionLabels) {
    tags.add(new HashMap<String, Object>() {
        {
            put("Rank", predictionLabel.getRank());
        }
    });
}

final Response asyncResponse =
        arize.bulkLog(
                "exampleModelId",
                "v1",
                predictionIds,
                null,
                null,
                tags,
                predictionLabels,
                actualLabels,
                null,
                null);
                
// This is a blocking call similar to future.get()
asyncResponse.resolve();

Questions? Email us at or in the #arize-support channel

๐Ÿ“ˆ
initialized Arize client
What Is A Model Schema
support@arize.com
Slack us