public CreateModelPackageRequest withTask(String task) {
        setTask(task);
        return this;
    }
<p>
The machine learning task your model package accomplishes. Common machine learning tasks include object detection
and image classification. The following tasks are supported by Inference Recommender:
<code>"IMAGE_CLASSIFICATION"</code> | <code>"OBJECT_DETECTION"</code> | <code>"TEXT_GENERATION"</code> |
<code>"IMAGE_SEGMENTATION"</code> | <code>"FILL_MASK"</code> | <code>"CLASSIFICATION"</code> |
<code>"REGRESSION"</code> | <code>"OTHER"</code>.
</p>
<p>
Specify "OTHER" if none of the tasks listed fit your use case.
</p>

@param task
       The machine learning task your model package accomplishes. Common machine learning tasks include object
       detection and image classification. The following tasks are supported by Inference Recommender:
       <code>"IMAGE_CLASSIFICATION"</code> | <code>"OBJECT_DETECTION"</code> | <code>"TEXT_GENERATION"</code> |
       <code>"IMAGE_SEGMENTATION"</code> | <code>"FILL_MASK"</code> | <code>"CLASSIFICATION"</code> |
       <code>"REGRESSION"</code> | <code>"OTHER"</code>.</p>
       <p>
       Specify "OTHER" if none of the tasks listed fit your use case.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/CreateModelPackageRequest.java