Skip to content

Commit ae5629e

Browse files
author
awstools
committed
feat(client-forecast): Added Format field to Import and Export APIs in Amazon Forecast. Added TimeSeriesSelector to Create Forecast API.
1 parent d277dd7 commit ae5629e

File tree

7 files changed

+316
-21
lines changed

7 files changed

+316
-21
lines changed

clients/client-forecast/src/Forecast.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -462,18 +462,14 @@ export class Forecast extends ForecastClient {
462462
* AWS Identity and Access Management (IAM) role that Amazon Forecast can assume to access the data, as Amazon Forecast makes a copy
463463
* of your data and processes it in an internal AWS system. For more information, see <a href="https://docs.aws.amazon.com/forecast/latest/dg/aws-forecast-iam-roles.html">Set up
464464
* permissions</a>.</p>
465-
* <p>The training data must be in CSV format. The delimiter must be a comma (,).</p>
466-
* <p>You can specify the path to a specific CSV file, the S3 bucket, or to a folder in the S3
465+
* <p>The training data must be in CSV or Parquet format. The delimiter must be a comma (,).</p>
466+
* <p>You can specify the path to a specific file, the S3 bucket, or to a folder in the S3
467467
* bucket. For the latter two cases, Amazon Forecast imports all files up to the limit of 10,000
468468
* files.</p>
469-
*
470-
*
471469
* <p>Because dataset imports are not aggregated, your most recent dataset import is the one
472470
* that is used when training a predictor or generating a forecast. Make sure that your most
473471
* recent dataset import contains all of the data you want to model off of, and not just the new
474472
* data collected since the previous import.</p>
475-
*
476-
*
477473
* <p>To get a list of all your dataset import jobs, filtered by specified criteria, use the
478474
* <a href="https://docs.aws.amazon.com/forecast/latest/dg/API_ListDatasetImportJobs.html">ListDatasetImportJobs</a> operation.</p>
479475
*/
@@ -716,6 +712,8 @@ export class Forecast extends ForecastClient {
716712
* or export the forecast. Use the <a>DescribeForecast</a> operation to get the
717713
* status.</p>
718714
* </note>
715+
* <p>By default, a forecast includes predictions for every item (<code>item_id</code>) in the dataset group that was used to train the predictor.
716+
* However, you can use the <code>TimeSeriesSelector</code> object to generate a forecast on a subset of time series. Forecast creation is skipped for any time series that you specify that are not in the input dataset. The forecast export file will not contain these time series or their forecasted values.</p>
719717
*/
720718
public createForecast(
721719
args: CreateForecastCommandInput,
@@ -921,7 +919,7 @@ export class Forecast extends ForecastClient {
921919

922920
/**
923921
* <p>Exports backtest forecasts and accuracy metrics generated by the <a>CreateAutoPredictor</a> or <a>CreatePredictor</a> operations. Two
924-
* folders containing CSV files are exported to your specified S3 bucket.</p>
922+
* folders containing CSV or Parquet files are exported to your specified S3 bucket.</p>
925923
* <p> The export file names will match the following conventions:</p>
926924
* <p>
927925
* <code><ExportJobName>_<ExportTimestamp>_<PartNumber>.csv</code>

clients/client-forecast/src/commands/CreateDatasetImportJobCommand.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,14 @@ export interface CreateDatasetImportJobCommandOutput extends CreateDatasetImport
3030
* AWS Identity and Access Management (IAM) role that Amazon Forecast can assume to access the data, as Amazon Forecast makes a copy
3131
* of your data and processes it in an internal AWS system. For more information, see <a href="https://docs.aws.amazon.com/forecast/latest/dg/aws-forecast-iam-roles.html">Set up
3232
* permissions</a>.</p>
33-
* <p>The training data must be in CSV format. The delimiter must be a comma (,).</p>
34-
* <p>You can specify the path to a specific CSV file, the S3 bucket, or to a folder in the S3
33+
* <p>The training data must be in CSV or Parquet format. The delimiter must be a comma (,).</p>
34+
* <p>You can specify the path to a specific file, the S3 bucket, or to a folder in the S3
3535
* bucket. For the latter two cases, Amazon Forecast imports all files up to the limit of 10,000
3636
* files.</p>
37-
*
38-
*
3937
* <p>Because dataset imports are not aggregated, your most recent dataset import is the one
4038
* that is used when training a predictor or generating a forecast. Make sure that your most
4139
* recent dataset import contains all of the data you want to model off of, and not just the new
4240
* data collected since the previous import.</p>
43-
*
44-
*
4541
* <p>To get a list of all your dataset import jobs, filtered by specified criteria, use the
4642
* <a href="https://docs.aws.amazon.com/forecast/latest/dg/API_ListDatasetImportJobs.html">ListDatasetImportJobs</a> operation.</p>
4743
* @example

clients/client-forecast/src/commands/CreateForecastCommand.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export interface CreateForecastCommandOutput extends CreateForecastResponse, __M
4242
* or export the forecast. Use the <a>DescribeForecast</a> operation to get the
4343
* status.</p>
4444
* </note>
45+
* <p>By default, a forecast includes predictions for every item (<code>item_id</code>) in the dataset group that was used to train the predictor.
46+
* However, you can use the <code>TimeSeriesSelector</code> object to generate a forecast on a subset of time series. Forecast creation is skipped for any time series that you specify that are not in the input dataset. The forecast export file will not contain these time series or their forecasted values.</p>
4547
* @example
4648
* Use a bare-bones client and the command you need to make an API call.
4749
* ```javascript

clients/client-forecast/src/commands/CreatePredictorBacktestExportJobCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export interface CreatePredictorBacktestExportJobCommandOutput
2626

2727
/**
2828
* <p>Exports backtest forecasts and accuracy metrics generated by the <a>CreateAutoPredictor</a> or <a>CreatePredictor</a> operations. Two
29-
* folders containing CSV files are exported to your specified S3 bucket.</p>
29+
* folders containing CSV or Parquet files are exported to your specified S3 bucket.</p>
3030
* <p> The export file names will match the following conventions:</p>
3131
* <p>
3232
* <code><ExportJobName>_<ExportTimestamp>_<PartNumber>.csv</code>

clients/client-forecast/src/models/models_0.ts

Lines changed: 137 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,6 +1284,11 @@ export interface CreateDatasetImportJobRequest {
12841284
* </ul>
12851285
*/
12861286
Tags?: Tag[];
1287+
1288+
/**
1289+
* <p>The format of the imported data, CSV or PARQUET. The default value is CSV.</p>
1290+
*/
1291+
Format?: string;
12871292
}
12881293

12891294
export namespace CreateDatasetImportJobRequest {
@@ -1338,7 +1343,7 @@ export interface ExplainabilityConfig {
13381343
* <p>To create an Explainability for all time series in your datasets, use
13391344
* <code>ALL</code>. To create an Explainability for specific time series in your datasets,
13401345
* use <code>SPECIFIC</code>.</p>
1341-
* <p>Specify time series by uploading a CSV file to an Amazon S3 bucket and set the location
1346+
* <p>Specify time series by uploading a CSV or Parquet file to an Amazon S3 bucket and set the location
13421347
* within the <a>DataDestination</a> data type.</p>
13431348
*/
13441349
TimeSeriesGranularity: TimeSeriesGranularity | string | undefined;
@@ -1548,6 +1553,11 @@ export interface CreateExplainabilityExportRequest {
15481553
* </ul>
15491554
*/
15501555
Tags?: Tag[];
1556+
1557+
/**
1558+
* <p>The format of the exported data, CSV or PARQUET.</p>
1559+
*/
1560+
Format?: string;
15511561
}
15521562

15531563
export namespace CreateExplainabilityExportRequest {
@@ -1576,6 +1586,73 @@ export namespace CreateExplainabilityExportResponse {
15761586
});
15771587
}
15781588

1589+
/**
1590+
* <p>Details about the import file that contains the time series for which you want to create forecasts.</p>
1591+
*/
1592+
export interface TimeSeriesIdentifiers {
1593+
/**
1594+
* <p>The source of your data, an AWS Identity and Access Management (IAM) role that allows Amazon Forecast to
1595+
* access the data and, optionally, an AWS Key Management Service (KMS) key.</p>
1596+
*/
1597+
DataSource?: DataSource;
1598+
1599+
/**
1600+
* <p>Defines the fields of a dataset.</p>
1601+
*/
1602+
Schema?: Schema;
1603+
1604+
/**
1605+
* <p>The format of the data, either CSV or PARQUET.</p>
1606+
*/
1607+
Format?: string;
1608+
}
1609+
1610+
export namespace TimeSeriesIdentifiers {
1611+
/**
1612+
* @internal
1613+
*/
1614+
export const filterSensitiveLog = (obj: TimeSeriesIdentifiers): any => ({
1615+
...obj,
1616+
});
1617+
}
1618+
1619+
/**
1620+
* <p>Defines the set of time series that are used to create the forecasts in a <code>TimeSeriesIdentifiers</code> object.</p>
1621+
* <p>The <code>TimeSeriesIdentifiers</code> object needs the following information:</p>
1622+
* <ul>
1623+
* <li>
1624+
* <p>
1625+
* <code>DataSource</code>
1626+
* </p>
1627+
* </li>
1628+
* <li>
1629+
* <p>
1630+
* <code>Format</code>
1631+
* </p>
1632+
* </li>
1633+
* <li>
1634+
* <p>
1635+
* <code>Schema</code>
1636+
* </p>
1637+
* </li>
1638+
* </ul>
1639+
*/
1640+
export interface TimeSeriesSelector {
1641+
/**
1642+
* <p>Details about the import file that contains the time series for which you want to create forecasts.</p>
1643+
*/
1644+
TimeSeriesIdentifiers?: TimeSeriesIdentifiers;
1645+
}
1646+
1647+
export namespace TimeSeriesSelector {
1648+
/**
1649+
* @internal
1650+
*/
1651+
export const filterSensitiveLog = (obj: TimeSeriesSelector): any => ({
1652+
...obj,
1653+
});
1654+
}
1655+
15791656
export interface CreateForecastRequest {
15801657
/**
15811658
* <p>A name for the forecast.</p>
@@ -1638,6 +1715,29 @@ export interface CreateForecastRequest {
16381715
* </ul>
16391716
*/
16401717
Tags?: Tag[];
1718+
1719+
/**
1720+
* <p>Defines the set of time series that are used to create the forecasts in a <code>TimeSeriesIdentifiers</code> object.</p>
1721+
* <p>The <code>TimeSeriesIdentifiers</code> object needs the following information:</p>
1722+
* <ul>
1723+
* <li>
1724+
* <p>
1725+
* <code>DataSource</code>
1726+
* </p>
1727+
* </li>
1728+
* <li>
1729+
* <p>
1730+
* <code>Format</code>
1731+
* </p>
1732+
* </li>
1733+
* <li>
1734+
* <p>
1735+
* <code>Schema</code>
1736+
* </p>
1737+
* </li>
1738+
* </ul>
1739+
*/
1740+
TimeSeriesSelector?: TimeSeriesSelector;
16411741
}
16421742

16431743
export namespace CreateForecastRequest {
@@ -1725,6 +1825,11 @@ export interface CreateForecastExportJobRequest {
17251825
* </ul>
17261826
*/
17271827
Tags?: Tag[];
1828+
1829+
/**
1830+
* <p>The format of the exported data, CSV or PARQUET. The default value is CSV.</p>
1831+
*/
1832+
Format?: string;
17281833
}
17291834

17301835
export namespace CreateForecastExportJobRequest {
@@ -2831,6 +2936,11 @@ export interface CreatePredictorBacktestExportJobRequest {
28312936
* </ul>
28322937
*/
28332938
Tags?: Tag[];
2939+
2940+
/**
2941+
* <p>The format of the exported data, CSV or PARQUET. The default value is CSV.</p>
2942+
*/
2943+
Format?: string;
28342944
}
28352945

28362946
export namespace CreatePredictorBacktestExportJobRequest {
@@ -3803,6 +3913,11 @@ export interface DescribeDatasetImportJobResponse {
38033913
* </ul>
38043914
*/
38053915
LastModificationTime?: Date;
3916+
3917+
/**
3918+
* <p>The format of the imported data, CSV or PARQUET.</p>
3919+
*/
3920+
Format?: string;
38063921
}
38073922

38083923
export namespace DescribeDatasetImportJobResponse {
@@ -3993,7 +4108,7 @@ export interface DescribeExplainabilityExportResponse {
39934108
ExplainabilityExportName?: string;
39944109

39954110
/**
3996-
* <p>The Amazon Resource Name (ARN) of the Explainability.</p>
4111+
* <p>The Amazon Resource Name (ARN) of the Explainability export.</p>
39974112
*/
39984113
ExplainabilityArn?: string;
39994114

@@ -4070,6 +4185,11 @@ export interface DescribeExplainabilityExportResponse {
40704185
* </ul>
40714186
*/
40724187
LastModificationTime?: Date;
4188+
4189+
/**
4190+
* <p>The format of the exported data, CSV or PARQUET.</p>
4191+
*/
4192+
Format?: string;
40734193
}
40744194

40754195
export namespace DescribeExplainabilityExportResponse {
@@ -4198,6 +4318,11 @@ export interface DescribeForecastResponse {
41984318
* </ul>
41994319
*/
42004320
LastModificationTime?: Date;
4321+
4322+
/**
4323+
* <p>The time series to include in the forecast.</p>
4324+
*/
4325+
TimeSeriesSelector?: TimeSeriesSelector;
42014326
}
42024327

42034328
export namespace DescribeForecastResponse {
@@ -4316,6 +4441,11 @@ export interface DescribeForecastExportJobResponse {
43164441
* </ul>
43174442
*/
43184443
LastModificationTime?: Date;
4444+
4445+
/**
4446+
* <p>The format of the exported data, CSV or PARQUET.</p>
4447+
*/
4448+
Format?: string;
43194449
}
43204450

43214451
export namespace DescribeForecastExportJobResponse {
@@ -4895,6 +5025,11 @@ export interface DescribePredictorBacktestExportJobResponse {
48955025
* </ul>
48965026
*/
48975027
LastModificationTime?: Date;
5028+
5029+
/**
5030+
* <p>The format of the exported data, CSV or PARQUET.</p>
5031+
*/
5032+
Format?: string;
48985033
}
48995034

49005035
export namespace DescribePredictorBacktestExportJobResponse {

0 commit comments

Comments
 (0)