public class AmazonMachineLearningClient extends AmazonWebServiceClient implements AmazonMachineLearning
Definition of the public APIs exposed by Amazon Machine Learning
LOGGING_AWS_REQUEST_METRIC
Constructor and Description |
---|
AmazonMachineLearningClient()
Deprecated.
|
AmazonMachineLearningClient(AWSCredentials awsCredentials)
Constructs a new client to invoke service methods on
AmazonMachineLearning using the specified AWS account credentials.
|
AmazonMachineLearningClient(AWSCredentials awsCredentials,
ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on
AmazonMachineLearning using the specified AWS account credentials and
client configuration options.
|
AmazonMachineLearningClient(AWSCredentialsProvider awsCredentialsProvider)
Constructs a new client to invoke service methods on
AmazonMachineLearning using the specified AWS account credentials
provider.
|
AmazonMachineLearningClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration)
Constructs a new client to invoke service methods on
AmazonMachineLearning using the specified AWS account credentials
provider and client configuration options.
|
AmazonMachineLearningClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration,
HttpClient httpClient)
Constructs a new client to invoke service methods on
AmazonMachineLearning using the specified AWS account credentials
provider, client configuration options and request metric collector.
|
AmazonMachineLearningClient(AWSCredentialsProvider awsCredentialsProvider,
ClientConfiguration clientConfiguration,
com.amazonaws.metrics.RequestMetricCollector requestMetricCollector)
Deprecated.
|
AmazonMachineLearningClient(ClientConfiguration clientConfiguration)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
ResponseMetadata |
getCachedResponseMetadata(AmazonWebServiceRequest request)
Deprecated.
ResponseMetadata cache can hold up to 50 requests and
responses in memory and will cause memory issue. This method
now always returns null.
|
GetMLModelResult |
getMLModel(GetMLModelRequest getMLModelRequest)
Returns an
MLModel that includes detailed metadata, data
source information, and the current status of the MLModel . |
PredictResult |
predict(PredictRequest predictRequest)
Generates a prediction for the observation using the specified
ML Model . |
addRequestHandler, addRequestHandler, getEndpoint, getEndpointPrefix, getRegions, getRequestMetricsCollector, getServiceName, getSignerByURI, getSignerRegionOverride, getTimeOffset, removeRequestHandler, removeRequestHandler, setConfiguration, setEndpoint, setEndpoint, setRegion, setServiceNameIntern, setSignerRegionOverride, setTimeOffset, shutdown, withTimeOffset
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setEndpoint, setRegion, shutdown
@Deprecated public AmazonMachineLearningClient()
All service calls made using this new client object are blocking, and will not return until the service call completes.
DefaultAWSCredentialsProviderChain
@Deprecated public AmazonMachineLearningClient(ClientConfiguration clientConfiguration)
All service calls made using this new client object are blocking, and will not return until the service call completes.
clientConfiguration
- The client configuration options controlling
how this client connects to AmazonMachineLearning (ex: proxy
settings, retry counts, etc.).DefaultAWSCredentialsProviderChain
public AmazonMachineLearningClient(AWSCredentials awsCredentials)
The client requests are authenticated using the AWSCredentials
provided in this constructor. Static AWSCredentials can be passed for
quick testing. However, it is strongly recommended to use Amazon Cognito
vended temporary credentials for use in production. This can be achieved
by using AWSMobileClient
. Please see
https://aws-amplify.github.io/docs/android/authentication for
instructions on how to enable AWSMobileClient
.
AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() { @Override public void onResult(final UserStateDetails details) { AmazonMachineLearningClient client = new AmazonMachineLearningClient(AWSMobileClient .getInstance()); } @Override public void onError(final Exception e) { e.printStackTrace(); } });
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentials
- The AWS credentials (access key ID and secret key)
to use when authenticating with AWS services.public AmazonMachineLearningClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration)
The client requests are authenticated using the AWSCredentials
provided in this constructor. Static AWSCredentials can be passed for
quick testing. However, it is strongly recommended to use Amazon Cognito
vended temporary credentials for use in production. This can be achieved
by using AWSMobileClient
. Please see
https://aws-amplify.github.io/docs/android/authentication for
instructions on how to enable AWSMobileClient
.
AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() { @Override public void onResult(final UserStateDetails details) { AmazonMachineLearningClient client = new AmazonMachineLearningClient(AWSMobileClient .getInstance()); } @Override public void onError(final Exception e) { e.printStackTrace(); } });
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentials
- The AWS credentials (access key ID and secret key)
to use when authenticating with AWS services.clientConfiguration
- The client configuration options controlling
how this client connects to AmazonMachineLearning (ex: proxy
settings, retry counts, etc.).public AmazonMachineLearningClient(AWSCredentialsProvider awsCredentialsProvider)
The client requests are authenticated using the AWSCredentials
provided by the AWSCredentialsProvider
. Static AWSCredentials can
be passed for quick testing. However, it is strongly recommended to use
Amazon Cognito vended temporary credentials for use in production. This
can be achieved by using AWSMobileClient
. Please see
https://aws-amplify.github.io/docs/android/authentication for
instructions on how to enable AWSMobileClient
.
AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() { @Override public void onResult(final UserStateDetails details) { AmazonMachineLearningClient client = new AmazonMachineLearningClient(AWSMobileClient .getInstance()); } @Override public void onError(final Exception e) { e.printStackTrace(); } });
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will
provide credentials to authenticate requests with AWS
services.public AmazonMachineLearningClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration)
The client requests are authenticated using the AWSCredentials
provided by the AWSCredentialsProvider
. Static AWSCredentials can
be passed for quick testing. However, it is strongly recommended to use
Amazon Cognito vended temporary credentials for use in production. This
can be achieved by using AWSMobileClient
. Please see
https://aws-amplify.github.io/docs/android/authentication for
instructions on how to enable AWSMobileClient
.
AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() { @Override public void onResult(final UserStateDetails details) { AmazonMachineLearningClient client = new AmazonMachineLearningClient(AWSMobileClient .getInstance()); } @Override public void onError(final Exception e) { e.printStackTrace(); } });
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will
provide credentials to authenticate requests with AWS
services.clientConfiguration
- The client configuration options controlling
how this client connects to AmazonMachineLearning (ex: proxy
settings, retry counts, etc.).@Deprecated public AmazonMachineLearningClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, com.amazonaws.metrics.RequestMetricCollector requestMetricCollector)
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will
provide credentials to authenticate requests with AWS
services.clientConfiguration
- The client configuration options controlling
how this client connects to AmazonMachineLearning (ex: proxy
settings, retry counts, etc.).requestMetricCollector
- optional request metric collectorpublic AmazonMachineLearningClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration, HttpClient httpClient)
The client requests are authenticated using the AWSCredentials
provided by the AWSCredentialsProvider
. Static AWSCredentials can
be passed for quick testing. However, it is strongly recommended to use
Amazon Cognito vended temporary credentials for use in production. This
can be achieved by using AWSMobileClient
. Please see
https://aws-amplify.github.io/docs/android/authentication for
instructions on how to enable AWSMobileClient
.
AWSMobileClient.getInstance().initialize(getApplicationContext(), new Callback<UserStateDetails>() { @Override public void onResult(final UserStateDetails details) { AmazonMachineLearningClient client = new AmazonMachineLearningClient(AWSMobileClient .getInstance()); } @Override public void onError(final Exception e) { e.printStackTrace(); } });
All service calls made using this new client object are blocking, and will not return until the service call completes.
awsCredentialsProvider
- The AWS credentials provider which will
provide credentials to authenticate requests with AWS
services.clientConfiguration
- The client configuration options controlling
how this client connects to AmazonMachineLearning (ex: proxy
settings, retry counts, etc.).httpClient
- A http clientpublic GetMLModelResult getMLModel(GetMLModelRequest getMLModelRequest) throws AmazonServiceException, AmazonClientException
Returns an MLModel
that includes detailed metadata, data
source information, and the current status of the MLModel
.
GetMLModel
provides results in normal or verbose format.
getMLModel
in interface AmazonMachineLearning
getMLModelRequest
- InvalidInputException
- An error on the client occurred. Typically, the cause is an invalid input value.
ResourceNotFoundException
- A specified resource cannot be located.
InternalServerException
- An error on the server occurred when trying to process a request.
AmazonClientException
- If any internal errors are encountered
inside the client while attempting to make the request or
handle the response. For example if a network connection is
not available.AmazonServiceException
- If an error response is returned by Amazon
Machine Learning indicating either a problem with the data in
the request, or a server side issue.public PredictResult predict(PredictRequest predictRequest) throws AmazonServiceException, AmazonClientException
Generates a prediction for the observation using the specified
ML Model
.
Not all response parameters will be populated. Whether a response parameter is populated depends on the type of model requested.
predict
in interface AmazonMachineLearning
predictRequest
- InvalidInputException
- An error on the client occurred. Typically, the cause is an invalid input value.
ResourceNotFoundException
- A specified resource cannot be located.
LimitExceededException
-
The subscriber exceeded the maximum number of operations.
This exception can occur when listing objects such as
DataSource
.
InternalServerException
- An error on the server occurred when trying to process a request.
PredictorNotMountedException
-
The exception is thrown when a predict request is made to an
unmounted MLModel
.
AmazonClientException
- If any internal errors are encountered
inside the client while attempting to make the request or
handle the response. For example if a network connection is
not available.AmazonServiceException
- If an error response is returned by Amazon
Machine Learning indicating either a problem with the data in
the request, or a server side issue.@Deprecated public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request)
Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic information for an executed request, you should use this method to retrieve it as soon as possible after executing the request.
getCachedResponseMetadata
in interface AmazonMachineLearning
request
- The originally executed requestCopyright © 2018 Amazon Web Services, Inc. All Rights Reserved.