ML Models
ml algosml trainml trainml fitml fitml model predictml model predict_probaml model transformml model inverse_transformml model scoreml model evaluateml model importanceml model predict_intervalml model permutation_importanceml model partial_dependenceml model explainml model rulesml model pmmlml model pmmlml model infoml model showml model existml model deleteml model delete_allml model saveml model loadml cross_validateml grid_searchml compareml compareml automlml automl

ml algos


Description

    Get the list of the algorithms with their kind, the function to use (ml train or ml fit), the parameters with their default values and a description

admin
ml algos
mentdb
[{"algo": "linear", "kind": "regressor", "function": "ml train", "defaults": {"fit_intercept": true}, "description": "Ordinary least squares with the full statistics (coefficients, std errors, t, p-values, R2, F, AIC, BIC, Durbin-Watson)"}, {"algo": "ridge", "kind": "regressor", "function": "ml train", "defaults": {"alpha": 1, "fit_intercept": true}, "description": "Linear regression with L2 penalty"}, {"algo": "lasso", "kind": "regressor", "function": "ml train", "defaults": {"alpha": 1, "max_iter": 1000, "tol": 1e-6}, "description": "Linear regression with L1 penalty (variable selection)"}, {"algo": "elastic_net", "kind": "regressor", "function": "ml train", "defaults": {"alpha": 1, "l1_ratio": 0.5, "max_iter": 1000, "tol": 1e-6}, "description": "Linear regression with L1 + L2 penalties"}, {"algo": "huber", "kind": "regressor", "function": "ml train", "defaults": {"epsilon": 1.35, "max_iter": 100, "tol": 1e-8}, "description": "Huber robust regression (IRLS): the outliers get a lower weight"}, {"algo": "ransac", "kind": "regressor", "function": "ml train", "defaults": {"residual_threshold": "MAD of y", "max_trials": 100, "min_samples": "n_features + 1", "seed": 42}, "description": "RANSAC robust regression: best linear model on random subsets, refit on the inliers"}, {"algo": "wls", "kind": "regressor", "function": "ml train", "defaults": {"weights": [1, 1, 1]}, "description": "Weighted least squares with the statistics (one weight per row, ex: 1 \/ variance)"}, {"algo": "isotonic", "kind": "regressor", "function": "ml train", "defaults": {"increasing": true}, "description": "Isotonic regression (monotonic, one feature, pool adjacent violators)"}, {"algo": "poisson", "kind": "regressor", "function": "ml train", "defaults": {"max_iter": 100, "tol": 1e-8}, "description": "Poisson regression (counts, log link): coefficients, rate ratios, deviance, AIC"}, {"algo": "logistic", "kind": "classifier", "function": "ml train", "defaults": {"alpha": 0, "max_iter": 100, "tol": 1e-8}, "description": "Logistic regression (IRLS): odds ratios and p-values for 2 classes, one-vs-rest beyond"}, {"algo": "naive_bayes", "kind": "classifier", "function": "ml train", "defaults": {"var_smoothing": 1e-9}, "description": "Gaussian naive Bayes"}, {"algo": "lda", "kind": "classifier", "function": "ml train", "defaults": {"shrinkage": 0}, "description": "Linear discriminant analysis"}, {"algo": "qda", "kind": "classifier", "function": "ml train", "defaults": {"reg_param": 0}, "description": "Quadratic discriminant analysis"}, {"algo": "knn_classifier", "kind": "classifier", "function": "ml train", "defaults": {"k": 5, "metric": "euclidean", "weights": "uniform", "scale": false}, "description": "k nearest neighbors (metrics: euclidean, manhattan, chebyshev, minkowski + p, canberra, cosine)"}, {"algo": "knn_regressor", "kind": "regressor", "function": "ml train", "defaults": {"k": 5, "metric": "euclidean", "weights": "uniform", "scale": false}, "description": "k nearest neighbors regression"}, {"algo": "decision_tree_classifier", "kind": "classifier", "function": "ml train", "defaults": {"max_depth": 0, "min_samples_split": 2, "min_samples_leaf": 1, "max_features": "all", "criterion": "gini", "seed": 42}, "description": "CART decision tree (gini or entropy), readable rules (max_depth 0 = no limit)"}, {"algo": "decision_tree_regressor", "kind": "regressor", "function": "ml train", "defaults": {"max_depth": 0, "min_samples_split": 2, "min_samples_leaf": 1, "max_features": "all", "seed": 42}, "description": "CART regression tree, readable rules"}, {"algo": "random_forest_classifier", "kind": "classifier", "function": "ml train", "defaults": {"n_trees": 100, "max_depth": 0, "min_samples_leaf": 1, "max_features": "sqrt", "criterion": "gini", "bootstrap": true, "seed": 42}, "description": "Random forest, out-of-bag accuracy, feature importance"}, {"algo": "random_forest_regressor", "kind": "regressor", "function": "ml train", "defaults": {"n_trees": 100, "max_depth": 0, "min_samples_leaf": 1, "max_features": "all", "bootstrap": true, "seed": 42}, "description": "Random forest regression, out-of-bag R2"}, {"algo": "extra_trees_classifier", "kind": "classifier", "function": "ml train", "defaults": {"n_trees": 100, "max_depth": 0, "min_samples_leaf": 1, "max_features": "sqrt", "bootstrap": false, "seed": 42}, "description": "Extremely randomized trees"}, {"algo": "extra_trees_regressor", "kind": "regressor", "function": "ml train", "defaults": {"n_trees": 100, "max_depth": 0, "min_samples_leaf": 1, "max_features": "all", "bootstrap": false, "seed": 42}, "description": "Extremely randomized trees regression"}, {"algo": "gradient_boosting_classifier", "kind": "classifier", "function": "ml train", "defaults": {"n_estimators": 100, "learning_rate": 0.1, "max_depth": 3, "subsample": 1, "seed": 42}, "description": "Gradient boosted trees (log loss)"}, {"algo": "gradient_boosting_regressor", "kind": "regressor", "function": "ml train", "defaults": {"n_estimators": 100, "learning_rate": 0.1, "max_depth": 3, "subsample": 1, "seed": 42}, "description": "Gradient boosted trees (squared loss)"}, {"algo": "svm_classifier", "kind": "classifier", "function": "ml train", "defaults": {"type": "c", "C": 1, "nu": 0.5, "kernel": "rbf", "gamma": "scale", "degree": 3, "coef0": 0, "probability": true, "scale": true, "seed": 42}, "description": "Support vector machine (libsvm, kernels rbf, linear, poly, sigmoid; type c or nu; C auto = cross validated C and gamma)"}, {"algo": "linear_svm", "kind": "classifier", "function": "ml train", "defaults": {"C": 1, "penalty": "l2", "multiclass": "ovr", "tol": 0.1, "max_iter": 1000, "scale": true}, "description": "Linear SVM (liblinear), very fast on many rows and columns; penalty l1 selects the variables; multiclass ovr or crammer_singer; C auto"}, {"algo": "liblinear_logistic", "kind": "classifier", "function": "ml train", "defaults": {"C": 1, "penalty": "l2", "tol": 0.01, "max_iter": 1000, "scale": true}, "description": "Regularized logistic regression (liblinear) with probabilities; penalty l1 gives a sparse model (C = inverse of the regularization)"}, {"algo": "linear_svr", "kind": "regressor", "function": "ml train", "defaults": {"C": 1, "epsilon": 0.1, "loss": "squared", "tol": 0.01, "max_iter": 1000, "scale": true}, "description": "Linear support vector regression (liblinear)"}, {"algo": "svm_regressor", "kind": "regressor", "function": "ml train", "defaults": {"type": "epsilon", "C": 1, "epsilon": 0.1, "nu": 0.5, "kernel": "rbf", "gamma": "scale", "probability": false, "scale": true}, "description": "Support vector regression (epsilon-SVR or nu-SVR; probability = Laplace prediction intervals; C auto)"}, {"algo": "mlp_classifier", "kind": "classifier", "function": "ml train", "defaults": {"hidden": [10], "activation": "relu", "epochs": 500, "learning_rate": 0.01, "batch_size": 32, "alpha": 1e-4, "tol": 1e-6, "seed": 42}, "description": "Multilayer perceptron (backpropagation, Adam, softmax + cross entropy, stops when the loss is stable)"}, {"algo": "mlp_regressor", "kind": "regressor", "function": "ml train", "defaults": {"hidden": [10], "activation": "relu", "epochs": 500, "learning_rate": 0.01, "batch_size": 32, "alpha": 1e-4, "tol": 1e-6, "seed": 42}, "description": "Multilayer perceptron regression (backpropagation, Adam)"}, {"algo": "bagging_classifier", "kind": "classifier", "function": "ml train", "defaults": {"base": "decision_tree_classifier", "n_estimators": 10, "max_samples": 1, "seed": 42}, "description": "Bagging of any classifier (base = algorithm name or {\"algo\": ..., \"params\": {...}}), out-of-bag accuracy"}, {"algo": "bagging_regressor", "kind": "regressor", "function": "ml train", "defaults": {"base": "decision_tree_regressor", "n_estimators": 10, "max_samples": 1, "seed": 42}, "description": "Bagging of any regressor, out-of-bag R2"}, {"algo": "adaboost_classifier", "kind": "classifier", "function": "ml train", "defaults": {"base": {"algo": "decision_tree_classifier", "params": {"max_depth": 1}}, "n_estimators": 50, "learning_rate": 1, "seed": 42}, "description": "AdaBoost (SAMME, multiclass) on any classifier, weighted resampling"}, {"algo": "adaboost_regressor", "kind": "regressor", "function": "ml train", "defaults": {"base": {"algo": "decision_tree_regressor", "params": {"max_depth": 3}}, "n_estimators": 50, "learning_rate": 1, "seed": 42}, "description": "AdaBoost.R2 (Drucker) on any regressor, weighted median"}, {"algo": "stacking_classifier", "kind": "classifier", "function": "ml train", "defaults": {"estimators": ["naive_bayes", "knn_classifier"], "final": {"algo": "logistic", "params": {"alpha": 1}}, "k": 5, "passthrough": false, "seed": 42}, "description": "Stacking: out-of-fold probabilities of the estimators feed a final classifier"}, {"algo": "stacking_regressor", "kind": "regressor", "function": "ml train", "defaults": {"estimators": ["linear", "knn_regressor"], "final": "ridge", "k": 5, "passthrough": false, "seed": 42}, "description": "Stacking: out-of-fold predictions of the estimators feed a final regressor"}, {"algo": "voting_classifier", "kind": "classifier", "function": "ml train", "defaults": {"estimators": ["naive_bayes", "logistic"], "voting": "soft", "weights": [1, 1]}, "description": "Vote of several classifiers: mean of the probabilities (soft) or majority (hard), optional weights"}, {"algo": "voting_regressor", "kind": "regressor", "function": "ml train", "defaults": {"estimators": ["linear", "knn_regressor"], "weights": [1, 1]}, "description": "Weighted mean of several regressors"}, {"algo": "one_r", "kind": "classifier", "function": "ml train", "defaults": {"min_bucket": 6}, "description": "OneR (Holte): the best single feature cut in intervals, a very readable baseline"}, {"algo": "ripper", "kind": "classifier", "function": "ml train", "defaults": {"folds": 3, "min_weight": 2, "optimizations": 2, "seed": 42}, "description": "RIPPER (Cohen, JRip in Weka): ordered if-then rules grown by FOIL gain, pruned, stopped by description length, optimized"}, {"algo": "m5", "kind": "regressor", "function": "ml train", "defaults": {"min_instances": 4, "pruned": true, "smoothed": "auto"}, "description": "M5 model tree (M5P in Weka): a tree with a linear model in each leaf, pruned, smoothed (auto = if it lowers the cross validated error), readable rules"}, {"algo": "gaussian_process", "kind": "regressor", "function": "ml train", "defaults": {"kernel": "rbf", "length_scale": "auto", "signal_variance": "auto", "noise": "auto", "restarts": 3, "seed": 42}, "description": "Gaussian process regression (kernels rbf, matern32, matern52; hyperparameters by maximum likelihood), prediction intervals; up to 1000 rows"}, {"algo": "bayes_net", "kind": "classifier", "function": "ml train", "defaults": {"structure": "tan", "discretize": "mdl", "bins": 5, "max_parents": 2, "alpha": 0.5}, "description": "Bayesian network classifier (BayesNet in Weka): structure naive, tan (tree augmented) or k2 (score search), features discretized (mdl = Fayyad-Irani or frequency)"}, {"algo": "cost_sensitive_classifier", "kind": "classifier", "function": "ml train", "defaults": {"base": "naive_bayes", "cost": [[0, 1], [5, 0]], "method": "minimize_cost", "seed": 42}, "description": "Cost-sensitive classification of any classifier: cost[true][predicted]; minimize_cost = class of minimum expected cost, reweight = rows resampled by the cost of their class"}, {"algo": "quantile_regression", "kind": "regressor", "function": "ml train", "defaults": {"quantile": 0.5, "max_iter": 500, "tol": 1e-8}, "description": "Linear quantile regression (median by default): a conditional quantile instead of the mean, robust to the outliers, prediction bands"}, {"algo": "pipeline_classifier", "kind": "classifier", "function": "ml train", "defaults": {"steps": ["scaler_zscore", {"algo": "pca", "params": {"n_components": 2}}], "final": "logistic"}, "description": "Pipeline: transformers (scalers, pca, ica, nmf, kernel_pca) then a classifier, saved as one model (the new rows get the same preparation)"}, {"algo": "pipeline_regressor", "kind": "regressor", "function": "ml train", "defaults": {"steps": ["scaler_zscore"], "final": {"algo": "knn_regressor", "params": {"k": 5}}}, "description": "Pipeline: transformers then a regressor, saved as one model"}, {"algo": "calibrated_classifier", "kind": "classifier", "function": "ml train", "defaults": {"base": "naive_bayes", "method": "sigmoid", "k": 5, "seed": 42}, "description": "Probability calibration of any classifier on out-of-fold predictions: sigmoid (Platt) or isotonic"}, {"algo": "kmeans", "kind": "clustering", "function": "ml fit", "defaults": {"k": 3, "n_init": 10, "max_iter": 300, "tol": 1e-4, "seed": 42}, "description": "k-means (k-means++ initialization)"}, {"algo": "fuzzy_cmeans", "kind": "clustering", "function": "ml fit", "defaults": {"k": 3, "m": 2, "max_iter": 300, "tol": 1e-5, "seed": 42}, "description": "Fuzzy c-means: membership degree of each point to each cluster"}, {"algo": "gmm", "kind": "clustering", "function": "ml fit", "defaults": {"k": 2, "max_iter": 200, "tol": 1e-6, "reg_covar": 1e-6, "seed": 42}, "description": "Gaussian mixture (EM, full covariances), AIC and BIC"}, {"algo": "som", "kind": "clustering", "function": "ml fit", "defaults": {"rows": 5, "cols": 5, "epochs": 100, "learning_rate": 0.5, "sigma": 2.5, "standardize": true, "seed": 42}, "description": "Self-organizing map (Kohonen): predict = node index, transform = [row, col] on the grid"}, {"algo": "ica", "kind": "transformer", "function": "ml fit", "defaults": {"n_components": "all", "max_iter": 500, "tol": 1e-6, "seed": 42}, "description": "Independent component analysis (FastICA): separate mixed signals into independent sources"}, {"algo": "nmf", "kind": "transformer", "function": "ml fit", "defaults": {"n_components": 2, "max_iter": 500, "seed": 42}, "description": "Non-negative matrix factorization X = W H (spectra, topics, mixtures): transform = W"}, {"algo": "kernel_pca", "kind": "transformer", "function": "ml fit", "defaults": {"n_components": 2, "kernel": "rbf", "gamma": "1 / n_features", "degree": 3, "coef0": 1}, "description": "Kernel PCA (rbf, poly, sigmoid): non linear components, up to 1500 rows"}, {"algo": "em_mixed", "kind": "clustering", "function": "ml fit", "defaults": {"k": 2, "categorical": [], "max_iter": 200, "tol": 1e-6, "seed": 42}, "description": "EM clustering of mixed data: Gaussian for the numeric columns, categorical distributions for the columns listed in categorical; transform = membership probabilities, BIC"}, {"algo": "pca", "kind": "transformer", "function": "ml fit", "defaults": {"n_components": "all", "standardize": false}, "description": "Principal component analysis (n_components: integer or fraction of variance, ex: 0.95)"}, {"algo": "scaler_minmax", "kind": "transformer", "function": "ml fit", "defaults": {"min": 0, "max": 1}, "description": "Scale each column to [min, max]"}, {"algo": "scaler_zscore", "kind": "transformer", "function": "ml fit", "defaults": {}, "description": "Standardize each column: (x - mean) \/ sample standard deviation"}, {"algo": "scaler_robust", "kind": "transformer", "function": "ml fit", "defaults": {}, "description": "Robust scaling: (x - median) \/ IQR"}, {"algo": "scaler_maxabs", "kind": "transformer", "function": "ml fit", "defaults": {}, "description": "Scale each column by its maximum absolute value"}, {"algo": "isolation_forest", "kind": "anomaly", "function": "ml fit", "defaults": {"n_trees": 100, "sample_size": 256, "contamination": "auto", "seed": 42}, "description": "Isolation forest: anomaly score in [0, 1], 1 = anomaly in predict"}, {"algo": "one_class_svm", "kind": "anomaly", "function": "ml fit", "defaults": {"nu": 0.5, "kernel": "rbf", "gamma": "scale", "scale": true}, "description": "One-class SVM novelty detection"}]

ml train <id> <algo> <json_X> <json_y>


Description

    Train a supervised model (classifier or regressor) with the default parameters and keep it in memory.
Returns the model information: classes, training score and the model specific results (coefficients, p-values, importance...).

Parameters

    id:   The model id - String - required
    algo:   The algorithm (see ml algos) - String - required
    json_X:   The rows (JSON array of arrays of numbers) - String - required
    json_y:   The labels or the target values - String - required
admin
ml train "lin" "linear" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]" "[6.1, 8.0, 11.2, 14.1, 18.3, 19.9, 24.8, 26.1]"
mentdb
{"id": "lin", "algo": "linear", "kind": "regressor", "n_samples": 8, "n_features": 2, "params": {}, "train_r2": 0.998640910735476, "intercept": 3.398113207547425, "coef": [1.9028301886791894, 0.9943396226415189], "coefficients": [{"name": "intercept", "estimate": 3.398113207547425, "std_error": 0.30864164553951284, "t": 11.00989855600155, "p_value": 1.0758381408000759E-4, "ci_low": 2.6047245998026414, "ci_high": 4.1915018152922086}, {"name": "x0", "estimate": 1.9028301886791894, "std_error": 0.21292726609787951, "t": 8.936526653211649, "p_value": 2.9234207021793917E-4, "ci_low": 1.3554832261362733, "ci_high": 2.4501771512221056}, {"name": "x1", "estimate": 0.9943396226415189, "std_error": 0.18297645880949256, "t": 5.434248914374191, "p_value": 0.0028620361043391294, "ci_low": 0.523983661276775, "ci_high": 1.4646955840062628}], "r2": 0.998640910735476, "adj_r2": 0.9980972750296664, "rmse": 0.25693219133342576, "sigma": 0.32499637153272, "f_statistic": 1836.9671087888566, "f_p_value": 6.809574171207089E-8, "log_likelihood": -0.47996365881899195, "aic": 8.959927317637984, "bic": 9.277693484357327, "durbin_watson": 1.2160256021354434, "df_residual": 5}
Decision tree with string labels
admin
ml train "tree" "decision_tree_classifier" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[\"low\", \"low\", \"low\", \"low\", \"mid\", \"mid\", \"mid\", \"mid\", \"high\", \"high\", \"high\", \"high\"]"
mentdb
{"id": "tree", "algo": "decision_tree_classifier", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {}, "classes": ["high", "low", "mid"], "train_accuracy": 1, "depth": 2, "leaves": 3, "nodes": 5}
Gaussian naive Bayes
admin
ml train "nb" "naive_bayes" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]"
mentdb
{"id": "nb", "algo": "naive_bayes", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {}, "classes": [0, 1, 2], "train_accuracy": 1, "priors": [0.3333333333333333, 0.3333333333333333, 0.3333333333333333], "means": [[1.125, 1.975], [5.675, 8.025], [8.875, 1.125]], "variances": [[0.06687501022854166, 0.02187501022854169], [0.21687501022854172, 0.12687501022854167], [0.06687501022854152, 0.06687501022854166]]}

ml train <id> <algo> <json_X> <json_y> <json_params>


Description

    Train a supervised model with parameters (JSON object, the missing parameters keep their default values).
Algorithms: linear, ridge, lasso, elastic_net, huber, ransac, wls, isotonic, poisson, logistic, liblinear_logistic, naive_bayes, lda, qda, knn_classifier, knn_regressor, decision_tree_classifier, decision_tree_regressor, random_forest_classifier, random_forest_regressor, extra_trees_classifier, extra_trees_regressor, gradient_boosting_classifier, gradient_boosting_regressor, svm_classifier, svm_regressor, linear_svm, linear_svr, mlp_classifier, mlp_regressor, one_r, ripper, m5, gaussian_process, bayes_net, cost_sensitive_classifier, quantile_regression, pipeline_classifier, pipeline_regressor, calibrated_classifier.
Meta-learning on any of them: bagging_classifier, bagging_regressor, adaboost_classifier, adaboost_regressor, stacking_classifier, stacking_regressor, voting_classifier, voting_regressor (an estimator = an algorithm name or {"algo": ..., "params": {...}}).

Parameters

    id:   The model id - String - required
    algo:   The algorithm (see ml algos) - String - required
    json_X:   The rows - String - required
    json_y:   The labels or the target values - String - required
    json_params:   The parameters, ex: {"k": 3} - String - required
admin
ml train "lr" "logistic" "[[1, 5], [2, 6], [3, 5], [4, 7], [5, 6], [6, 8], [7, 7], [8, 8], [2, 8], [6, 5], [3, 7], [7, 5]]" "[0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1]" "{}"
mentdb
{"id": "lr", "algo": "logistic", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {}, "classes": [0, 1], "train_accuracy": 0.75, "positive_class": "1", "coefficients": [{"name": "intercept", "estimate": -6.218136168495791, "std_error": 4.617212423942465, "z": -1.346729497705535, "p_value": 0.17806736840192083, "ci_low": -15.267706228393905, "ci_high": 2.831433891402323}, {"name": "x0", "estimate": 0.4795158249919381, "std_error": 0.3569246786270205, "z": 1.3434650325566955, "p_value": 0.1791214413054445, "ci_low": -0.22004369031055526, "ci_high": 1.1790753402944314}, {"name": "x1", "estimate": 0.6358343543902452, "std_error": 0.6172951160487594, "z": 1.0300330228759194, "p_value": 0.3029945039933202, "ci_low": -0.5740418408977963, "ci_high": 1.8457105496782866}], "odds_ratios": [1.6152921287500903, 1.888597243672302], "log_likelihood": -6.43133138284943, "mcfadden_r2": 0.22679584230413063, "aic": 18.862662765698857, "bic": 20.317382715062863, "iterations": 5}
Random forest of 50 trees, out-of-bag accuracy
admin
ml train "rf" "random_forest_classifier" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]" "{\"n_trees\": 50, \"seed\": 1}"
mentdb
{"id": "rf", "algo": "random_forest_classifier", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {"seed":1,"n_trees":50}, "classes": [0, 1, 2], "train_accuracy": 1, "n_trees": 50, "oob_accuracy": 1}
Poisson regression of counts
admin
ml train "poi" "poisson" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]" "[1, 0, 2, 3, 5, 4, 8, 11]" "{}"
mentdb
{"id": "poi", "algo": "poisson", "kind": "regressor", "n_samples": 8, "n_features": 2, "params": {}, "train_r2": 0.9531490862599854, "coefficients": [{"name": "intercept", "estimate": -0.43571097260094405, "std_error": 0.6818892931589502, "z": -0.6389761167570917, "p_value": 0.5228384690230521, "ci_low": -1.7721894286359612, "ci_high": 0.9007674834340731}, {"name": "x0", "estimate": 0.21499415748072437, "std_error": 0.3318684726954716, "z": 0.6478294118586155, "p_value": 0.5170952900075826, "ci_low": -0.43545609660671425, "ci_high": 0.865444411568163}, {"name": "x1", "estimate": 0.1373246804668291, "std_error": 0.26727890066955234, "z": 0.513787957533577, "p_value": 0.6074002483263744, "ci_low": -0.386532338672952, "ci_high": 0.6611816996066102}], "rate_ratios": [1.239854653070191, 1.1472005616733991], "deviance": 3.0935653440320134, "null_deviance": 24.183266296319964, "pseudo_r2": 0.8720782665945017, "log_likelihood": -12.817267075558089, "aic": 31.634534151116178, "bic": 31.872858776155685, "dispersion": 0.4017473787791058, "iterations": 5}
Lasso: variable selection
admin
ml train "las" "lasso" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]" "[6.1, 8.0, 11.2, 14.1, 18.3, 19.9, 24.8, 26.1]" "{\"alpha\": 0.5}"
mentdb
{"id": "las", "algo": "lasso", "kind": "regressor", "n_samples": 8, "n_features": 2, "params": {"alpha":0.5}, "train_r2": 0.9934205340911614, "intercept": 4.288383592733339, "coef": [1.7921718623612617, 0.8992346731250868], "r2": 0.9934205340911614, "non_zero": 2, "iterations": 208}
k nearest neighbors, k = 3, weighted by the distance
admin
ml train "knn" "knn_classifier" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]" "{\"k\": 3, \"weights\": \"distance\"}"
mentdb
{"id": "knn", "algo": "knn_classifier", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {"k":3,"weights":"distance"}, "classes": [0, 1, 2], "train_accuracy": 1, "k": 3, "metric": "euclidean", "weights": "distance", "scale": false}
Support vector machine, linear kernel
admin
ml train "svm" "svm_classifier" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]" "{\"kernel\": \"linear\", \"probability\": false}"
mentdb
{"id": "svm", "algo": "svm_classifier", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {"kernel":"linear","probability":false}, "classes": [0, 1, 2], "train_accuracy": 1, "support_vectors": 4}
Gradient boosting regressor
admin
ml train "gb" "gradient_boosting_regressor" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]" "[6.1, 8.0, 11.2, 14.1, 18.3, 19.9, 24.8, 26.1]" "{\"n_estimators\": 50, \"max_depth\": 2}"
mentdb
{"id": "gb", "algo": "gradient_boosting_regressor", "kind": "regressor", "n_samples": 8, "n_features": 2, "params": {"max_depth":2,"n_estimators":50}, "train_r2": 0.9999429024591229, "n_estimators": 50, "learning_rate": 0.1, "train_loss_first": 39.53680468750001, "train_loss_last": 0.0027733613827626365}
Multilayer perceptron
admin
ml train "mlp" "mlp_classifier" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]" "{\"hidden\": [8], \"seed\": 1}"
mentdb
{"id": "mlp", "algo": "mlp_classifier", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {"hidden":[8],"seed":1}, "classes": [0, 1, 2], "train_accuracy": 1, "layers": [2, 8, 3], "activation": "relu", "epochs": 500, "loss": 8.300241470744723E-4}
Huber robust regression: the outlier 40 gets a small weight
admin
ml train "hub" "huber" "[[1], [2], [3], [4], [5], [6], [7], [8]]" "[2.1, 3.9, 6.2, 8.1, 9.8, 12.2, 40, 15.9]" "{}"
mentdb
{"id": "hub", "algo": "huber", "kind": "regressor", "n_samples": 8, "n_features": 1, "params": {}, "train_r2": 0.3393020074348725, "intercept": 0.03405084631088329, "coef": [2.008728814037127], "scale": 0.21591965275445937, "outliers": 1, "weights": [1, 1, 1, 1, 1, 1, 0.011252393273285454, 1], "iterations": 12}
RANSAC: the outlier is out of the inliers
admin
ml train "ran" "ransac" "[[1], [2], [3], [4], [5], [6], [7], [8]]" "[2.1, 3.9, 6.2, 8.1, 9.8, 12.2, 40, 15.9]" "{\"seed\": 1}"
mentdb
{"id": "ran", "algo": "ransac", "kind": "regressor", "n_samples": 8, "n_features": 1, "params": {"seed":1}, "train_r2": 0.3337168464253085, "intercept": 0.09139344262294458, "coef": [1.9848360655737718], "residual_threshold": 4.1499999999999995, "n_inliers": 7, "inliers": [1, 1, 1, 1, 1, 1, 0, 1]}
Weighted least squares (weights = 1 / variance of each measure)
admin
ml train "wls" "wls" "[[1], [2], [3], [4], [5]]" "[2.2, 3.9, 6.1, 8.3, 9.7]" "{\"weights\": [1, 2, 1, 2, 1]}"
mentdb
{"id": "wls", "algo": "wls", "kind": "regressor", "n_samples": 5, "n_features": 1, "params": {"weights":[1,2,1,2,1]}, "train_r2": 0.9942840144445739, "intercept": 0.1071428571428612, "coef": [1.9833333333333307], "coefficients": [{"name": "intercept", "estimate": 0.1071428571428612, "std_error": 0.30560708697603484, "t": 0.35059022420924146, "p_value": 0.7490688862847927, "ci_low": -0.8654352875422783, "ci_high": 1.0797210018280006}, {"name": "x0", "estimate": 1.9833333333333307, "std_error": 0.09336450726550884, "t": 21.24290473352097, "p_value": 2.282313012639175E-4, "ci_low": 1.686205802181373, "ci_high": 2.2804608644852884}], "weighted_r2": 0.9933958671557132, "sigma": 0.3234241404149898}
Isotonic regression: a dose-response that can only increase
admin
ml train "iso" "isotonic" "[[1], [2], [3], [4], [5], [6]]" "[1, 3, 2, 4, 3.5, 5]" "{}"
mentdb
{"id": "iso", "algo": "isotonic", "kind": "regressor", "n_samples": 6, "n_features": 1, "params": {}, "train_r2": 0.9387755102040817, "x": [1, 2, 3, 4, 5, 6], "fitted": [1, 2.5, 2.5, 3.75, 3.75, 5]}
Sparse logistic regression (liblinear, L1 penalty): some coefficients are exactly 0
admin
ml train "l1" "liblinear_logistic" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]" "{\"penalty\": \"l1\"}"
mentdb
{"id": "l1", "algo": "liblinear_logistic", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {"penalty":"l1"}, "classes": [0, 1, 2], "train_accuracy": 1, "solver": "L1R_LR", "coef": [[-0.6046643542974789, -0.17067637207652772], [0, 0.7637938652724102], [0.5026806018134624, -0.32857901666305933]], "non_zero": 5}
Linear SVM (liblinear)
admin
ml train "lsvm" "linear_svm" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]" "{\"C\": 1}"
mentdb
{"id": "lsvm", "algo": "linear_svm", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {"C":1}, "classes": [0, 1, 2], "train_accuracy": 1, "solver": "L2R_L2LOSS_SVC_DUAL", "coef": [[-0.2631636089281483, -0.1377868762759679], [0.03437428428150138, 0.29954708238910843], [0.23324530865192009, -0.17995374594713365]], "non_zero": 6}
Linear support vector regression (liblinear)
admin
ml train "lsvr" "linear_svr" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]" "[6.1, 8.0, 11.2, 14.1, 18.3, 19.9, 24.8, 26.1]" "{\"C\": 100, \"epsilon\": 0.01}"
mentdb
{"id": "lsvr", "algo": "linear_svr", "kind": "regressor", "n_samples": 8, "n_features": 2, "params": {"epsilon":0.01,"C":100}, "train_r2": 0.9986394655160965, "solver": "L2R_L2LOSS_SVR_DUAL", "coef": [1.889891667496855, 1.003682953870743], "non_zero": 2}
nu-SVM: nu bounds the fraction of support vectors
admin
ml train "nusvm" "svm_classifier" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]" "{\"type\": \"nu\", \"nu\": 0.3}"
mentdb
{"id": "nusvm", "algo": "svm_classifier", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {"nu":0.3,"type":"nu"}, "classes": [0, 1, 2], "train_accuracy": 1, "support_vectors": 8}
C and gamma chosen by cross validation
admin
ml train "auto" "svm_classifier" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]" "{\"C\": \"auto\"}"
mentdb
{"id": "auto", "algo": "svm_classifier", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {"C":"auto"}, "classes": [0, 1, 2], "train_accuracy": 1, "support_vectors": 12, "auto": {"C": 0.01, "gamma": 0.05, "cv_accuracy": 1}}
Crammer-Singer multiclass linear SVM
admin
ml train "cs" "linear_svm" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]" "{\"multiclass\": \"crammer_singer\"}"
mentdb
{"id": "cs", "algo": "linear_svm", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {"multiclass":"crammer_singer"}, "classes": [0, 1, 2], "train_accuracy": 1, "solver": "MCSVM_CS", "coef": [[-0.1494330511466499, -0.07459847128757915], [0.010281329851293455, 0.17177552522258244], [0.13915172129535644, -0.09717705393500306]], "non_zero": 6}
Bagging of 10 k nearest neighbors models, out-of-bag accuracy
admin
ml train "bag" "bagging_classifier" "[[1, 5], [2, 6], [3, 5], [4, 7], [5, 6], [6, 8], [7, 7], [8, 8], [2, 8], [6, 5], [3, 7], [7, 5]]" "[0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1]" "{\"base\": {\"algo\": \"knn_classifier\", \"params\": {\"k\": 3}}, \"n_estimators\": 10}"
mentdb
{"id": "bag", "algo": "bagging_classifier", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {"n_estimators":10,"base":{"params":{"k":3},"algo":"knn_classifier"}}, "classes": [0, 1], "train_accuracy": 0.9166666666666666, "method": "bagging", "n_estimators": 10, "base": "knn_classifier", "oob_accuracy": 0.75}
AdaBoost of decision stumps (SAMME)
admin
ml train "ada" "adaboost_classifier" "[[1, 5], [2, 6], [3, 5], [4, 7], [5, 6], [6, 8], [7, 7], [8, 8], [2, 8], [6, 5], [3, 7], [7, 5]]" "[0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1]" "{\"n_estimators\": 20}"
mentdb
{"id": "ada", "algo": "adaboost_classifier", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {"n_estimators":20}, "classes": [0, 1], "train_accuracy": 0.9166666666666666, "method": "adaboost", "n_estimators": 7, "estimator_weights": [1.0986122886681096, 0.9555114450274362, 1.203972804325936, 0.6410908186038923, 0.3315811388877808, 0.568963888449741, 0.19405414471959614], "base": "decision_tree_classifier"}
Stacking: naive Bayes and k nearest neighbors, logistic regression on their out-of-fold probabilities
admin
ml train "stk" "stacking_classifier" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]" "{\"estimators\": [\"naive_bayes\", {\"algo\": \"knn_classifier\", \"params\": {\"k\": 3}}], \"k\": 3}"
mentdb
{"id": "stk", "algo": "stacking_classifier", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {"estimators":["naive_bayes",{"params":{"k":3},"algo":"knn_classifier"}],"k":3}, "classes": [0, 1, 2], "train_accuracy": 1, "method": "stacking", "n_estimators": 2, "final_estimator": "logistic"}
Soft vote of three classifiers
admin
ml train "vote" "voting_classifier" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[\"low\", \"low\", \"low\", \"low\", \"mid\", \"mid\", \"mid\", \"mid\", \"high\", \"high\", \"high\", \"high\"]" "{\"estimators\": [\"naive_bayes\", \"lda\", \"decision_tree_classifier\"]}"
mentdb
{"id": "vote", "algo": "voting_classifier", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {"estimators":["naive_bayes","lda","decision_tree_classifier"]}, "classes": ["high", "low", "mid"], "train_accuracy": 1, "method": "voting", "n_estimators": 3, "voting": "soft"}
Vote of two regressors
admin
ml train "vr" "voting_regressor" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]" "[6.1, 8.0, 11.2, 14.1, 18.3, 19.9, 24.8, 26.1]" "{\"estimators\": [\"linear\", \"huber\"]}"
mentdb
{"id": "vr", "algo": "voting_regressor", "kind": "regressor", "n_samples": 8, "n_features": 2, "params": {"estimators":["linear","huber"]}, "train_r2": 0.9986031328029731, "method": "voting", "n_estimators": 2, "voting": "soft"}
OneR: the best single feature
admin
ml train "one" "one_r" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[\"low\", \"low\", \"low\", \"low\", \"mid\", \"mid\", \"mid\", \"mid\", \"high\", \"high\", \"high\", \"high\"]" "{\"min_bucket\": 3}"
mentdb
{"id": "one", "algo": "one_r", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {"min_bucket":3}, "classes": ["high", "low", "mid"], "train_accuracy": 1, "rules": 3, "feature": 0, "training_accuracy": 1}
RIPPER: ordered if-then rules
admin
ml train "rip" "ripper" "[[2, 1], [3, 2], [6, 1], [7, 2], [8, 1], [6, 6], [7, 8], [2, 7], [3, 5], [1, 2], [9, 2], [8, 7], [4, 4], [6.5, 2.5], [2.5, 8]]" "[\"no\", \"no\", \"yes\", \"yes\", \"yes\", \"no\", \"no\", \"no\", \"no\", \"no\", \"yes\", \"no\", \"no\", \"yes\", \"no\"]" "{}"
mentdb
{"id": "rip", "algo": "ripper", "kind": "classifier", "n_samples": 15, "n_features": 2, "params": {}, "classes": ["no", "yes"], "train_accuracy": 1, "rules": 2, "default_class": "no", "training_accuracy": 1}
M5 model tree: a linear model in each leaf
admin
ml train "m5" "m5" "[[1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [14], [15], [16], [17], [18], [19], [20], [21], [22], [23], [24]]" "[1.5, 3.5, 6.3, 7.1, 9.9, 11.1, 14.4, 16.1, 18.5, 19.8, 22.2, 23.9, 22.7, 22.1, 20.5, 19.9, 19.3, 18.0, 16.8, 16.9, 15.0, 13.8, 13.1, 11.8]" "{}"
mentdb
{"id": "m5", "algo": "m5", "kind": "regressor", "n_samples": 24, "n_features": 1, "params": {}, "train_r2": 0.9954985725202457, "leaves": 5, "smoothed": false}
Gaussian process: the length scale, the signal variance and the noise by maximum likelihood
admin
ml train "gp" "gaussian_process" "[[0], [0.5], [1], [1.5], [2], [2.5], [3], [3.5], [4], [5], [6]]" "[0.02, 0.5, 0.83, 1.01, 0.9, 0.62, 0.13, -0.33, -0.78, -0.95, -0.3]" "{}"
mentdb
{"id": "gp", "algo": "gaussian_process", "kind": "regressor", "n_samples": 11, "n_features": 1, "params": {}, "train_r2": 0.9995909376674038, "kernel": "rbf", "length_scale": 1.1456293313027177, "signal_variance": 3.6036512533026195, "noise": 8.606243576114696E-4, "log_marginal_likelihood": 6.644204256653743}
Bayesian network, tree augmented naive Bayes (TAN) on features discretized by MDL
admin
ml train "bn" "bayes_net" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[\"low\", \"low\", \"low\", \"low\", \"mid\", \"mid\", \"mid\", \"mid\", \"high\", \"high\", \"high\", \"high\"]" "{}"
mentdb
{"id": "bn", "algo": "bayes_net", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {}, "classes": ["high", "low", "mid"], "train_accuracy": 1, "structure": "tan", "network": [{"feature": "x0", "parents": ["class"], "cuts": [3.25, 7.35]}, {"feature": "x1", "parents": ["class", "x0"], "cuts": [1.65, 4.85]}], "log_score": -13.183347464017316}
Bayesian network searched by K2
admin
ml train "k2" "bayes_net" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[\"low\", \"low\", \"low\", \"low\", \"mid\", \"mid\", \"mid\", \"mid\", \"high\", \"high\", \"high\", \"high\"]" "{\"structure\": \"k2\", \"discretize\": \"frequency\", \"bins\": 3}"
mentdb
{"id": "k2", "algo": "bayes_net", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {"bins":3,"discretize":"frequency","structure":"k2"}, "classes": ["high", "low", "mid"], "train_accuracy": 1, "structure": "k2", "network": [{"feature": "x0", "parents": ["class"], "cuts": [3.25, 7.35]}, {"feature": "x1", "parents": ["class"], "cuts": [1.65, 4.85]}], "log_score": -13.183347464017316}
Cost-sensitive: missing a 1 costs 5 times more than a false alarm
admin
ml train "cs5" "cost_sensitive_classifier" "[[1, 5], [2, 6], [3, 5], [4, 7], [5, 6], [6, 8], [7, 7], [8, 8], [2, 8], [6, 5], [3, 7], [7, 5]]" "[0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1]" "{\"base\": \"logistic\", \"cost\": [[0, 1], [5, 0]]}"
mentdb
{"id": "cs5", "algo": "cost_sensitive_classifier", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {"cost":[[0,1],[5,0]],"base":"logistic"}, "classes": [0, 1], "train_accuracy": 0.5833333333333334, "method": "minimize_cost", "base": "logistic", "cost": [[0, 1], [5, 0]]}
Quantile regression: the 90th percentile
admin
ml train "q90" "quantile_regression" "[[1], [2], [3], [4], [5], [6], [7], [8]]" "[2.1, 3.9, 6.2, 8.1, 9.8, 12.2, 40, 15.9]" "{\"quantile\": 0.9}"
mentdb
{"id": "q90", "algo": "quantile_regression", "kind": "regressor", "n_samples": 8, "n_features": 1, "params": {"quantile":0.9}, "train_r2": -0.9254942234459915, "quantile": 0.9, "intercept": -4.216666901234568, "coefficients": [6.31666664197531]}
Pipeline: standardization, PCA, then k nearest neighbors, in one model
admin
ml train "pipe" "pipeline_classifier" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[\"low\", \"low\", \"low\", \"low\", \"mid\", \"mid\", \"mid\", \"mid\", \"high\", \"high\", \"high\", \"high\"]" "{\"steps\": [\"scaler_zscore\", {\"algo\": \"pca\", \"params\": {\"n_components\": 1}}], \"final\": {\"algo\": \"knn_classifier\", \"params\": {\"k\": 3}}}"
mentdb
{"id": "pipe", "algo": "pipeline_classifier", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {"final":{"params":{"k":3},"algo":"knn_classifier"},"steps":["scaler_zscore",{"params":{"n_components":1},"algo":"pca"}]}, "classes": ["high", "low", "mid"], "train_accuracy": 1, "steps": ["scaler_zscore", "pca", "knn_classifier"], "final": {"k": 3, "metric": "euclidean", "weights": "uniform", "scale": false}}
Calibrated probabilities of a naive Bayes (isotonic)
admin
ml train "cal" "calibrated_classifier" "[[1, 5], [2, 6], [3, 5], [4, 7], [5, 6], [6, 8], [7, 7], [8, 8], [2, 8], [6, 5], [3, 7], [7, 5]]" "[0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1]" "{\"method\": \"isotonic\", \"k\": 3}"
mentdb
{"id": "cal", "algo": "calibrated_classifier", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {"method":"isotonic","k":3}, "classes": [0, 1], "train_accuracy": 0.5833333333333334, "method": "isotonic", "base": "naive_bayes"}
Used in use cases (21 recipes)

    Process & reactor engineer › Yield regimes with a model tree
    Biologist & microbiologist › Monotonic dose-response curve
    Epidemiologist › Odds ratios of a case-control study
    Geneticist & bioinformatician › Sparse gene signature with an L1 logistic regression
    Climate & environment scientist › Temperature between sparse stations
    IoT & sensor engineer › Route the maintenance tickets
    and 15 more in the Use cases
Often used with

    ml model delete  ·  ml model predict  ·  ml cross_validate  ·  ml model predict_interval  ·  ml model predict_proba  ·  ml model rules  ·  file delete  ·  math abs

ml fit <id> <algo> <json_X>


Description

    Fit an unsupervised model with the default parameters (clustering, transformer, anomaly detector) and keep it in memory

Parameters

    id:   The model id - String - required
    algo:   The algorithm: kmeans, fuzzy_cmeans, gmm, em_mixed, som, pca, ica, nmf, kernel_pca, scaler_minmax, scaler_zscore, scaler_robust, scaler_maxabs, isolation_forest, one_class_svm - String - required
    json_X:   The rows - String - required
admin
ml fit "sc" "scaler_zscore" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]"
mentdb
{"id": "sc", "algo": "scaler_zscore", "kind": "transformer", "n_samples": 8, "n_features": 2, "params": {}, "center": [4.5, 4.125], "scale": [2.449489742783178, 2.850438562747845]}
Principal component analysis
admin
ml fit "pca" "pca" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]"
mentdb
{"id": "pca", "algo": "pca", "kind": "transformer", "n_samples": 8, "n_features": 2, "params": {}, "components": [[0.6501176375186445, 0.7598335721637841], [0.7598335721637841, -0.6501176375186445]], "explained_variance": [13.930893161238439, 0.19410683876156246], "explained_variance_ratio": [0.9862579229195355, 0.013742077080464599], "cumulative_ratio": [0.9862579229195355, 1], "mean": [4.5, 4.125]}

ml fit <id> <algo> <json_X> <json_params>


Description

    Fit an unsupervised model with parameters

Parameters

    id:   The model id - String - required
    algo:   The algorithm (see ml algos) - String - required
    json_X:   The rows - String - required
    json_params:   The parameters, ex: {"k": 3} - String - required
admin
ml fit "km" "kmeans" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "{\"k\": 3}"
mentdb
{"id": "km", "algo": "kmeans", "kind": "clustering", "n_samples": 12, "n_features": 2, "params": {"k":3}, "centers": [[1.125, 1.975], [8.875, 1.125], [5.675, 8.025]], "sizes": [4, 4, 4], "labels": [0, 0, 0, 0, 2, 2, 2, 2, 1, 1, 1, 1], "inertia": 2.265, "iterations": 2}
Gaussian mixture: weights, means, covariances, AIC, BIC
admin
ml fit "gmm" "gmm" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "{\"k\": 3}"
mentdb
{"id": "gmm", "algo": "gmm", "kind": "clustering", "n_samples": 12, "n_features": 2, "params": {"k":3}, "weights": [0.3333333333333333, 0.3333333333333333, 0.3333333333333333], "means": [[1.125, 1.975], [8.875, 1.125], [5.675, 8.025]], "covariances": [[[0.06687599999999999, -0.006874999999999988], [-0.006874999999999988, 0.021876000000000024]], [[0.06687599999999985, -0.06687499999999992], [-0.06687499999999992, 0.06687599999999999]], [[0.21687600000000004, 0.07562499999999996], [0.07562499999999996, 0.126876]]], "log_likelihood": 7.189060273446542, "aic": 19.621879453106914, "bic": 27.86529249950292, "iterations": 2}
PCA keeping 95% of the variance
admin
ml fit "pca" "pca" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]" "{\"n_components\": 0.95, \"standardize\": true}"
mentdb
{"id": "pca", "algo": "pca", "kind": "transformer", "n_samples": 8, "n_features": 2, "params": {"n_components":0.95,"standardize":true}, "components": [[0.7071067811865475, 0.7071067811865478]], "explained_variance": [1.971870186196374], "explained_variance_ratio": [0.9859350930981868], "cumulative_ratio": [0.9859350930981868], "mean": [4.5, 4.125]}
Isolation forest
admin
ml fit "iso" "isolation_forest" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "{\"n_trees\": 50}"
mentdb
{"id": "iso", "algo": "isolation_forest", "kind": "anomaly", "n_samples": 12, "n_features": 2, "params": {"n_trees":50}, "n_trees": 50, "sample_size": 12, "threshold": 0.5}
Self-organizing map of 2 x 2 nodes
admin
ml fit "som" "som" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "{\"rows\": 2, \"cols\": 2}"
mentdb
{"id": "som", "algo": "som", "kind": "clustering", "n_samples": 12, "n_features": 2, "params": {"rows":2,"cols":2}, "rows": 2, "cols": 2, "hits": [4, 4, 0, 4], "quantization_error": 0.43191705328649355, "topographic_error": 0.3333333333333333, "weights": [[2.3068076274525606, 1.9952628614088286], [7.542378100764898, 2.0637808444632038], [3.8736967806436353, 4.653618706478728], [6.017605604484293, 6.917178252442712]]}
Independent components (FastICA)
admin
ml fit "ica" "ica" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]" "{\"n_components\": 2}"
mentdb
{"id": "ica", "algo": "ica", "kind": "transformer", "n_samples": 8, "n_features": 2, "params": {"n_components":2}, "components": [[-0.07599918428766368, -0.3112583949361164], [-1.8515362238256674, 1.5617193307971864]]}
Non-negative factorization in 2 parts
admin
ml fit "nmf" "nmf" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "{\"n_components\": 2}"
mentdb
{"id": "nmf", "algo": "nmf", "kind": "transformer", "n_samples": 12, "n_features": 2, "params": {"n_components":2}, "components": [[0.4950101728290347, 1.255860317472518], [2.8865191891800994, 0.18345922849877425]], "reconstruction_error": 6.550700930819886E-13}
Kernel PCA (rbf)
admin
ml fit "kp" "kernel_pca" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "{\"n_components\": 2, \"gamma\": 0.1}"
mentdb
{"id": "kp", "algo": "kernel_pca", "kind": "transformer", "n_samples": 12, "n_features": 2, "params": {"n_components":2,"gamma":0.1}, "kernel": "rbf", "eigenvalues": [3.903505756413059, 3.7801644327528003]}
EM of mixed data: column 1 is a category
admin
ml fit "mix" "em_mixed" "[[1.2, 0], [1.0, 0], [0.8, 0], [1.1, 1], [5.1, 1], [4.9, 2], [5.3, 2], [5.0, 2]]" "{\"k\": 2, \"categorical\": [1]}"
mentdb
{"id": "mix", "algo": "em_mixed", "kind": "clustering", "n_samples": 8, "n_features": 2, "params": {"categorical":[1],"k":2}, "clusters": [{"weight": 0.5, "means": [5.075, 0], "categories": [{"column": 1, "mode": 2, "probability": 0.6363636363636364}]}, {"weight": 0.5, "means": [1.025, 0], "categories": [{"column": 1, "mode": 0, "probability": 0.6363636363636364}]}], "log_likelihood": -6.917519033881967, "bic": 32.550011942882456}
Used in use cases (7 recipes)

    Chemist › Unmix absorption spectra
    Electronics & signal engineer › Separate two mixed sources
    IoT & sensor engineer › Detect abnormal machines with an isolation forest
    Data scientist › From SQL rows to a trained model
    Statistician & biostatistician › How many populations? Gaussian mixture and BIC
    Machine learning engineer › Map the operating modes of a machine with a self-organizing map
    and 1 more in the Use cases
Often used with

    ml model delete  ·  ml model transform  ·  ml model predict  ·  json doc  ·  matrix transpose  ·  ml elbow  ·  ml prep impute  ·  ml prep matrix

ml model predict <id> <json_X>


Description

    Predict with a model: the labels (classifier), the values (regressor), the cluster index (clustering) or 1 for an anomaly and 0 for a normal row (anomaly detector)

Parameters

    id:   The model id - String - required
    json_X:   The rows - String - required
admin
ml train "nb" "naive_bayes" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]"; ml model predict "nb" "[[1, 2], [6, 8], [9, 1]]"
mentdb
[0, 1, 2]
Regression
admin
ml train "lin" "linear" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]" "[6.1, 8.0, 11.2, 14.1, 18.3, 19.9, 24.8, 26.1]"; ml model predict "lin" "[[9, 9], [10, 9]]"
mentdb
[29.4726415094338, 31.37547169811299]
Cluster of new points
admin
ml fit "km" "kmeans" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "{\"k\": 3}"; ml model predict "km" "[[1, 1], [9, 1]]"
mentdb
[0, 1]
Anomalies
admin
ml fit "iso" "isolation_forest" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "{\"contamination\": 0.1}"; ml model predict "iso" "[[5.5, 8], [30, 30]]"
mentdb
[0, 1]
Used in use cases (11 recipes)

    Biologist & microbiologist › Monotonic dose-response curve
    Epidemiologist › Detect a rare disease with SMOTE
    IoT & sensor engineer › Detect abnormal machines with an isolation forest
    Industrial quality engineer › Inspection driven by the cost of errors
    Data scientist › From SQL rows to a trained model
    Machine learning engineer › Tune a gradient boosting with a grid search
    and 5 more in the Use cases
Often used with

    ml model delete  ·  ml train  ·  ml fit  ·  ml model transform  ·  math abs  ·  math floor  ·  math max  ·  math mod

ml model predict_proba <id> <json_X>


Description

    Get the probability of each class (classifier)

Parameters

    id:   The model id - String - required
    json_X:   The rows - String - required
admin
ml train "lr" "logistic" "[[1, 5], [2, 6], [3, 5], [4, 7], [5, 6], [6, 8], [7, 7], [8, 8], [2, 8], [6, 5], [3, 7], [7, 5]]" "[0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1]"; ml model predict_proba "lr" "[[4, 6], [7, 8]]"
mentdb
{"classes": [0, 1], "proba": [[0.618943596231428, 0.381056403768572], [0.09751468455906687, 0.9024853154409331]]}
Used in use cases (2 recipes)

    Machine learning engineer › Save a trained model and score with it later
    Deep learning engineer › Predictive maintenance with a neural network
Often used with

    ml model delete  ·  ml train  ·  file delete  ·  math max  ·  ml cross_validate  ·  ml model info  ·  ml model load  ·  ml model predict

ml model transform <id> <json_X>


Description

    Transform the rows: scaled values (scaler), components (PCA), distance to each center (kmeans), membership degrees (fuzzy_cmeans), probability of each component (gmm), anomaly score (isolation_forest, one_class_svm)

Parameters

    id:   The model id - String - required
    json_X:   The rows - String - required
admin
ml fit "mm" "scaler_minmax" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]"; ml model transform "mm" "[[4.5, 4.5]]"
mentdb
[[0.5, 0.5]]
Projection on the principal components
admin
ml fit "pca" "pca" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]" "{\"n_components\": 1}"; ml model transform "pca" "[[1, 1], [8, 8]]"
mentdb
[[-4.649891644327081], [5.219766823449919]]
Used in use cases (6 recipes)

    Chemist › Unmix absorption spectra
    Electronics & signal engineer › Separate two mixed sources
    IoT & sensor engineer › Detect abnormal machines with an isolation forest
    Data scientist › From SQL rows to a trained model
    Machine learning engineer › Map the operating modes of a machine with a self-organizing map
    Data scientist › Customer segments on principal components
Often used with

    ml fit  ·  ml model delete  ·  ml model predict  ·  json doc  ·  matrix transpose  ·  ml elbow  ·  ml prep impute  ·  ml prep matrix

ml model inverse_transform <id> <json_X>


Description

    Go back to the original values (scaler, PCA)

Parameters

    id:   The model id - String - required
    json_X:   The transformed rows - String - required
admin
ml fit "mm" "scaler_minmax" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]"; ml model inverse_transform "mm" "[[0, 1], [0.5, 0.5]]"
mentdb
[[1, 8], [4.5, 4.5]]

ml model score <id> <json_X> <json_y>


Description

    Get the accuracy (classifier) or the R2 (regressor) on a data set

Parameters

    id:   The model id - String - required
    json_X:   The rows - String - required
    json_y:   The true labels or values - String - required
admin
ml train "knn" "knn_classifier" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]" "{\"k\": 3}"; ml model score "knn" "[[1, 2.5], [6, 7], [9, 2]]" "[0, 1, 1]"
mentdb
0.6666666666666666
Used in use cases (1 recipe)

    Deep learning engineer › A neural network learns the XOR truth table
Often used with

    math abs  ·  math floor  ·  math mod  ·  ml model delete  ·  ml model predict  ·  ml train

ml model evaluate <id> <json_X> <json_y>


Description

    Full evaluation on a test set: classification report (precision, recall, f1, kappa, MCC, confusion matrix) or regression metrics (MAE, MSE, RMSE, MAPE, R2...)

Parameters

    id:   The model id - String - required
    json_X:   The rows - String - required
    json_y:   The true labels or values - String - required
admin
ml train "lda" "lda" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]"; ml model evaluate "lda" "[[1, 2.5], [6, 7], [9, 2], [5, 1]]" "[0, 1, 2, 2]"
mentdb
{"accuracy": 1, "classes": [{"label": 0, "precision": 1, "recall": 1, "f1": 1, "support": 1}, {"label": 1, "precision": 1, "recall": 1, "f1": 1, "support": 1}, {"label": 2, "precision": 1, "recall": 1, "f1": 1, "support": 2}], "macro": {"precision": 1, "recall": 1, "f1": 1}, "weighted": {"precision": 1, "recall": 1, "f1": 1}, "kappa": 1, "mcc": 1, "confusion": [[1, 0, 0], [0, 1, 0], [0, 0, 2]], "labels": [0, 1, 2]}
Used in use cases (1 recipe)

    Machine learning engineer › Random forest with a hold-out test set
Often used with

    ml model delete  ·  ml model importance  ·  ml prep split_stratified  ·  ml train

ml model importance <id>


Description

    Get the importance of each feature and the ranking (trees, forests, boosting, linear models, PCA)

Parameters

    id:   The model id - String - required
admin
ml train "rf" "random_forest_classifier" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]" "{\"n_trees\": 50}"; ml model importance "rf"
mentdb
{"importance": [0.5198131210107259, 0.48018687898927415], "ranking": [0, 1]}
Used in use cases (1 recipe)

    Machine learning engineer › Random forest with a hold-out test set
Often used with

    ml model delete  ·  ml model evaluate  ·  ml prep split_stratified  ·  ml train

ml model predict_interval <id> <json_X> <level>


Description

    Prediction interval at a level: exact Student interval of the linear regression (OLS), Gaussian interval of gaussian_process (wider far from the data), Laplace interval of svm_regressor trained with {"probability": true}

Parameters

    id:   The model id - String - required
    json_X:   The rows - String - required
    level:   The level, ex: 0.95 - Number - required
admin
ml train "lin" "linear" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]" "[6.1, 8.0, 11.2, 14.1, 18.3, 19.9, 24.8, 26.1]"; ml model predict_interval "lin" "[[9, 9], [4.5, 4]]" 0.95
mentdb
[{"prediction": 29.4726415094338, "lower": 28.408755856197086, "upper": 30.536527162670513}, {"prediction": 15.938207547169853, "lower": 15.050152056481128, "upper": 16.826263037858578}]
Support vector regression
admin
ml train "svr" "svm_regressor" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]" "[6.1, 8.0, 11.2, 14.1, 18.3, 19.9, 24.8, 26.1]" "{\"C\": 10, \"probability\": true}"; ml model predict_interval "svr" "[[9, 9]]" 0.95
mentdb
[{"prediction": 23.995092183609525, "lower": 17.179107519201267, "upper": 30.811076848017784}]
Gaussian process: the interval grows outside the data (x = 9)
admin
ml train "gp" "gaussian_process" "[[0], [0.5], [1], [1.5], [2], [2.5], [3], [3.5], [4], [5], [6]]" "[0.02, 0.5, 0.83, 1.01, 0.9, 0.62, 0.13, -0.33, -0.78, -0.95, -0.3]"; ml model predict_interval "gp" "[[1.5], [4.5], [9]]" 0.95
mentdb
[{"prediction": 0.9970255969807764, "lower": 0.9508531931424334, "upper": 1.0431980008191195}, {"prediction": -0.9795884847459152, "lower": -1.0300936413407031, "upper": -0.9290833281511273}, {"prediction": 0.8174345280669167, "lower": -1.0035827482883013, "upper": 2.638451804422135}]
Used in use cases (2 recipes)

    Climate & environment scientist › Temperature between sparse stations
    Statistician & biostatistician › Prediction interval of a calibration
Often used with

    ml model delete  ·  ml train

ml model permutation_importance <id> <json_X> <json_y> <repeats> <seed>


Description

    Importance of each feature for any supervised model: drop of the score (accuracy or R2) when the column is shuffled, mean and standard deviation over the repeats, ranking

Parameters

    id:   The model id - String - required
    json_X:   The rows (a test set is better) - String - required
    json_y:   The true labels or values - String - required
    repeats:   The number of shuffles per column - Number - required
    seed:   The seed - Number - required
admin
ml train "rf" "random_forest_classifier" "[[1, 5], [2, 6], [3, 5], [4, 7], [5, 6], [6, 8], [7, 7], [8, 8], [2, 8], [6, 5], [3, 7], [7, 5]]" "[0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1]" "{\"seed\": 1}"; ml model permutation_importance "rf" "[[1, 5], [2, 6], [3, 5], [4, 7], [5, 6], [6, 8], [7, 7], [8, 8], [2, 8], [6, 5], [3, 7], [7, 5]]" "[0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1]" 10 1
mentdb
{"metric": "accuracy", "base_score": 1, "importance": [0.30000000000000004, 0.325], "std": [0.09781564923143896, 0.1269903272295829], "ranking": [1, 0]}
Used in use cases (1 recipe)

    Data scientist › Explain a model and one of its predictions
Often used with

    ml model delete  ·  ml model explain  ·  ml model partial_dependence  ·  ml train

ml model partial_dependence <id> <json_X> <feature> <points>


Description

    Partial dependence: average prediction (regressor) or average probability of each class (classifier) when one column takes the values of a grid between its 5th and 95th percentiles

Parameters

    id:   The model id - String - required
    json_X:   The rows - String - required
    feature:   The column index - Number - required
    points:   The number of points of the grid (2 to 200) - Number - required
admin
ml train "gb" "gradient_boosting_regressor" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]" "[6.1, 8.0, 11.2, 14.1, 18.3, 19.9, 24.8, 26.1]" "{\"n_estimators\": 50}"; ml model partial_dependence "gb" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]" 0 4
mentdb
{"feature": 0, "grid": [1.35, 3.4499999999999997, 5.549999999999999, 7.65], "average_prediction": [11.534049420829904, 13.580183754043789, 18.217273099253994, 21.316817774378357]}
Used in use cases (1 recipe)

    Data scientist › Explain a model and one of its predictions
Often used with

    ml model delete  ·  ml model explain  ·  ml model permutation_importance  ·  ml train

ml model explain <id> <json_background> <json_row>


Description

    Explain one prediction: the effect of each feature = prediction of the row minus the average prediction when this feature takes the values of a background data set (the other features keep the values of the row)

Parameters

    id:   The model id - String - required
    json_background:   The background rows (ex: the training set) - String - required
    json_row:   The row to explain, ex: [[8, 2]] - String - required
admin
ml train "lin" "linear" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]" "[6.1, 8.0, 11.2, 14.1, 18.3, 19.9, 24.8, 26.1]"; ml model explain "lin" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]" "[[8, 2]]"
mentdb
{"prediction": 20.609433962263978, "baseline": 16.062500000000043, "effects": [6.659905660377163, -2.1129716981132276]}
Classifier: effects on the probability of the predicted class
admin
ml train "rf" "random_forest_classifier" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]" "{\"seed\": 1}"; ml model explain "rf" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[[6, 7.5]]"
mentdb
{"class": 1, "probability": 1, "baseline": 0.33666666666666667, "effects": [0.2733333333333331, 0.4866666666666667]}
Used in use cases (1 recipe)

    Data scientist › Explain a model and one of its predictions
Often used with

    ml model delete  ·  ml model partial_dependence  ·  ml model permutation_importance  ·  ml train

ml model rules <id>


Description

    Get the readable rules of a model: decision tree (one rule per leaf), one_r and ripper (ordered rules: the first rule that fires gives the class), m5 (the linear model of each leaf)

Parameters

    id:   The model id - String - required
admin
ml train "tree" "decision_tree_classifier" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[\"low\", \"low\", \"low\", \"low\", \"mid\", \"mid\", \"mid\", \"mid\", \"high\", \"high\", \"high\", \"high\"]"; ml model rules "tree"
mentdb
[{"if": "x0 <= 3.25", "then": "low", "probability": 1, "samples": 4}, {"if": "x0 > 3.25 and x1 <= 4.5", "then": "high", "probability": 1, "samples": 4}, {"if": "x0 > 3.25 and x1 > 4.5", "then": "mid", "probability": 1, "samples": 4}]
RIPPER
admin
ml train "rip" "ripper" "[[2, 1], [3, 2], [6, 1], [7, 2], [8, 1], [6, 6], [7, 8], [2, 7], [3, 5], [1, 2], [9, 2], [8, 7], [4, 4], [6.5, 2.5], [2.5, 8]]" "[\"no\", \"no\", \"yes\", \"yes\", \"yes\", \"no\", \"no\", \"no\", \"no\", \"no\", \"yes\", \"no\", \"no\", \"yes\", \"no\"]"; ml model rules "rip"
mentdb
[{"if": "x0 > 5.5 and x1 <= 5", "then": "yes", "probability": 0.8571428571428571, "samples": 5}, {"if": "true", "then": "no", "probability": 0.9166666666666666, "samples": 10}]
M5 model tree
admin
ml train "m5" "m5" "[[1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [14], [15], [16], [17], [18], [19], [20], [21], [22], [23], [24]]" "[1.5, 3.5, 6.3, 7.1, 9.9, 11.1, 14.4, 16.1, 18.5, 19.8, 22.2, 23.9, 22.7, 22.1, 20.5, 19.9, 19.3, 18.0, 16.8, 16.9, 15.0, 13.8, 13.1, 11.8]"; ml model rules "m5"
mentdb
[{"if": "x0 <= 6.5", "then": "y = -0.23333326144762 + 1.9428571223183675 * x0", "samples": 6}, {"if": "x0 > 6.5 and x0 <= 10.5", "then": "y = 1.390000189719995 + 1.8599999776800005 * x0", "samples": 4}, {"if": "x0 > 10.5 and x0 <= 14.5", "then": "y = 22.725", "samples": 4}, {"if": "x0 > 14.5 and x0 <= 20.5", "then": "y = 32.86666651549524 - 0.8171428485044899 * x0", "samples": 6}, {"if": "x0 > 20.5", "then": "y = 36.599999721900005 - 1.0299999876400001 * x0", "samples": 4}]
Used in use cases (2 recipes)

    Process & reactor engineer › Yield regimes with a model tree
    Industrial quality engineer › Readable rules of the defects
Often used with

    ml model delete  ·  ml train  ·  ml cross_validate

ml model pmml <id>


Description

    Export a model to PMML 4.4 (XML) to score it in another tool (JPMML, KNIME, SAS, R...): linear, ridge, lasso, elastic_net, huber, ransac, wls, poisson, logistic, naive_bayes, decision trees, random forests, extra trees, gradient boosting, kmeans; the features are named x0, x1...

Parameters

    id:   The model id - String - required
admin
ml train "lin" "linear" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]" "[6.1, 8.0, 11.2, 14.1, 18.3, 19.9, 24.8, 26.1]"; ml model pmml "lin"
mentdb
<?xml version="1.0" encoding="UTF-8"?> <PMML xmlns="http://www.dmg.org/PMML-4_4" version="4.4"> <Header description="MentDB model lin (linear)"><Application name="MentDB"/></Header> <DataDictionary numberOfFields="3"> <DataField name="x0" optype="continuous" dataType="double"/> <DataField name="x1" optype="continuous" dataType="double"/> <DataField name="y" optype="continuous" dataType="double"/> </DataDictionary> <RegressionModel functionName="regression" algorithmName="linear"> <MiningSchema> <MiningField name="y" usageType="target"/> <MiningField name="x0"/> <MiningField name="x1"/> </MiningSchema> <RegressionTable intercept="3.398113207547425"> <NumericPredictor name="x0" coefficient="1.9028301886791894"/> <NumericPredictor name="x1" coefficient="0.9943396226415189"/> </RegressionTable> </RegressionModel> </PMML>

ml model pmml <id> <json_params>


Description

    PMML export with parameters: features (the names of the columns), target (the name of the predicted field, y)

Parameters

    id:   The model id - String - required
    json_params:   The parameters - String - required
admin
ml train "tree" "decision_tree_classifier" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[\"low\", \"low\", \"low\", \"low\", \"mid\", \"mid\", \"mid\", \"mid\", \"high\", \"high\", \"high\", \"high\"]" "{\"max_depth\": 2}"; ml model pmml "tree" "{\"features\": [\"length\", \"width\"], \"target\": \"species\"}"
mentdb
<?xml version="1.0" encoding="UTF-8"?> <PMML xmlns="http://www.dmg.org/PMML-4_4" version="4.4"> <Header description="MentDB model tree (decision_tree_classifier)"><Application name="MentDB"/></Header> <DataDictionary numberOfFields="3"> <DataField name="length" optype="continuous" dataType="double"/> <DataField name="width" optype="continuous" dataType="double"/> <DataField name="species" optype="categorical" dataType="string"> <Value value="high"/> <Value value="low"/> <Value value="mid"/> </DataField> </DataDictionary> <TreeModel functionName="classification" splitCharacteristic="binarySplit" algorithmName="decision_tree_classifier"> <MiningSchema> <MiningField name="species" usageType="target"/> <MiningField name="length"/> <MiningField name="width"/> </MiningSchema> <Output> <OutputField name="predicted_species" optype="categorical" dataType="string" feature="predictedValue"/> <OutputField name="probability_high" optype="continuous" dataType="double" feature="probability" value="high"/> <OutputField name="probability_low" optype="continuous" dataType="double" feature="probability" value="low"/> <OutputField name="probability_mid" optype="continuous" dataType="double" feature="probability" value="mid"/> </Output> <Node score="high" recordCount="12"> <True/> <ScoreDistribution value="high" recordCount="4.0" probability="0.3333333333333333"/> <ScoreDistribution value="low" recordCount="4.0" probability="0.3333333333333333"/> <ScoreDistribution value="mid" recordCount="4.0" probability="0.3333333333333333"/> <Node score="low" recordCount="4"> <SimplePredicate field="length" operator="lessOrEqual" value="3.25"/> <ScoreDistribution value="high" recordCount="0.0" probability="0.0"/> <ScoreDistribution value="low" recordCount="4.0" probability="1.0"/> <ScoreDistribution value="mid" recordCount="0.0" probability="0.0"/> </Node> <Node score="high" recordCount="8"> <SimplePredicate field="length" operator="greaterThan" value="3.25"/> <ScoreDistribution value="high" recordCount="4.0" probability="0.5"/> <ScoreDistribution value="low" recordCount="0.0" probability="0.0"/> <ScoreDistribution value="mid" recordCount="4.0" probability="0.5"/> <Node score="high" recordCount="4"> <SimplePredicate field="width" operator="lessOrEqual" value="4.5"/> <ScoreDistribution value="high" recordCount="4.0" probability="1.0"/> <ScoreDistribution value="low" recordCount="0.0" probability="0.0"/> <ScoreDistribution value="mid" recordCount="0.0" probability="0.0"/> </Node> <Node score="mid" recordCount="4"> <SimplePredicate field="width" operator="greaterThan" value="4.5"/> <ScoreDistribution value="high" recordCount="0.0" probability="0.0"/> <ScoreDistribution value="low" recordCount="0.0" probability="0.0"/> <ScoreDistribution value="mid" recordCount="4.0" probability="1.0"/> </Node> </Node> </Node> </TreeModel> </PMML>
Used in use cases (1 recipe)

    Data scientist › Choose a model automatically and export it in PMML
Often used with

    ml automl  ·  ml model delete  ·  ml model predict  ·  string length

ml model info <id>


Description

    Get the information of a model (the same result as ml train / ml fit, without the training score)

Parameters

    id:   The model id - String - required
admin
ml fit "km" "kmeans" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "{\"k\": 2}"; ml model info "km"
mentdb
{"id": "km", "algo": "kmeans", "kind": "clustering", "n_samples": 12, "n_features": 2, "params": {"k":2}, "centers": [[3.4, 5], [8.875, 1.125]], "sizes": [8, 4], "labels": [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1], "inertia": 116.875, "iterations": 3}
Used in use cases (1 recipe)

    Machine learning engineer › Save a trained model and score with it later
Often used with

    file delete  ·  ml model delete  ·  ml model load  ·  ml model predict_proba  ·  ml model save  ·  ml train

ml model show


Description

    Get the models in memory

admin
ml fit "km" "kmeans" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "{\"k\": 2}"; ml model show
mentdb
[{"id": "km", "algo": "kmeans", "kind": "clustering", "n_samples": 12, "n_features": 2, "created": 1793777181007}]

ml model exist <id>


Description

    Check if a model exists in memory (1 or 0)

Parameters

    id:   The model id - String - required
admin
ml model exist "unknown_model"
mentdb
0

ml model delete <id>


Description

    Delete a model from the memory

Parameters

    id:   The model id - String - required
admin
ml fit "km" "kmeans" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "{\"k\": 2}"; ml model delete "km"
mentdb
1
Used in use cases (29 recipes)

    Chemist › Unmix absorption spectra
    Process & reactor engineer › Yield regimes with a model tree
    Biologist & microbiologist › Monotonic dose-response curve
    Epidemiologist › Odds ratios of a case-control study
    Geneticist & bioinformatician › Sparse gene signature with an L1 logistic regression
    Climate & environment scientist › Temperature between sparse stations
    and 23 more in the Use cases
Often used with

    ml train  ·  ml model predict  ·  ml fit  ·  ml model transform  ·  ml cross_validate  ·  ml model predict_interval  ·  ml model predict_proba  ·  ml model rules

ml model delete_all


Description

    Delete all the models from the memory (returns the number of deleted models)

admin
ml fit "km" "kmeans" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "{\"k\": 2}"; ml model delete_all
mentdb
1

ml model save <id> <path>


Description

    Save a model in a file (compressed Java serialization). A restricted session can only write in tmp/[user]/.

Parameters

    id:   The model id - String - required
    path:   The file path - String - required
admin
ml train "nb" "naive_bayes" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]"; ml model save "nb" "tmp/nb.model"
mentdb
1
Used in use cases (1 recipe)

    Machine learning engineer › Save a trained model and score with it later
Often used with

    file delete  ·  ml model delete  ·  ml model info  ·  ml model load  ·  ml model predict_proba  ·  ml train

ml model load <id> <path>


Description

    Load a model from a file and keep it in memory with a new id

Parameters

    id:   The new model id - String - required
    path:   The file path - String - required
admin
ml train "nb" "naive_bayes" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]"; ml model save "nb" "tmp/nb.model"; ml model load "nb2" "tmp/nb.model"
mentdb
{"id": "nb2", "algo": "naive_bayes", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {}, "classes": [0, 1, 2], "priors": [0.3333333333333333, 0.3333333333333333, 0.3333333333333333], "means": [[1.125, 1.975], [5.675, 8.025], [8.875, 1.125]], "variances": [[0.06687501022854166, 0.02187501022854169], [0.21687501022854172, 0.12687501022854167], [0.06687501022854152, 0.06687501022854166]]}
Used in use cases (1 recipe)

    Machine learning engineer › Save a trained model and score with it later
Often used with

    file delete  ·  ml model delete  ·  ml model info  ·  ml model predict_proba  ·  ml model save  ·  ml train

ml cross_validate <algo> <json_X> <json_y> <k> <json_params> <seed>


Description

    k-fold cross validation of an algorithm: accuracy (classifier) or R2 (regressor) on each fold, mean and standard deviation

Parameters

    algo:   The algorithm - String - required
    json_X:   The rows - String - required
    json_y:   The labels or values - String - required
    k:   The number of folds - Number - required
    json_params:   The parameters - String - required
    seed:   The seed of the shuffle - Number - required
admin
ml cross_validate "naive_bayes" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]" 4 "{}" 1
mentdb
{"metric": "accuracy", "scores": [1, 1, 1, 1], "mean": 1, "std": 0}
Regression
admin
ml cross_validate "linear" "[[1, 1], [2, 1], [3, 2], [4, 3], [5, 5], [6, 5], [7, 8], [8, 8]]" "[6.1, 8.0, 11.2, 14.1, 18.3, 19.9, 24.8, 26.1]" 4 "{}" 1
mentdb
{"metric": "r2", "scores": [0.9988641915349603, 0.9969113423517159, 0.9960183901670927, 0.7491296813649689], "mean": 0.9352309013546845, "std": 0.12407317101685685}
Used in use cases (8 recipes)

    Process & reactor engineer › Yield regimes with a model tree
    Geneticist & bioinformatician › Sparse gene signature with an L1 logistic regression
    Data scientist › Select the useful variables of a regression
    Machine learning engineer › Benchmark five classifiers with a cross validation
    Deep learning engineer › Predictive maintenance with a neural network
    Data scientist › Features that only work together
    and 2 more in the Use cases
Often used with

    ml model delete  ·  ml train  ·  ml prep columns  ·  ml prep select_k_best  ·  math max  ·  ml model predict  ·  ml model predict_proba  ·  ml model rules

ml compare <json_X> <json_y> <json_estimators>


Description

    Compare algorithms like the Weka Experimenter: the same 10 x 10-fold cross validation for each one, then a corrected resampled paired t-test (Nadeau and Bengio) of each algorithm against the first one (better, worse or same at the level 0.05)

Parameters

    json_X:   The rows - String - required
    json_y:   The labels or values - String - required
    json_estimators:   The algorithms: names or {"algo": ..., "params": {...}}, the first one is the baseline - String - required
admin
ml compare "[[1, 5], [2, 6], [3, 5], [4, 7], [5, 6], [6, 8], [7, 7], [8, 8], [2, 8], [6, 5], [3, 7], [7, 5]]" "[0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1]" "[\"naive_bayes\", \"logistic\", {\"algo\": \"knn_classifier\", \"params\": {\"k\": 3}}]"
mentdb
{"metric": "accuracy", "k": 10, "repeats": 10, "baseline": "naive_bayes", "level": 0.05, "results": [{"algo": "naive_bayes", "params": {}, "mean": 0.485, "std": 0.4738356276391656}, {"algo": "logistic", "params": {}, "mean": 0.42, "std": 0.46449712136629623, "difference": -0.065, "t": -0.6439937299584969, "p_value": 0.5210687016502709, "vs_baseline": "same"}, {"algo": "knn_classifier", "params": {"k":3}, "mean": 0.66, "std": 0.4431293675255983, "difference": 0.175, "t": 1.3283444772484392, "p_value": 0.18711840363489518, "vs_baseline": "same"}]}

ml compare <json_X> <json_y> <json_estimators> <json_params>


Description

    Compare algorithms with parameters: k (folds, 10), repeats (10), level (0.05), seed

Parameters

    json_X:   The rows - String - required
    json_y:   The labels or values - String - required
    json_estimators:   The algorithms - String - required
    json_params:   The parameters - String - required
admin
ml compare "[[1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [14], [15], [16], [17], [18], [19], [20], [21], [22], [23], [24]]" "[1.5, 3.5, 6.3, 7.1, 9.9, 11.1, 14.4, 16.1, 18.5, 19.8, 22.2, 23.9, 22.7, 22.1, 20.5, 19.9, 19.3, 18.0, 16.8, 16.9, 15.0, 13.8, 13.1, 11.8]" "[\"linear\", \"m5\", {\"algo\": \"knn_regressor\", \"params\": {\"k\": 3}}]" "{\"k\": 4, \"repeats\": 5}"
mentdb
{"metric": "r2", "k": 4, "repeats": 5, "baseline": "linear", "level": 0.05, "results": [{"algo": "linear", "params": {}, "mean": -0.1715513821833993, "std": 0.7654129813551466}, {"algo": "m5", "params": {}, "mean": 0.9551735849400375, "std": 0.09852605532975835, "difference": 1.1267249671234367, "t": 2.408359166194989, "p_value": 0.026342780654552644, "vs_baseline": "better"}, {"algo": "knn_regressor", "params": {"k":3}, "mean": 0.8925861285952831, "std": 0.08130492980481316, "difference": 1.0641375107786826, "t": 2.4166915651125827, "p_value": 0.025889390550725366, "vs_baseline": "better"}]}
Used in use cases (2 recipes)

    Geneticist & bioinformatician › Gene dependencies with a Bayesian network
    Statistician & biostatistician › Is the best model really better?
Often used with

    ml model delete  ·  ml train

ml automl <id> <json_X> <json_y>


Description

    AutoML: cross validation of about 15 algorithms with small grids of parameters (classification or regression, detected from y), a leaderboard, then the best one trained on all the rows and saved under the id

Parameters

    id:   The id of the best model - String - required
    json_X:   The rows - String - required
    json_y:   The labels or values - String - required
admin
ml automl "best" "[[1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [14], [15], [16], [17], [18], [19], [20], [21], [22], [23], [24]]" "[1.5, 3.5, 6.3, 7.1, 9.9, 11.1, 14.4, 16.1, 18.5, 19.8, 22.2, 23.9, 22.7, 22.1, 20.5, 19.9, 19.3, 18.0, 16.8, 16.9, 15.0, 13.8, 13.1, 11.8]"; ml model predict "best" "[[25], [26]]"
mentdb
[10.391571616788148, 9.275131028420626]
Complete: a table with missing values and a text column -> the best model -> predicted price
admin
#House prices (k EUR): surface, rooms (some missing), city; -> "[rows]" "[{\"surface\": 45, \"rooms\": 2, \"city\": \"Saint-Denis\", \"price\": 162}, {\"surface\": 80, \"rooms\": 4, \"city\": \"Saint-Paul\", \"price\": 315}, {\"surface\": 62, \"rooms\": 3, \"city\": \"Saint-Denis\", \"price\": 215}, {\"surface\": 110, \"rooms\": 5, \"city\": \"Saint-Paul\", \"price\": 430}, {\"surface\": 38, \"rooms\": null, \"city\": \"Le Tampon\", \"price\": 105}, {\"surface\": 95, \"rooms\": 4, \"city\": \"Le Tampon\", \"price\": 252}, {\"surface\": 70, \"rooms\": 3, \"city\": \"Saint-Paul\", \"price\": 280}, {\"surface\": 55, \"rooms\": 2, \"city\": \"Le Tampon\", \"price\": 150}, {\"surface\": 120, \"rooms\": 6, \"city\": \"Saint-Denis\", \"price\": 410}, {\"surface\": 66, \"rooms\": null, \"city\": \"Saint-Denis\", \"price\": 228}, {\"surface\": 88, \"rooms\": 4, \"city\": \"Saint-Paul\", \"price\": 342}, {\"surface\": 75, \"rooms\": 3, \"city\": \"Le Tampon\", \"price\": 196}, {\"surface\": 50, \"rooms\": 2, \"city\": \"Saint-Paul\", \"price\": 205}, {\"surface\": 100, \"rooms\": 5, \"city\": \"Le Tampon\", \"price\": 268}, {\"surface\": 58, \"rooms\": 3, \"city\": \"Saint-Denis\", \"price\": 199}]"; -> "[fields]" "[\"surface\", \"rooms\", \"city\"]"; -> "[enc]" "{\"one_hot\": {\"city\": [\"Le Tampon\", \"Saint-Denis\", \"Saint-Paul\"]}}"; #Matrix, then the missing rooms replaced by the median; -> "[X]" (ml prep impute (ml prep matrix [rows] [fields] [enc]) "median"); -> "[y]" (ml prep vector [rows] "price"); json load "tuto_a" (ml automl "tuto_price" [X] [y] "{\"k\": 3, \"include\": [\"linear\", \"ridge\", \"random_forest_regressor\", \"gradient_boosting_regressor\"]}"); -> "[best]" (concat (json select "tuto_a" "/leaderboard/[0]/algo") " (cross validated R2 " (math round (json select "tuto_a" "/leaderboard/[0]/score") 3) ")"); json unload "tuto_a"; #Price of a 72 m2 house with 3 rooms in Saint-Paul; -> "[p]" (ml model predict "tuto_price" (ml prep matrix "[{\"surface\": 72, \"rooms\": 3, \"city\": \"Saint-Paul\"}]" [fields] [enc])); ml model delete "tuto_price"; concat "best model: " [best] ", predicted price: " [p]
mentdb
best model: ridge (cross validated R2 0.911), predicted price: [280.49471794487886]

ml automl <id> <json_X> <json_y> <json_params>


Description

    AutoML with parameters: task (auto, classification or regression), k (folds, 5), seed, time_budget (seconds, 120), include and exclude (lists of algorithm names)

Parameters

    id:   The id of the best model - String - required
    json_X:   The rows - String - required
    json_y:   The labels or values - String - required
    json_params:   The parameters - String - required
admin
ml automl "best" "[[1, 2], [1.5, 1.8], [1.2, 2.2], [0.8, 1.9], [5, 8], [6, 8.5], [5.5, 7.5], [6.2, 8.1], [9, 1], [8.5, 1.5], [9.2, 0.8], [8.8, 1.2]]" "[0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]" "{\"k\": 3, \"include\": [\"logistic\", \"naive_bayes\", \"knn_classifier\", \"decision_tree_classifier\"]}"
mentdb
{"task": "classification", "metric": "accuracy", "k": 3, "leaderboard": [{"rank": 1, "algo": "logistic", "params": {}, "score": 1, "std": 0, "seconds": 0.001}, {"rank": 2, "algo": "logistic", "params": {"alpha": 1}, "score": 1, "std": 0, "seconds": 0}, {"rank": 3, "algo": "naive_bayes", "params": {}, "score": 1, "std": 0, "seconds": 0.001}, {"rank": 4, "algo": "decision_tree_classifier", "params": {"max_depth": 4}, "score": 1, "std": 0, "seconds": 0}, {"rank": 5, "algo": "knn_classifier", "params": {"k": 5, "scale": true}, "score": 0.5833333333333333, "std": 0.14433756729740646, "seconds": 0}, {"rank": 6, "algo": "decision_tree_classifier", "params": {"max_depth": 8, "min_samples_leaf": 3}, "score": 0.5, "std": 0, "seconds": 0}, {"rank": 7, "algo": "knn_classifier", "params": {"k": 15, "scale": true}, "score": 0.16666666666666666, "std": 0.14433756729740646, "seconds": 0}], "skipped": [], "seconds": 0.003, "model": {"id": "best", "algo": "logistic", "kind": "classifier", "n_samples": 12, "n_features": 2, "params": {}, "classes": [0, 1, 2], "train_accuracy": 1, "strategy": "one-vs-rest", "coef": [[45.15277690362241, -7.684780588426674, -4.092351151576107], [-47.08001974256776, 0.8937170889558808, 9.049806456315101], [-26.843751983452414, 7.124528336801502, -5.351343285475679]]}}
Used in use cases (1 recipe)

    Data scientist › Choose a model automatically and export it in PMML
Often used with

    ml model delete  ·  ml model pmml  ·  ml model predict  ·  string length