本文整理汇总了Golang中github.com/aws/aws-sdk-go/service/machinelearning.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了New函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: ExampleMachineLearning_CreateMLModel
func ExampleMachineLearning_CreateMLModel() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := machinelearning.New(sess)
params := &machinelearning.CreateMLModelInput{
MLModelId: aws.String("EntityId"), // Required
MLModelType: aws.String("MLModelType"), // Required
TrainingDataSourceId: aws.String("EntityId"), // Required
MLModelName: aws.String("EntityName"),
Parameters: map[string]*string{
"Key": aws.String("StringType"), // Required
// More values...
},
Recipe: aws.String("Recipe"),
RecipeUri: aws.String("S3Url"),
}
resp, err := svc.CreateMLModel(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:33,代码来源:examples_test.go
示例2: ExampleMachineLearning_UpdateMLModel
func ExampleMachineLearning_UpdateMLModel() {
svc := machinelearning.New(nil)
params := &machinelearning.UpdateMLModelInput{
MLModelID: aws.String("EntityId"), // Required
MLModelName: aws.String("EntityName"),
ScoreThreshold: aws.Double(1.0),
}
resp, err := svc.UpdateMLModel(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
开发者ID:reyco,项目名称:aws-sdk-go,代码行数:28,代码来源:examples_test.go
示例3: ExampleMachineLearning_CreateBatchPrediction
func ExampleMachineLearning_CreateBatchPrediction() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := machinelearning.New(sess)
params := &machinelearning.CreateBatchPredictionInput{
BatchPredictionDataSourceId: aws.String("EntityId"), // Required
BatchPredictionId: aws.String("EntityId"), // Required
MLModelId: aws.String("EntityId"), // Required
OutputUri: aws.String("S3Url"), // Required
BatchPredictionName: aws.String("EntityName"),
}
resp, err := svc.CreateBatchPrediction(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:28,代码来源:examples_test.go
示例4: ExampleMachineLearning_CreateBatchPrediction
func ExampleMachineLearning_CreateBatchPrediction() {
svc := machinelearning.New(nil)
params := &machinelearning.CreateBatchPredictionInput{
BatchPredictionDataSourceID: aws.String("EntityId"), // Required
BatchPredictionID: aws.String("EntityId"), // Required
MLModelID: aws.String("EntityId"), // Required
OutputURI: aws.String("S3Url"), // Required
BatchPredictionName: aws.String("EntityName"),
}
resp, err := svc.CreateBatchPrediction(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS Error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
开发者ID:jasonmoo,项目名称:aws-sdk-go,代码行数:30,代码来源:examples_test.go
示例5: ExampleMachineLearning_Predict
func ExampleMachineLearning_Predict() {
svc := machinelearning.New(nil)
params := &machinelearning.PredictInput{
MLModelID: aws.String("EntityId"), // Required
PredictEndpoint: aws.String("VipURL"), // Required
Record: map[string]*string{ // Required
"Key": aws.String("VariableValue"), // Required
// More values...
},
}
resp, err := svc.Predict(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
开发者ID:reyco,项目名称:aws-sdk-go,代码行数:31,代码来源:examples_test.go
示例6: ExampleMachineLearning_CreateDataSourceFromS3
func ExampleMachineLearning_CreateDataSourceFromS3() {
svc := machinelearning.New(nil)
params := &machinelearning.CreateDataSourceFromS3Input{
DataSourceID: aws.String("EntityId"), // Required
DataSpec: &machinelearning.S3DataSpec{ // Required
DataLocationS3: aws.String("S3Url"), // Required
DataRearrangement: aws.String("DataRearrangement"),
DataSchema: aws.String("DataSchema"),
DataSchemaLocationS3: aws.String("S3Url"),
},
ComputeStatistics: aws.Boolean(true),
DataSourceName: aws.String("EntityName"),
}
resp, err := svc.CreateDataSourceFromS3(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
开发者ID:reyco,项目名称:aws-sdk-go,代码行数:34,代码来源:examples_test.go
示例7: ExampleMachineLearning_Predict
func ExampleMachineLearning_Predict() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := machinelearning.New(sess)
params := &machinelearning.PredictInput{
MLModelId: aws.String("EntityId"), // Required
PredictEndpoint: aws.String("VipURL"), // Required
Record: map[string]*string{ // Required
"Key": aws.String("VariableValue"), // Required
// More values...
},
}
resp, err := svc.Predict(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:29,代码来源:examples_test.go
示例8: ExampleMachineLearning_DescribeMLModels
func ExampleMachineLearning_DescribeMLModels() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := machinelearning.New(sess)
params := &machinelearning.DescribeMLModelsInput{
EQ: aws.String("ComparatorValue"),
FilterVariable: aws.String("MLModelFilterVariable"),
GE: aws.String("ComparatorValue"),
GT: aws.String("ComparatorValue"),
LE: aws.String("ComparatorValue"),
LT: aws.String("ComparatorValue"),
Limit: aws.Int64(1),
NE: aws.String("ComparatorValue"),
NextToken: aws.String("StringType"),
Prefix: aws.String("ComparatorValue"),
SortOrder: aws.String("SortOrder"),
}
resp, err := svc.DescribeMLModels(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:34,代码来源:examples_test.go
示例9: ExampleMachineLearning_DescribeTags
func ExampleMachineLearning_DescribeTags() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := machinelearning.New(sess)
params := &machinelearning.DescribeTagsInput{
ResourceId: aws.String("EntityId"), // Required
ResourceType: aws.String("TaggableResourceType"), // Required
}
resp, err := svc.DescribeTags(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:25,代码来源:examples_test.go
示例10: ExampleMachineLearning_GetMLModel
func ExampleMachineLearning_GetMLModel() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := machinelearning.New(sess)
params := &machinelearning.GetMLModelInput{
MLModelId: aws.String("EntityId"), // Required
Verbose: aws.Bool(true),
}
resp, err := svc.GetMLModel(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:25,代码来源:examples_test.go
示例11: ExampleMachineLearning_DescribeDataSources
func ExampleMachineLearning_DescribeDataSources() {
svc := machinelearning.New(nil)
params := &machinelearning.DescribeDataSourcesInput{
EQ: aws.String("ComparatorValue"),
FilterVariable: aws.String("DataSourceFilterVariable"),
GE: aws.String("ComparatorValue"),
GT: aws.String("ComparatorValue"),
LE: aws.String("ComparatorValue"),
LT: aws.String("ComparatorValue"),
Limit: aws.Int64(1),
NE: aws.String("ComparatorValue"),
NextToken: aws.String("StringType"),
Prefix: aws.String("ComparatorValue"),
SortOrder: aws.String("SortOrder"),
}
resp, err := svc.DescribeDataSources(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
开发者ID:jloper3,项目名称:amazon-ecs-cli,代码行数:28,代码来源:examples_test.go
示例12: ExampleMachineLearning_GetEvaluation
func ExampleMachineLearning_GetEvaluation() {
svc := machinelearning.New(nil)
params := &machinelearning.GetEvaluationInput{
EvaluationId: aws.String("EntityId"), // Required
}
resp, err := svc.GetEvaluation(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.Prettify(resp))
}
开发者ID:strife25,项目名称:aws-sdk-go,代码行数:26,代码来源:examples_test.go
示例13: ExampleMachineLearning_CreateDataSourceFromS3
func ExampleMachineLearning_CreateDataSourceFromS3() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := machinelearning.New(sess)
params := &machinelearning.CreateDataSourceFromS3Input{
DataSourceId: aws.String("EntityId"), // Required
DataSpec: &machinelearning.S3DataSpec{ // Required
DataLocationS3: aws.String("S3Url"), // Required
DataRearrangement: aws.String("DataRearrangement"),
DataSchema: aws.String("DataSchema"),
DataSchemaLocationS3: aws.String("S3Url"),
},
ComputeStatistics: aws.Bool(true),
DataSourceName: aws.String("EntityName"),
}
resp, err := svc.CreateDataSourceFromS3(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:32,代码来源:examples_test.go
示例14: ExampleMachineLearning_UpdateDataSource
func ExampleMachineLearning_UpdateDataSource() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := machinelearning.New(sess)
params := &machinelearning.UpdateDataSourceInput{
DataSourceId: aws.String("EntityId"), // Required
DataSourceName: aws.String("EntityName"), // Required
}
resp, err := svc.UpdateDataSource(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:25,代码来源:examples_test.go
示例15: ExampleMachineLearning_UpdateMLModel
func ExampleMachineLearning_UpdateMLModel() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := machinelearning.New(sess)
params := &machinelearning.UpdateMLModelInput{
MLModelId: aws.String("EntityId"), // Required
MLModelName: aws.String("EntityName"),
ScoreThreshold: aws.Float64(1.0),
}
resp, err := svc.UpdateMLModel(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:26,代码来源:examples_test.go
示例16: ExampleMachineLearning_AddTags
func ExampleMachineLearning_AddTags() {
svc := machinelearning.New(session.New())
params := &machinelearning.AddTagsInput{
ResourceId: aws.String("EntityId"), // Required
ResourceType: aws.String("TaggableResourceType"), // Required
Tags: []*machinelearning.Tag{ // Required
{ // Required
Key: aws.String("TagKey"),
Value: aws.String("TagValue"),
},
// More values...
},
}
resp, err := svc.AddTags(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
开发者ID:ColourboxDevelopment,项目名称:aws-sdk-go,代码行数:26,代码来源:examples_test.go
示例17: ExampleMachineLearning_CreateMLModel
func ExampleMachineLearning_CreateMLModel() {
svc := machinelearning.New(nil)
params := &machinelearning.CreateMLModelInput{
MLModelID: aws.String("EntityId"), // Required
MLModelType: aws.String("MLModelType"), // Required
TrainingDataSourceID: aws.String("EntityId"), // Required
MLModelName: aws.String("EntityName"),
Parameters: map[string]*string{
"Key": aws.String("StringType"), // Required
// More values...
},
Recipe: aws.String("Recipe"),
RecipeURI: aws.String("S3Url"),
}
resp, err := svc.CreateMLModel(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
开发者ID:reyco,项目名称:aws-sdk-go,代码行数:35,代码来源:examples_test.go
示例18: ExampleMachineLearning_CreateDataSourceFromRDS
func ExampleMachineLearning_CreateDataSourceFromRDS() {
svc := machinelearning.New(nil)
params := &machinelearning.CreateDataSourceFromRDSInput{
DataSourceID: aws.String("EntityId"), // Required
RDSData: &machinelearning.RDSDataSpec{ // Required
DatabaseCredentials: &machinelearning.RDSDatabaseCredentials{ // Required
Password: aws.String("RDSDatabasePassword"), // Required
Username: aws.String("RDSDatabaseUsername"), // Required
},
DatabaseInformation: &machinelearning.RDSDatabase{ // Required
DatabaseName: aws.String("RDSDatabaseName"), // Required
InstanceIdentifier: aws.String("RDSInstanceIdentifier"), // Required
},
ResourceRole: aws.String("EDPResourceRole"), // Required
S3StagingLocation: aws.String("S3Url"), // Required
SecurityGroupIDs: []*string{ // Required
aws.String("EDPSecurityGroupId"), // Required
// More values...
},
SelectSQLQuery: aws.String("RDSSelectSqlQuery"), // Required
ServiceRole: aws.String("EDPServiceRole"), // Required
SubnetID: aws.String("EDPSubnetId"), // Required
DataRearrangement: aws.String("DataRearrangement"),
DataSchema: aws.String("DataSchema"),
DataSchemaURI: aws.String("S3Url"),
},
RoleARN: aws.String("RoleARN"), // Required
ComputeStatistics: aws.Boolean(true),
DataSourceName: aws.String("EntityName"),
}
resp, err := svc.CreateDataSourceFromRDS(params)
if err != nil {
if awsErr, ok := err.(awserr.Error); ok {
// Generic AWS error with Code, Message, and original error (if any)
fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
if reqErr, ok := err.(awserr.RequestFailure); ok {
// A service error occurred
fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
}
} else {
// This case should never be hit, the SDK should always return an
// error which satisfies the awserr.Error interface.
fmt.Println(err.Error())
}
}
// Pretty-print the response data.
fmt.Println(awsutil.StringValue(resp))
}
开发者ID:reyco,项目名称:aws-sdk-go,代码行数:51,代码来源:examples_test.go
示例19: ExampleMachineLearning_CreateDataSourceFromRDS
func ExampleMachineLearning_CreateDataSourceFromRDS() {
sess, err := session.NewSession()
if err != nil {
fmt.Println("failed to create session,", err)
return
}
svc := machinelearning.New(sess)
params := &machinelearning.CreateDataSourceFromRDSInput{
DataSourceId: aws.String("EntityId"), // Required
RDSData: &machinelearning.RDSDataSpec{ // Required
DatabaseCredentials: &machinelearning.RDSDatabaseCredentials{ // Required
Password: aws.String("RDSDatabasePassword"), // Required
Username: aws.String("RDSDatabaseUsername"), // Required
},
DatabaseInformation: &machinelearning.RDSDatabase{ // Required
DatabaseName: aws.String("RDSDatabaseName"), // Required
InstanceIdentifier: aws.String("RDSInstanceIdentifier"), // Required
},
ResourceRole: aws.String("EDPResourceRole"), // Required
S3StagingLocation: aws.String("S3Url"), // Required
SecurityGroupIds: []*string{ // Required
aws.String("EDPSecurityGroupId"), // Required
// More values...
},
SelectSqlQuery: aws.String("RDSSelectSqlQuery"), // Required
ServiceRole: aws.String("EDPServiceRole"), // Required
SubnetId: aws.String("EDPSubnetId"), // Required
DataRearrangement: aws.String("DataRearrangement"),
DataSchema: aws.String("DataSchema"),
DataSchemaUri: aws.String("S3Url"),
},
RoleARN: aws.String("RoleARN"), // Required
ComputeStatistics: aws.Bool(true),
DataSourceName: aws.String("EntityName"),
}
resp, err := svc.CreateDataSourceFromRDS(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
开发者ID:acquia,项目名称:fifo2kinesis,代码行数:49,代码来源:examples_test.go
示例20: ExampleMachineLearning_GetEvaluation
func ExampleMachineLearning_GetEvaluation() {
svc := machinelearning.New(session.New())
params := &machinelearning.GetEvaluationInput{
EvaluationId: aws.String("EntityId"), // Required
}
resp, err := svc.GetEvaluation(params)
if err != nil {
// Print the error, cast err to awserr.Error to get the Code and
// Message from an error.
fmt.Println(err.Error())
return
}
// Pretty-print the response data.
fmt.Println(resp)
}
开发者ID:ColourboxDevelopment,项目名称:aws-sdk-go,代码行数:18,代码来源:examples_test.go
注:本文中的github.com/aws/aws-sdk-go/service/machinelearning.New函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论