HeardAboutMul-Command?
Mul-Commandisasetofcustomprogrammingcommandsdesignedtostreamlinetheprocessofloadingfiles,selectingfeatures,trainingandevaluatingAImodels,andoptimizingthemwithintheplaygroundforefficientdeploymentandtesting.
Dataset and Split Setup
This command imports the specified CSV file into the playground for further processing.
// File Import: Load a CSV file
file "Customers.csv"
// Split Data: Split the dataset into training and testing sets
split 0.2
This command splits the data into 80% training and 20% testing (0.2 is the test set proportion).
Feature and Target Selection
// Feature Selection: Specify feature columns
features 1
features 0 3
features 0 2
The "features" command selects the columns to be used as features for model training. You can provide individual column indices or specify a range.
// Target Selection: Specify target columns
target 2
target 2 3
target 2 5
The "target" command specifies the column(s) to be used as the target variable. You can choose individual columns or a range of columns.
Feature Encoding
// Label Encoding: Apply label encoding to a specific column
encode_features label=1
This command applies label encoding to the specified column (in this case, column 1).
// Label Encoding for multiple columns
encode_features label=1,2
This command applies label encoding to both column 1 and column 2.
// Label Encoding and One-Hot Encoding
encode_features label=1 onehot=2,3
This command applies label encoding to column 1 and one-hot encoding to columns 2 and 3.
Models and Arguments
// Models and arguments
model "svc" C=1.0
model "polynomial_regression" degree=3
model "ridge_regression" alpha=0.5
model "svc" C=10.0 kernel=rbf gamma=scale
model "svc" C=2.0 kernel=linear
model "knn" n_neighbors=8 metric=euclidean
model "lasso_regression" alpha=0.1 max_iter=1000
model "naive_bayes"
model "svr" C=0.5 kernel=linear epsilon=0.1
// Example: Model Training and Prediction
model "svr"
print_predict
This command specifies the use of the "svr" (Support Vector Regression) model, followed by printing predictions.
// Example with SVC hyperparameters
model "svc" C=1.0
This command specifies the "svc" (Support Vector Classifier) model and sets the hyperparameter "C" to 1.0 for regularization.
// Example with Polynomial Regression hyperparameters
model "polynomial_regression" degree=3
This command specifies the "polynomial_regression" model and sets the degree of the polynomial kernel to 3.
// Example with Ridge Regression hyperparameters
model "ridge_regression" alpha=0.5
This command specifies the "ridge_regression" model and sets the regularization parameter "alpha" to 0.5.
Print Statements
// Example: Print Statements
print_predict
print_acc
print_mse
print_mae
print_cm
print_r2
These commands print different evaluation metrics or the prediction results, such as accuracy, mean squared error, and confusion matrix.
// Example: Plot Graphs
plot_data
plot_predict
These commands are used to plot graphs, displaying the features and predictions.
Save Model
// Save Model
save_model "model-name.pkl"
This command saves the trained model to a file for later use.
Model Prediction
// Example: Model Prediction
model_predict "model-name" [[1, 2], [3, 4], [5, 6]]
This command runs predictions using the saved model on the provided test data.
Complete Example Workflow
// General Workflow
file "Social_Network_Ads.csv"
features 0 1
target 2
split 0.2
model "linear_regression"
print_predict
print_accuracy
plot_data
plot_predict
save_model "model.pkl"
// Single Command Line
file "Social_Network_Ads.csv" features 0 2 target 3 4 split 0.2 model "linear_regression" print_predict save_model "model.pkl"
A full workflow where data is loaded, features and target are selected, encoding is applied, the model is trained, and both accuracy and predictions are printed.