Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
montanalow merged 1 commit intomasterfrommontana/decomp
May 7, 2024
Merged
Changes fromall 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 deletionspgml-cms/docs/api/sql-extension/pgml.decompose.md
View file
Open in desktop
Original file line numberDiff line numberDiff 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 vectorthat needs decomposition. |
| `vector` | `ARRAY[0.1, 0.45, 1.0]` | The feature vectorto 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;
```

!!!

[8]ページ先頭

©2009-2025 Movatter.jp