# Data Science SQL

```
SELECT SQRT(AVG(POWER(y - y_pred, 2))) AS rmse FROM ...
```

```
SELECT AVG(ABS(y - y_pred)) AS mae FROM ...
```

Mean error

```
SELECT AVG(y_pred - y) AS me FROM ...
```

Median - get it here

```
SELECT MEDIAN(y) FROM ...
```

```
SELECT SQRT(AVG(POWER(y - y_pred, 2))) AS rmse FROM ...
```

```
SELECT AVG(ABS(y - y_pred)) AS mae FROM ...
```

Mean error

```
SELECT AVG(y_pred - y) AS me FROM ...
```

Median - get it here

```
SELECT MEDIAN(y) FROM ...
```

Published September 10, 2015

You might also enjoy

All code examples are public domain.

Use them however youâ€™d like (licensed under CC0).