pca_transform
Apply PCA to numeric columns, generating principal components (PC1, PC2...) for visualization, multicollinearity reduction, or feature compression.
Instructions
PCA dimensionality reduction. Projects numeric columns onto principal components. New columns PC1, PC2, ... are added to the dataframe. Features are auto-standardized. If plot=True and n_components>=2, also stores a 2D scatter plot (viewable via save_report). Use to visualize high-dimensional data, reduce multicollinearity, or compress features. Example: pca_transform(columns=["Revenue","Weight","Pieces"], n_components=2, hue="CargoType")
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"columns": "<columns>"
},
"name": "pca_transform"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hue | No | ||
| plot | No | ||
| columns | Yes | ||
| df_name | No | ||
| save_path | No | ||
| n_components | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |