# RandomCutForestConfigurationProperty

Configuration for the Random Cut Forest algorithm used for anomaly detection in time-series data.

- Source: Generated at build time
- Type last changed: v2.221.0 · 24 Oct 2025

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_aps as aps } from 'aws-cdk-lib';
const randomCutForestConfigurationProperty: aps.CfnAnomalyDetector.RandomCutForestConfigurationProperty = {
  query: 'query',

  // the properties below are optional
  ignoreNearExpectedFromAbove: {
    amount: 123,
    ratio: 123,
  },
  ignoreNearExpectedFromBelow: {
    amount: 123,
    ratio: 123,
  },
  sampleSize: 123,
  shingleSize: 123,
};
```

Python:

```python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_aps as aps

random_cut_forest_configuration_property = aps.CfnAnomalyDetector.RandomCutForestConfigurationProperty(
    query="query",

    # the properties below are optional
    ignore_near_expected_from_above=aps.CfnAnomalyDetector.IgnoreNearExpectedProperty(
        amount=123,
        ratio=123
    ),
    ignore_near_expected_from_below=aps.CfnAnomalyDetector.IgnoreNearExpectedProperty(
        amount=123,
        ratio=123
    ),
    sample_size=123,
    shingle_size=123
)
```

Java:

```java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.aps.*;

RandomCutForestConfigurationProperty randomCutForestConfigurationProperty = RandomCutForestConfigurationProperty.builder()
        .query("query")

        // the properties below are optional
        .ignoreNearExpectedFromAbove(IgnoreNearExpectedProperty.builder()
                .amount(123)
                .ratio(123)
                .build())
        .ignoreNearExpectedFromBelow(IgnoreNearExpectedProperty.builder()
                .amount(123)
                .ratio(123)
                .build())
        .sampleSize(123)
        .shingleSize(123)
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.APS;

var randomCutForestConfigurationProperty = new RandomCutForestConfigurationProperty {
    Query = "query",

    // the properties below are optional
    IgnoreNearExpectedFromAbove = new IgnoreNearExpectedProperty {
        Amount = 123,
        Ratio = 123
    },
    IgnoreNearExpectedFromBelow = new IgnoreNearExpectedProperty {
        Amount = 123,
        Ratio = 123
    },
    SampleSize = 123,
    ShingleSize = 123
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"

randomCutForestConfigurationProperty := &RandomCutForestConfigurationProperty{
	Query: jsii.String("query"),

	// the properties below are optional
	IgnoreNearExpectedFromAbove: &IgnoreNearExpectedProperty{
		Amount: jsii.Number(123),
		Ratio: jsii.Number(123),
	},
	IgnoreNearExpectedFromBelow: &IgnoreNearExpectedProperty{
		Amount: jsii.Number(123),
		Ratio: jsii.Number(123),
	},
	SampleSize: jsii.Number(123),
	ShingleSize: jsii.Number(123),
}
```

## Properties

- `ignoreNearExpectedFromAbove`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnAnomalyDetector.IgnoreNearExpectedProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_aps.CfnAnomalyDetector.IgnoreNearExpectedProperty.html) — Configuration for ignoring values that are near expected values from above during anomaly detection.

- `ignoreNearExpectedFromBelow`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnAnomalyDetector.IgnoreNearExpectedProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_aps.CfnAnomalyDetector.IgnoreNearExpectedProperty.html) — Configuration for ignoring values that are near expected values from below during anomaly detection.

- `query`: string (required) — The Prometheus query used to retrieve the time-series data for anomaly detection.

  > Random Cut Forest queries must be wrapped by a supported PromQL aggregation operator. For more information, see [Aggregation operators](https://docs.aws.amazon.com/https://prometheus.io/docs/prometheus/latest/querying/operators/#aggregation-operators) on the *Prometheus docs* website.
  >
  > *Supported PromQL aggregation operators* : `avg` , `count` , `group` , `max` , `min` , `quantile` , `stddev` , `stdvar` , and `sum` .

- `sampleSize`: number = 256 — The number of data points sampled from the input stream for the Random Cut Forest algorithm.

  The default number is 256 consecutive data points.

- `shingleSize`: number = 8 — The number of consecutive data points used to create a shingle for the Random Cut Forest algorithm.

  The default number is 8 consecutive data points.
