Package com.arize

Interface ArizeAPI

  • All Known Implementing Classes:
    ArizeClient

    public interface ArizeAPI
    • Method Detail

      • log

        <T> Response log​(String modelId,
                         String modelVersion,
                         String predictionId,
                         Map<String,​?> features,
                         Map<String,​Embedding> embeddingFeatures,
                         Map<String,​?> tags,
                         T predictionLabel,
                         T actualLabel,
                         Map<String,​Double> shapValues,
                         long predictionTimestamp)
                  throws IOException,
                         IllegalArgumentException
        log builds and submits a record to the Arize API.
        Type Parameters:
        T - Boxed type for predictionLabel. Supported boxed types are: boolean, string, int, long, short, float, double.
        Parameters:
        modelId - Unique identifier for a given model.
        modelVersion - Model version identifier used to group together a subset of predictions and actuals for a given modelId.
        predictionId - Required unique identifier for a given prediction.
        features - Optional Map containing model features. Map key must be String and values are one of: string, int, long, short, float, double, boolean.
        embeddingFeatures - Optional Map containing model embedding features. Map key must be String and values Embedding
        tags - Optional Map containing record tags (aka metadata) that can be associated with a prediction. This can be used to filter during analysis. Map key must be String and values are one of: string, int, long, short, float, double, boolean. by non-feature data.
        predictionLabel - Predicted value for a given set of model inputs. Supported boxed types are: boolean, string, int, long, short, float, double. Not required if sending latent actual or feature importance.
        actualLabel - The latent truth value for a given set of model inputs. Supported boxed types are: boolean, string, int, long, short, float, double. This can either be supplied at the same time as the predictionLabel or on its own once it is known, and it will be linked back by the predictionId
        shapValues - Optional Map from feature name to shap value. This can either be supplied at the same time as the predictionLabel or on its own, and it will be linked back by the predictionId
        predictionTimestamp - The timestamp to which the prediction should be attributed. If not set this defaults to the time of receipt
        Returns:
        Response
        Throws:
        IOException - in case of a network error
        IllegalArgumentException - in case data type for features or label are not supported.
      • bulkLog

        <T> Response bulkLog​(String modelId,
                             String modelVersion,
                             List<String> predictionIds,
                             List<Map<String,​?>> features,
                             List<Map<String,​Embedding>> embeddingFeatures,
                             List<Map<String,​?>> tags,
                             List<T> predictionLabels,
                             List<T> actualLabels,
                             List<Map<String,​Double>> shapValues,
                             List<Long> predictionTimestamps)
                      throws IOException,
                             IllegalArgumentException
        logBulkPrediction builds and submits a Bulk Prediction record to the Arize API.
        Type Parameters:
        T - Boxed type for predictionLabel and actualLabel. Supported boxed types are: boolean, string, int, long, short, float, double.
        Parameters:
        modelId - Unique String identifier for a given model.
        modelVersion - Optional String identifier used to group together a subset of predictions and actuals for a given modelId.
        predictionIds - List of unique String indentifiers for predictions. This value is used to match latent actual labels to their original predictions.
        features - Optional List of Map varargs containing human-readable and debuggable model features. Map key must be String and values are one of: string, int, long, short, float, double, boolean.
        embeddingFeatures - Optional List of Map varargs containing human-readable and debuggable model embedding features. Map key must be String and values Embedding.
        tags - Optional List of Map varargs containing record tags/metadata. Map key must be String and values are one of: string, int, long, short, float, double, boolean.
        predictionLabels - List of predicted values. Supported boxed types are: boolean, string, int, long, short, float, double.
        actualLabels - List of latent actual values. Supported boxed types are: boolean, string, int, long, short, float, double. This can either be supplied at the same time as the predictionLabels or on their own once they are known, and they will be linked back by the corresponding predictionIds
        shapValues - Optional List of Map from feature name to shap value. Can be provided at the same time as the predictionLabels or on their own and they will be linked back by the corresponding predictionIds
        predictionTimestamps - Optional List of Long of unix epoch time in milliseconds used to overwrite timestamp for a prediction.
        Returns:
        Response
        Throws:
        IOException - in case of a network error
        IllegalArgumentException - in case data type for features or label are not supported.
      • logTrainingRecords

        <T> Response logTrainingRecords​(String modelId,
                                        String modelVersion,
                                        List<Map<String,​?>> features,
                                        List<Map<String,​Embedding>> embeddingFeatures,
                                        List<Map<String,​?>> tags,
                                        List<T> predictionLabels,
                                        List<T> actualLabels)
                                 throws IOException,
                                        IllegalArgumentException
        Type Parameters:
        T - Boxed type for predictionLabel and actualLabel. Supported boxed types are: boolean, string, int, long, short, float, double.
        Parameters:
        modelId - Unique String identifier for a given model.
        modelVersion - Optional String identifier used to group together a subset of predictions and actuals for a given modelId.
        features - Optional List of Map varargs containing human-readable and debuggable model features. Map key must be String and values are one of: string, int, long, short, float, double, boolean.
        embeddingFeatures - Optional List of Map varargs containing human-readable and debuggable model embedding features. Map key must be String and values Embedding.
        tags - Optional List of Map varargs containing record tags/metadata. Map key must be String and values are one of: string, int, long, short, float, double, boolean.
        predictionLabels - List of predicted values. Supported boxed types are: boolean, string, int, long, short, float, double.
        actualLabels - List of latent actual values. Supported boxed types are: boolean, string, int, long, short, float, double. This can either be supplied at the same time as the predictionLabels or on their own once they are known, and they will be linked back by the corresponding predictionIds
        Returns:
        Response
        Throws:
        IOException - in case of a network error
        IllegalArgumentException - in case data type for features or label are not supported.
      • logValidationRecords

        <T> Response logValidationRecords​(String modelId,
                                          String modelVersion,
                                          String batchId,
                                          List<Map<String,​?>> features,
                                          List<Map<String,​Embedding>> embeddingFeatures,
                                          List<Map<String,​?>> tags,
                                          List<T> predictionLabels,
                                          List<T> actualLabels)
                                   throws IOException
        Type Parameters:
        T - Boxed type for predictionLabel and actualLabel. Supported boxed types are: boolean, string, int, long, short, float, double.
        Parameters:
        modelId - Unique String identifier for a given model.
        modelVersion - Optional String identifier used to group together a subset of predictions and actuals for a given modelId.
        batchId - Unique identifier for the validation batch we are adding data to
        features - Optional List of Map varargs containing human readable and debuggable model features. Map key must be String and values are one of: string, int, long, short, float, double, boolean.
        embeddingFeatures - Optional List of Map varargs containing human-readable and debuggable model embedding features. Map key must be String and values Embedding.
        tags - Optional List of Map varargs containing record tags/metadata. Map key must be String and values are one of: string, int, long, short, float, double, boolean.
        predictionLabels - List of predicted values. Supported boxed types are: boolean, string, int, long, short, float, double.
        actualLabels - List of latent actual values. Supported boxed types are: boolean, string, int, long, short, float, double. This can either be supplied at the same time as the predictionLabels or on their own once they are known, and they will be linked back by the corresponding predictionIds
        Returns:
        Response
        Throws:
        IOException - in case of a network error
        IllegalArgumentException - in case data type for features or label are not supported.