| train_classifierA | Train a classification model using PyCaret with advanced configuration.
- NOTE: Please use absolute paths for data_path and test_data_path to avoid path resolution errors.
Args:
data_path: Path to dataset (csv/parquet/json).
target_column: Name of target column.
test_data_path: Optional path to specific test dataset. If provided, used for evaluation/holdout.
optimize: Metric to optimize for (e.g., 'Accuracy', 'AUC', 'Recall', 'Precision', 'F1', 'Kappa', 'MCC'). Default is 'Accuracy'.
include_models: List of model IDs to include in comparison (e.g., ['lr', 'dt', 'rf']). If None, all models are compared (except heavy ones excluded by default).
exclude_models: List of model IDs to exclude from comparison (e.g., ['catboost']). If None, defaults to excluding heavy models: ['svm', 'rbfsvm', 'gpc', 'mlp', 'ridge', 'qda'].
ignore_features: Features to ignore.
numeric_features: Features to treat as numeric.
categorical_features: Features to treat as categorical.
ordinal_features: Dictionary of ordinal features and their order (e.g., {'grade': ['low', 'medium', 'high']}).
date_features: Features to treat as dates.
text_features: Features to treat as text (for TF-IDF etc).
keep_features: Features to ensure are kept.
imputation_type: 'simple' or 'iterative' (default: 'simple').
numeric_imputation: 'mean', 'median', 'mode' or int/float (default: 'mean').
categorical_imputation: 'mode' or str (default: 'mode').
fix_imbalance: If True, fix imbalance in training data (default: False).
remove_outliers: If True, remove outliers from training data (default: False).
normalize: If True, scale features (default: False). Recommended for linear models.
normalize_method: 'zscore', 'minmax', 'maxabs', 'robust' (default: 'zscore').
transformation: If True, apply gaussian transformation to make data more normal (default: False).
transformation_method: 'yeo-johnson' or 'quantile' (default: 'yeo-johnson').
polynomial_features: If True, create polynomial features (default: False).
interaction_features: List of features to create interactions for.
bin_numeric_features: List of numeric features to bin into categories.
feature_selection: If True, select best features (default: False).
feature_selection_method: 'classic', 'univariate', 'sequential' (default: 'classic').
n_features_to_select: Fraction (0.0-1.0) or number of features to select (default: 0.2).
fold_strategy: 'kfold', 'stratifiedkfold', 'groupkfold', 'timeseries' (default: 'kfold').
fold: Number of folds (default: 10).
n_jobs: Number of jobs to run in parallel (-1 for all cores).
Returns:
JSON string with run_id, model_path, metrics, feature_importances, and report_path.
|
| train_regressorA | Train a regression model using PyCaret with advanced configuration.
- NOTE: Please use absolute paths for data_path and test_data_path to avoid path resolution errors.
Args:
data_path: Path to dataset (csv/parquet/json).
target_column: Name of target column.
test_data_path: Optional path to specific test dataset. If provided, used for evaluation/holdout.
optimize: Metric to optimize for (e.g., 'R2', 'RMSE', 'MAE', 'MSE', 'RMSLE', 'MAPE'). Default is 'R2'.
include_models: List of model IDs to include in comparison (e.g., ['lr', 'dt', 'rf']). If None, all models are compared (except heavy ones excluded by default).
exclude_models: List of model IDs to exclude from comparison (e.g., ['catboost']). If None, defaults to excluding heavy models: ['svm', 'mlp', 'kr', 'ard', 'par', 'ransac', 'tr', 'huber'].
ignore_features: Features to ignore.
numeric_features: Features to treat as numeric.
categorical_features: Features to treat as categorical.
ordinal_features: Dictionary of ordinal features and their order.
date_features: Features to treat as dates.
text_features: Features to treat as text (for TF-IDF etc).
keep_features: Features to ensure are kept.
imputation_type: 'simple' or 'iterative' (default: 'simple').
numeric_imputation: 'mean', 'median', 'mode' or int/float (default: 'mean').
categorical_imputation: 'mode' or str (default: 'mode').
remove_outliers: If True, remove outliers from training data (default: False).
normalize: If True, scale features (default: False). Recommended for linear models.
normalize_method: 'zscore', 'minmax', 'maxabs', 'robust' (default: 'zscore').
transformation: If True, apply gaussian transformation to make data more normal (default: False).
transformation_method: 'yeo-johnson' or 'quantile' (default: 'yeo-johnson').
polynomial_features: If True, create polynomial features (default: False).
interaction_features: List of features to create interactions for.
bin_numeric_features: List of numeric features to bin into categories.
feature_selection: If True, select best features (default: False).
feature_selection_method: 'classic', 'univariate', 'sequential' (default: 'classic').
n_features_to_select: Fraction (0.0-1.0) or number of features to select (default: 0.2).
fold_strategy: 'kfold', 'stratifiedkfold', 'groupkfold', 'timeseries' (default: 'kfold').
fold: Number of folds (default: 10).
n_jobs: Number of jobs to run in parallel (-1 for all cores).
Returns:
JSON string with run_id, model_path, metrics, feature_importances, and report_path.
|
| predictA | Make predictions using a trained model.
- NOTE: Please use absolute paths for data_path to avoid path resolution errors.
Args:
run_id: The ID of the training run (returned by train_classifier or train_regressor).
data_path: The path to the CSV or JSON file containing the input data.
Returns:
The absolute path to the JSON file containing the predictions.
|
| inspect_dataA | Get comprehensive statistics and a preview of the dataset to understand its quality and structure.
Use this to check for missing values, unique counts, and basic data types.
- NOTE: Please use absolute paths for data_path to avoid path resolution errors.
- NOTE: For files larger than 10,000 rows, statistics are computed on a random sample for performance.
Args:
data_path: Path to the CSV, Parquet, or JSON file.
n_rows: Number of rows to show in head/tail/sample previews (default: 5).
Returns:
JSON string containing structure, stats, and previews.
|
| query_dataA | Execute a DuckDB SQL query on data files (CSV, Parquet, JSON) to gain deeper insights.
CRITICAL: This is your PRIMARY tool for advanced data exploration.
- Use this to aggregate data (GROUP BY), join multiple files, calculate derived metrics, or inspect specific subsets.
- Prefer this over 'inspect_data' when you need to answer specific questions about the data distribution or relationships.
- You can query files directly in the FROM clause, e.g., "SELECT category, AVG(price) FROM 'data.csv' GROUP BY category".
- NOTE: Please use absolute paths for files in your FROM clause to avoid path resolution errors.
Args:
query: Standard DuckDB SQL query.
Returns:
JSON string containing the query results (limit 100 rows).
|
| process_dataA | Execute a DuckDB SQL query to transform data and save it to a new file.
CRITICAL: This is your PRIMARY tool for Feature Engineering and Data Cleaning.
- Use this to create new features, clean dirty data, handle missing values (COALESCE), or join datasets.
- You MUST use this tool to prepare the data before training if feature engineering is needed.
- Example: "SELECT *, price/sqft as price_per_sqft, COALESCE(garage, 0) as garage_clean FROM 'train.csv'"
IMPORTANT: Strongly RECOMMEND using '.parquet' extension for output_path (e.g. 'clean_data.parquet').
- Parquet preserves data types (int, float, string, date) much better than CSV.
- CSV often loses type information (everything becomes string or inferred incorrectly).
- NOTE: Please use absolute paths for files in your query and for output_path to avoid path resolution errors.
Args:
query: Standard DuckDB SQL query.
output_path: Absolute path to save the result (must be .csv, .parquet, or .json).
Returns:
Confirmation message with the output path.
|