Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010-2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   * 
   *  http://aws.amazon.com/apache2.0
   * 
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.machinelearning.model;
 
 
Container for the parameters to the CreateDataSourceFromS3 operation.

Creates a DataSource object. A DataSource references data that can be used to perform CreateMLModel, CreateEvaluation, or CreateBatchPrediction operations.

CreateDataSourceFromS3 is an asynchronous operation. In response to CreateDataSourceFromS3 , Amazon Machine Learning (Amazon ML) immediately returns and sets the DataSource status to PENDING . After the DataSource is created and ready for use, Amazon ML sets the Status parameter to COMPLETED . DataSource in COMPLETED or PENDING status can only be used to perform CreateMLModel, CreateEvaluation or CreateBatchPrediction operations.

If Amazon ML cannot accept the input source, it sets the Status parameter to FAILED and includes an error message in the Message attribute of the GetDataSource operation response.

The observation data used in a DataSource should be ready to use; that is, it should have a consistent structure, and missing data values should be kept to a minimum. The observation data must reside in one or more CSV files in an Amazon Simple Storage Service (Amazon S3) bucket, along with a schema that describes the data items by name and type. The same schema must be used for all of the data files referenced by the DataSource .

After the DataSource has been created, it's ready to use in evaluations and batch predictions. If you plan to use the DataSource to train an MLModel , the DataSource requires another item: a recipe. A recipe describes the observation variables that participate in training an MLModel . A recipe describes how each input variable will be used in training. Will the variable be included or excluded from training? Will the variable be manipulated, for example, combined with another variable, or split apart into word combinations? The recipe provides answers to these questions. For more information, see the Amazon Machine Learning Developer Guide .

 
 public class CreateDataSourceFromS3Request extends AmazonWebServiceRequest implements SerializableCloneable {

    
A user-supplied identifier that uniquely identifies the DataSource.

Constraints:
Length: 1 - 64
Pattern: [a-zA-Z0-9_.-]+

 
     private String dataSourceId;

    
A user-supplied name or description of the DataSource.

Constraints:
Length: 0 - 1024
Pattern: .*\S.*|^$

 
     private String dataSourceName;

    
The data specification of a DataSource:
  • DataLocationS3 - Amazon Simple Storage Service (Amazon S3) location of the observation data.

  • DataSchemaLocationS3 - Amazon S3 location of the DataSchema.

  • DataSchema - A JSON string representing the schema. This is not required if DataSchemaUri is specified.

  • DataRearrangement - A JSON string representing the splitting requirement of a Datasource.

    Sample - "{\"randomSeed\":\"some-random-seed\", \"splitting\":{\"percentBegin\":10,\"percentEnd\":60}}"

    private S3DataSpec dataSpec;

    
The compute statistics for a DataSource. The statistics are generated from the observation data referenced by a DataSource. Amazon ML uses the statistics internally during an MLModel training. This parameter must be set to true if the DataSource needs to be used for MLModel training
    private Boolean computeStatistics;

    
A user-supplied identifier that uniquely identifies the DataSource.

Constraints:
Length: 1 - 64
Pattern: [a-zA-Z0-9_.-]+

Returns:
A user-supplied identifier that uniquely identifies the DataSource.
    public String getDataSourceId() {
        return ;
    }
    
    
A user-supplied identifier that uniquely identifies the DataSource.

Constraints:
Length: 1 - 64
Pattern: [a-zA-Z0-9_.-]+

Parameters:
dataSourceId A user-supplied identifier that uniquely identifies the DataSource.
    public void setDataSourceId(String dataSourceId) {
        this. = dataSourceId;
    }
    
    
A user-supplied identifier that uniquely identifies the DataSource.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 64
Pattern: [a-zA-Z0-9_.-]+

Parameters:
dataSourceId A user-supplied identifier that uniquely identifies the DataSource.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDataSourceFromS3Request withDataSourceId(String dataSourceId) {
        this. = dataSourceId;
        return this;
    }

    
A user-supplied name or description of the DataSource.

Constraints:
Length: 0 - 1024
Pattern: .*\S.*|^$

Returns:
A user-supplied name or description of the DataSource.
    public String getDataSourceName() {
        return ;
    }
    
    
A user-supplied name or description of the DataSource.

Constraints:
Length: 0 - 1024
Pattern: .*\S.*|^$

Parameters:
dataSourceName A user-supplied name or description of the DataSource.
    public void setDataSourceName(String dataSourceName) {
        this. = dataSourceName;
    }
    
    
A user-supplied name or description of the DataSource.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 1024
Pattern: .*\S.*|^$

Parameters:
dataSourceName A user-supplied name or description of the DataSource.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDataSourceFromS3Request withDataSourceName(String dataSourceName) {
        this. = dataSourceName;
        return this;
    }

    
The data specification of a DataSource:
  • DataLocationS3 - Amazon Simple Storage Service (Amazon S3) location of the observation data.

  • DataSchemaLocationS3 - Amazon S3 location of the DataSchema.

  • DataSchema - A JSON string representing the schema. This is not required if DataSchemaUri is specified.

  • DataRearrangement - A JSON string representing the splitting requirement of a Datasource.

    Sample - "{\"randomSeed\":\"some-random-seed\", \"splitting\":{\"percentBegin\":10,\"percentEnd\":60}}"

Returns:
The data specification of a DataSource:
  • DataLocationS3 - Amazon Simple Storage Service (Amazon S3) location of the observation data.

  • DataSchemaLocationS3 - Amazon S3 location of the DataSchema.

  • DataSchema - A JSON string representing the schema. This is not required if DataSchemaUri is specified.

  • DataRearrangement - A JSON string representing the splitting requirement of a Datasource.

    Sample - "{\"randomSeed\":\"some-random-seed\", \"splitting\":{\"percentBegin\":10,\"percentEnd\":60}}"

    public S3DataSpec getDataSpec() {
        return ;
    }
    
    
The data specification of a DataSource:
  • DataLocationS3 - Amazon Simple Storage Service (Amazon S3) location of the observation data.

  • DataSchemaLocationS3 - Amazon S3 location of the DataSchema.

  • DataSchema - A JSON string representing the schema. This is not required if DataSchemaUri is specified.

  • DataRearrangement - A JSON string representing the splitting requirement of a Datasource.

    Sample - "{\"randomSeed\":\"some-random-seed\", \"splitting\":{\"percentBegin\":10,\"percentEnd\":60}}"

Parameters:
dataSpec The data specification of a DataSource:
  • DataLocationS3 - Amazon Simple Storage Service (Amazon S3) location of the observation data.

  • DataSchemaLocationS3 - Amazon S3 location of the DataSchema.

  • DataSchema - A JSON string representing the schema. This is not required if DataSchemaUri is specified.

  • DataRearrangement - A JSON string representing the splitting requirement of a Datasource.

    Sample - "{\"randomSeed\":\"some-random-seed\", \"splitting\":{\"percentBegin\":10,\"percentEnd\":60}}"

    public void setDataSpec(S3DataSpec dataSpec) {
        this. = dataSpec;
    }
    
    
The data specification of a DataSource:
  • DataLocationS3 - Amazon Simple Storage Service (Amazon S3) location of the observation data.

  • DataSchemaLocationS3 - Amazon S3 location of the DataSchema.

  • DataSchema - A JSON string representing the schema. This is not required if DataSchemaUri is specified.

  • DataRearrangement - A JSON string representing the splitting requirement of a Datasource.

    Sample - "{\"randomSeed\":\"some-random-seed\", \"splitting\":{\"percentBegin\":10,\"percentEnd\":60}}"

Returns a reference to this object so that method calls can be chained together.

Parameters:
dataSpec The data specification of a DataSource:
  • DataLocationS3 - Amazon Simple Storage Service (Amazon S3) location of the observation data.

  • DataSchemaLocationS3 - Amazon S3 location of the DataSchema.

  • DataSchema - A JSON string representing the schema. This is not required if DataSchemaUri is specified.

  • DataRearrangement - A JSON string representing the splitting requirement of a Datasource.

    Sample - "{\"randomSeed\":\"some-random-seed\", \"splitting\":{\"percentBegin\":10,\"percentEnd\":60}}"

Returns:
A reference to this updated object so that method calls can be chained together.
        this. = dataSpec;
        return this;
    }

    
The compute statistics for a DataSource. The statistics are generated from the observation data referenced by a DataSource. Amazon ML uses the statistics internally during an MLModel training. This parameter must be set to true if the DataSource needs to be used for MLModel training

Returns:
The compute statistics for a DataSource. The statistics are generated from the observation data referenced by a DataSource. Amazon ML uses the statistics internally during an MLModel training. This parameter must be set to true if the DataSource needs to be used for MLModel training
    public Boolean isComputeStatistics() {
        return ;
    }
    
    
The compute statistics for a DataSource. The statistics are generated from the observation data referenced by a DataSource. Amazon ML uses the statistics internally during an MLModel training. This parameter must be set to true if the DataSource needs to be used for MLModel training

Parameters:
computeStatistics The compute statistics for a DataSource. The statistics are generated from the observation data referenced by a DataSource. Amazon ML uses the statistics internally during an MLModel training. This parameter must be set to true if the DataSource needs to be used for MLModel training
    public void setComputeStatistics(Boolean computeStatistics) {
        this. = computeStatistics;
    }
    
    
The compute statistics for a DataSource. The statistics are generated from the observation data referenced by a DataSource. Amazon ML uses the statistics internally during an MLModel training. This parameter must be set to true if the DataSource needs to be used for MLModel training

Returns a reference to this object so that method calls can be chained together.

Parameters:
computeStatistics The compute statistics for a DataSource. The statistics are generated from the observation data referenced by a DataSource. Amazon ML uses the statistics internally during an MLModel training. This parameter must be set to true if the DataSource needs to be used for MLModel training
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateDataSourceFromS3Request withComputeStatistics(Boolean computeStatistics) {
        this. = computeStatistics;
        return this;
    }

    
The compute statistics for a DataSource. The statistics are generated from the observation data referenced by a DataSource. Amazon ML uses the statistics internally during an MLModel training. This parameter must be set to true if the DataSource needs to be used for MLModel training

Returns:
The compute statistics for a DataSource. The statistics are generated from the observation data referenced by a DataSource. Amazon ML uses the statistics internally during an MLModel training. This parameter must be set to true if the DataSource needs to be used for MLModel training
    public Boolean getComputeStatistics() {
        return ;
    }

    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getDataSourceId() != nullsb.append("DataSourceId: " + getDataSourceId() + ",");
        if (getDataSourceName() != nullsb.append("DataSourceName: " + getDataSourceName() + ",");
        if (getDataSpec() != nullsb.append("DataSpec: " + getDataSpec() + ",");
        if (isComputeStatistics() != nullsb.append("ComputeStatistics: " + isComputeStatistics() );
        sb.append("}");
        return sb.toString();
    }
    
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        
        hashCode = prime * hashCode + ((getDataSourceId() == null) ? 0 : getDataSourceId().hashCode()); 
        hashCode = prime * hashCode + ((getDataSourceName() == null) ? 0 : getDataSourceName().hashCode()); 
        hashCode = prime * hashCode + ((getDataSpec() == null) ? 0 : getDataSpec().hashCode()); 
        hashCode = prime * hashCode + ((isComputeStatistics() == null) ? 0 : isComputeStatistics().hashCode()); 
        return hashCode;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (this == objreturn true;
        if (obj == nullreturn false;
        if (obj instanceof CreateDataSourceFromS3Request == falsereturn false;
        
        if (other.getDataSourceId() == null ^ this.getDataSourceId() == nullreturn false;
        if (other.getDataSourceId() != null && other.getDataSourceId().equals(this.getDataSourceId()) == falsereturn false
        if (other.getDataSourceName() == null ^ this.getDataSourceName() == nullreturn false;
        if (other.getDataSourceName() != null && other.getDataSourceName().equals(this.getDataSourceName()) == falsereturn false
        if (other.getDataSpec() == null ^ this.getDataSpec() == nullreturn false;
        if (other.getDataSpec() != null && other.getDataSpec().equals(this.getDataSpec()) == falsereturn false
        if (other.isComputeStatistics() == null ^ this.isComputeStatistics() == nullreturn false;
        if (other.isComputeStatistics() != null && other.isComputeStatistics().equals(this.isComputeStatistics()) == falsereturn false
        return true;
    }
    
    @Override
        
            return (CreateDataSourceFromS3Requestsuper.clone();
    }
}
    
New to GrepCode? Check out our FAQ X