> For the complete documentation index, see [llms.txt](https://docs.rasgoml.com/rasgo-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rasgoml.com/rasgo-docs/rasgo-0.1/all-transforms/correlation.md).

# Correlation

Run pairwise correlation on all numeric columns in the source\_table

## Parameters

| Name             | Type  | Description                                                            | Is Optional |
| ---------------- | ----- | ---------------------------------------------------------------------- | ----------- |
| rows\_to\_sample | value | number of rows to sample from the table before calculating correlation | True        |

## Example

```python
ds = rasgo.get.dataset(id)

ds2 = ds.correlation(rows_to_sample=1000)
ds2.preview()
```

## Source Code

{% embed url="<https://github.com/rasgointelligence/RasgoTransforms/blob/main/rasgotransforms/rasgotransforms/transforms/correlation/correlation.sql>" %}
