Skip to content

Machine Learning Commands

Bell Eapen edited this page Jan 29, 2026 · 1 revision

Machine Learning Commands

CRISP-T includes built-in machine learning capabilities for clustering, classification, and regression. These algorithms can operate on your numeric data (CSV) and can also incorporate text data if it has been linked or vectored.

Note: You must have the ML dependencies installed: pip install crisp-t[ml]

All commands use the crisp CLI.

Common ML Options

These options apply to most ML commands below.

  • --include <cols>: Comma-separated list of columns to use as features (inputs).
  • --outcome <col>: The target variable (output) you want to predict.
  • --aggregation <strategy>: How to handle cases where multiple documents link to a single data row.
    • majority: Use the most frequent value (for classification).
    • mean: Average the values (for regression).
    • first: Use the first available value.
    • mode: Same as majority.

Clustering

Group similar data points together.

K-Means Clustering

crisp --inp ./corpus --kmeans --num 3 --include "age,income,score"
  • --num <N>: Number of clusters to create.

Classification (Predicting Categories)

Predict a categorical outcome (e.g., "High/Low", "Success/Failure").

crisp --inp ./corpus --cls --outcome target_col
  • Algorithms: Runs both Support Vector Machine (SVM) and Decision Tree.
  • Output: Confusion Matrix and Feature Importance.

Neural Network Classifier

Train a simple neural network.

crisp --inp ./corpus --nnet --outcome target_col

LSTM (Text Classification)

Long Short-Term Memory network. Used to predict an outcome variable based on the sequence of words in linked text documents.

crisp --inp ./corpus --lstm --outcome target_col

K-Nearest Neighbors (KNN)

Find items similar to a specific record.

crisp --inp ./corpus --knn --num 5 --rec 1 --outcome target_col
  • --rec <index>: The (1-based) index of the record to search from.

Regression (Predicting Numbers)

Predict a continuous numerical outcome (e.g., "Sales", "Temperature").

crisp --inp ./corpus --regression --outcome target_col
  • Auto-detection: Automatically chooses Linear Regression for continuous targets or Logistic Regression if the target appears binary.

Dimensionality Reduction

PCA

Principal Component Analysis. Reduce your features to a smaller set of components.

crisp --inp ./corpus --pca --num 2 --outcome target_col

Association Rules

Discover rules like "If A, then B".

crisp --inp ./corpus --cart --num 50 --rec 70
  • --num: Minimum support (e.g., 50 = 0.50).
  • --rec: Minimum confidence threshold (e.g., 70 = 0.70).

Clone this wiki locally