diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 78aaa61b..8959ba7b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,6 +34,7 @@ accept your pull requests. 1. Ensure that your code adheres to the existing style in the code to which you are contributing. 1. Ensure that your code has an appropriate set of tests which all pass. +1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. 1. Submit a pull request. ## Running the tests @@ -46,8 +47,16 @@ accept your pull requests. 1. Run the tests: + # Run all tests. npm test + # Run all unit tests. + npm run test-only + + # Run all system tests. + gcloud auth application-default login + npm run system-test + 1. Lint (and maybe fix) any changes: npm run fix diff --git a/src/types.d.ts b/src/types.d.ts index ef657c94..7323ab65 100644 --- a/src/types.d.ts +++ b/src/types.d.ts @@ -73,6 +73,103 @@ declare namespace bigquery { name?: string; }; + /** + * Arima coefficients. + */ + type IArimaCoefficients = { + /** + * Auto-regressive coefficients, an array of double. + */ + autoRegressiveCoefficients?: Array; + /** + * Intercept coefficient, just a double not an array. + */ + interceptCoefficient?: number; + /** + * Moving-average coefficients, an array of double. + */ + movingAverageCoefficients?: Array; + }; + + /** + * ARIMA model fitting metrics. + */ + type IArimaFittingMetrics = { + /** + * AIC + */ + aic?: number; + /** + * log-likelihood + */ + logLikelihood?: number; + /** + * variance. + */ + variance?: number; + }; + + /** + * Arima model information. + */ + type IArimaModelInfo = { + /** + * Arima coefficients. + */ + arimaCoefficients?: IArimaCoefficients; + /** + * Arima fitting metrics. + */ + arimaFittingMetrics?: IArimaFittingMetrics; + /** + * Non-seasonal order. + */ + nonSeasonalOrder?: IArimaOrder; + }; + + /** + * Arima order, can be used for both non-seasonal and seasonal parts. + */ + type IArimaOrder = { + /** + * Order of the differencing part. + */ + d?: string; + /** + * Order of the autoregressive part. + */ + p?: string; + /** + * Order of the moving-average part. + */ + q?: string; + }; + + /** + * (Auto-)arima fitting result. Wrap everything in ArimaResult for easier + * refactoring if we want to use model-specific iteration results. + */ + type IArimaResult = { + /** + * This message is repeated because there are multiple arima models + * fitted in auto-arima. For non-auto-arima model, its size is one. + */ + arimaModelInfo?: Array; + /** + * Seasonal periods. Repeated because multiple periods are supported for + * one time series. + */ + seasonalPeriods?: Array< + | 'SEASONAL_PERIOD_TYPE_UNSPECIFIED' + | 'NO_SEASONALITY' + | 'DAILY' + | 'WEEKLY' + | 'MONTHLY' + | 'QUARTERLY' + | 'YEARLY' + >; + }; + type IBigQueryModelTraining = { /** * [Output-only, Beta] Index of current ML training iteration. Updated during create model query job to show job progress. @@ -910,6 +1007,7 @@ declare namespace bigquery { * Information about a single iteration of the training run. */ type IIterationResult = { + arimaResult?: IArimaResult; /** * Information about top clusters for clustering models. */ diff --git a/synth.metadata b/synth.metadata index 178fc9a3..cc91ef80 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,5 +1,5 @@ { - "updateTime": "2019-10-01T11:09:53.670779Z", + "updateTime": "2019-10-08T11:09:26.452867Z", "sources": [ { "template": {