Skip to content

update docs #1444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 2 additions & 23 deletions pgml-cms/docs/api/sql-extension/pgml.decompose.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ description: Decompose an input vector into it's principal components

# pgml.decompose()


Chunks are pieces of documents split using some specified splitter. This is typically done before embedding.
Matrix decomposition reduces the number of dimensions in a vector, to improve relevance and reduce computation required.

## API

Expand All @@ -21,30 +20,10 @@ pgml.decompose(
| Parameter | Example | Description |
|----------------|---------------------------------|----------------------------------------------------------|
| `project_name` | `'My First PostgresML Project'` | The project name used to train models in `pgml.train()`. |
| `vector` | `ARRAY[0.1, 0.45, 1.0]` | The feature vector that needs decomposition. |
| `vector` | `ARRAY[0.1, 0.45, 1.0]` | The feature vector to transform. |

## Example

```sql
SELECT pgml.decompose('My PCA', ARRAY[0.1, 2.0, 5.0]);
```

!!! example

```sql
SELECT *,
pgml.decompose(
'Buy it Again',
ARRAY[
user.location_id,
NOW() - user.created_at,
user.total_purchases_in_dollars
]
) AS buying_score
FROM users
WHERE tenant_id = 5
ORDER BY buying_score
LIMIT 25;
```

!!!
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy