use of software.amazon.awssdk.services.personalize.PersonalizeClient in project aws-doc-sdk-examples by awsdocs.
the class ListCampaigns method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " ListCampaigns <solutionArn>\n\n" + "Where:\n" + " solutionArn - The ARN of the solution.\n\n";
if (args.length != 1) {
System.out.println(USAGE);
System.exit(1);
}
String solutionArn = args[0];
Region region = Region.US_EAST_1;
PersonalizeClient personalizeClient = PersonalizeClient.builder().region(region).build();
listAllCampaigns(personalizeClient, solutionArn);
personalizeClient.close();
}
use of software.amazon.awssdk.services.personalize.PersonalizeClient in project aws-doc-sdk-examples by awsdocs.
the class CreateBatchInferenceJob method main.
public static void main(String[] args) {
final String USAGE = "\n" + "Usage:\n" + " CreateDatasetImportJob <solutionVersionArn, jobName, roleArn, s3DataSource, s3DataDestination, explorationWeight," + "explorationItemAgeCutOff>\n\n" + "Where:\n" + " solutionVersionArn - The Amazon Resource Name (ARN) of the solution version you want to use.\n" + " jobName - The name for the batch inference job.\n" + " s3InputDataSource - The path to the Amazon S3 bucket where your input list of users or items is stored.\n" + " s3DataDestination - The path to the Amazon S3 bucket where Amazon Personalize will output the " + "batch recommendations.\n" + " roleArn - The ARN of the IAM service-linked role that" + "" + "has permissions to add data to your output Amazon S3 bucket.\n" + "" + " explorationWeight - A User-Personalization recipe specific field that specifies how " + "much to explore (how often to include new items in recommendations)\n" + " explorationItemAgeCutOff - A User-Personalization recipe specific field that defines " + "what Amazon Personalize considers a new item in exploration.\n\n";
// If omitting User-Personalization exploration fields, change from 7 to 5.
if (args.length != 7) {
System.out.println(USAGE);
System.exit(1);
}
String solutionVersionArn = args[0];
String jobName = args[1];
String s3InputDataSource = args[2];
String s3DataDestination = args[3];
String roleArn = args[4];
String explorationWeight = args[5];
String explorationItemAgeCutOff = args[6];
// Change to the region where your Amazon Personalize resources are located
Region region = Region.US_WEST_2;
PersonalizeClient personalizeClient = PersonalizeClient.builder().region(region).build();
String batchInferenceJobArn = createPersonalizeBatchInferenceJob(personalizeClient, solutionVersionArn, jobName, s3InputDataSource, s3DataDestination, roleArn, explorationWeight, explorationItemAgeCutOff);
System.out.println("Batch inference job ARN: " + batchInferenceJobArn);
personalizeClient.close();
}
use of software.amazon.awssdk.services.personalize.PersonalizeClient in project aws-doc-sdk-examples by awsdocs.
the class CreateDataset method main.
public static void main(String[] args) {
final String USAGE = "Usage:\n" + " CreateDataset <datasetName, dataset group arn, dataset type, schema arn>\n\n" + "Where:\n" + " name - The name for the dataset.\n" + " dataset group arn - The Amazon Resource Name (ARN) for the dataset group.\n" + " dataset type - The type of dataset (INTERACTIONS, USERS, or ITEMS).\n" + " schema arn - The ARN for the dataset's schema.\n\n";
if (args.length != 4) {
System.out.println(USAGE);
System.exit(1);
}
String datasetName = args[0];
String datasetGroupArn = args[1];
String datasetType = args[2];
String schemaArn = args[3];
// Change to the region where your resources are located
Region region = Region.US_WEST_2;
PersonalizeClient personalizeClient = PersonalizeClient.builder().region(region).build();
String datasetArn = createDataset(personalizeClient, datasetName, datasetGroupArn, datasetType, schemaArn);
System.out.println("Dataset ARN: " + datasetArn);
personalizeClient.close();
}
use of software.amazon.awssdk.services.personalize.PersonalizeClient in project aws-doc-sdk-examples by awsdocs.
the class CreateEventTracker method main.
public static void main(String[] args) {
final String USAGE = "Usage:\n" + " CreateDatasetGroup <name, datasetGroupArn>\n\n" + "Where:\n" + " datasetGroupArn - The Amazon Resource Name (ARN) of the dataset group that receives the event data\n" + " name - The name for the event tracker.\n\n";
if (args.length != 2) {
System.out.println(USAGE);
System.exit(1);
}
String datasetGroupArn = args[0];
String eventTrackerName = args[1];
Region region = Region.US_WEST_2;
PersonalizeClient personalizeClient = PersonalizeClient.builder().region(region).build();
String trackerId = createEventTracker(personalizeClient, eventTrackerName, datasetGroupArn);
System.out.println(trackerId);
personalizeClient.close();
}
use of software.amazon.awssdk.services.personalize.PersonalizeClient in project aws-doc-sdk-examples by awsdocs.
the class CreateSchema method main.
public static void main(String[] args) {
final String USAGE = "Usage:\n" + " CreateSchema <name, schemaLocation>\n\n" + "Where:\n" + " name - The name for the schema.\n" + " schemaLocation - the location of the schema JSON file.\n\n";
if (args.length != 2) {
System.out.println(USAGE);
System.exit(1);
}
String schemaName = args[0];
String filePath = args[1];
Region region = Region.US_WEST_2;
PersonalizeClient personalizeClient = PersonalizeClient.builder().region(region).build();
createSchema(personalizeClient, schemaName, filePath);
personalizeClient.close();
}
Aggregations