当前位置: 首页>>代码示例>>Golang>>正文


Golang machinelearning.New函数代码示例

本文整理汇总了Golang中github.com/dragonfax/aws-sdk-go/service/machinelearning.New函数的典型用法代码示例。如果您正苦于以下问题:Golang New函数的具体用法?Golang New怎么用?Golang New使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了New函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。

示例1: 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 {
		// 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:marcosvm,项目名称:aws-sdk-go,代码行数:27,代码来源:examples_test.go

示例2: ExampleMachineLearning_DescribeMLModels

func ExampleMachineLearning_DescribeMLModels() {
	svc := machinelearning.New(nil)

	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:marcosvm,项目名称:aws-sdk-go,代码行数:28,代码来源:examples_test.go

示例3: 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.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:marcosvm,项目名称:aws-sdk-go,代码行数:26,代码来源:examples_test.go

示例4: 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 {
		// 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:marcosvm,项目名称:aws-sdk-go,代码行数:18,代码来源:examples_test.go

示例5: ExampleMachineLearning_DeleteRealtimeEndpoint

func ExampleMachineLearning_DeleteRealtimeEndpoint() {
	svc := machinelearning.New(nil)

	params := &machinelearning.DeleteRealtimeEndpointInput{
		MLModelId: aws.String("EntityId"), // Required
	}
	resp, err := svc.DeleteRealtimeEndpoint(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:marcosvm,项目名称:aws-sdk-go,代码行数:18,代码来源:examples_test.go

示例6: init

func init() {
	Before("@machinelearning", func() {
		World["client"] = machinelearning.New(nil)
	})

	When(`^I attempt to call the "(.+?)" API without the "(.+?)" parameter$`, func(s1 string, s2 string) {
		//		call(s1, nil, true)
		T.Skip() // pending
	})

	When(`^I attempt to call the "(.+?)" API with "(.+?)" parameter$`, func(s1 string, s2 string) {
		//		call(s1, nil, true)
		T.Skip() // pending
	})

	Then(`^the hostname should equal the "(.+?)" parameter$`, func(s1 string) {
		T.Skip() // pending
	})
}
开发者ID:marcosvm,项目名称:aws-sdk-go,代码行数:19,代码来源:client.go

示例7: ExampleMachineLearning_UpdateDataSource

func ExampleMachineLearning_UpdateDataSource() {
	svc := machinelearning.New(nil)

	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:marcosvm,项目名称:aws-sdk-go,代码行数:19,代码来源:examples_test.go

示例8: 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.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:marcosvm,项目名称:aws-sdk-go,代码行数:43,代码来源:examples_test.go

示例9: ExampleMachineLearning_UpdateMLModel

func ExampleMachineLearning_UpdateMLModel() {
	svc := machinelearning.New(nil)

	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:marcosvm,项目名称:aws-sdk-go,代码行数:20,代码来源:examples_test.go

示例10: TestPredictEndpoint

func TestPredictEndpoint(t *testing.T) {
	ml := machinelearning.New(nil)
	ml.Handlers.Send.Clear()
	ml.Handlers.Send.PushBack(func(r *request.Request) {
		r.HTTPResponse = &http.Response{
			StatusCode: 200,
			Header:     http.Header{},
			Body:       ioutil.NopCloser(bytes.NewReader([]byte("{}"))),
		}
	})

	req, _ := ml.PredictRequest(&machinelearning.PredictInput{
		PredictEndpoint: aws.String("https://localhost/endpoint"),
		MLModelId:       aws.String("id"),
		Record:          map[string]*string{},
	})
	err := req.Send()

	assert.Nil(t, err)
	assert.Equal(t, "https://localhost/endpoint", req.HTTPRequest.URL.String())
}
开发者ID:marcosvm,项目名称:aws-sdk-go,代码行数:21,代码来源:customizations_test.go

示例11: 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 {
		// 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:marcosvm,项目名称:aws-sdk-go,代码行数:22,代码来源:examples_test.go

示例12: 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 {
		// 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:marcosvm,项目名称:aws-sdk-go,代码行数:23,代码来源:examples_test.go

示例13: ExampleMachineLearning_CreateDataSourceFromRedshift

func ExampleMachineLearning_CreateDataSourceFromRedshift() {
	svc := machinelearning.New(nil)

	params := &machinelearning.CreateDataSourceFromRedshiftInput{
		DataSourceId: aws.String("EntityId"), // Required
		DataSpec: &machinelearning.RedshiftDataSpec{ // Required
			DatabaseCredentials: &machinelearning.RedshiftDatabaseCredentials{ // Required
				Password: aws.String("RedshiftDatabasePassword"), // Required
				Username: aws.String("RedshiftDatabaseUsername"), // Required
			},
			DatabaseInformation: &machinelearning.RedshiftDatabase{ // Required
				ClusterIdentifier: aws.String("RedshiftClusterIdentifier"), // Required
				DatabaseName:      aws.String("RedshiftDatabaseName"),      // Required
			},
			S3StagingLocation: aws.String("S3Url"),                  // Required
			SelectSqlQuery:    aws.String("RedshiftSelectSqlQuery"), // 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.CreateDataSourceFromRedshift(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:marcosvm,项目名称:aws-sdk-go,代码行数:36,代码来源:examples_test.go

示例14: TestInterface

func TestInterface(t *testing.T) {
	assert.Implements(t, (*machinelearningiface.MachineLearningAPI)(nil), machinelearning.New(nil))
}
开发者ID:marcosvm,项目名称:aws-sdk-go,代码行数:3,代码来源:interface_test.go

示例15: init

func init() {
	Before("@machinelearning", func() {
		World["client"] = machinelearning.New(nil)
	})
}
开发者ID:marcosvm,项目名称:aws-sdk-go,代码行数:5,代码来源:client.go


注:本文中的github.com/dragonfax/aws-sdk-go/service/machinelearning.New函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。