Manual Selection

This endpoint allows the user to select algorithms to train the data, search grid to tune parameters, save the model and weights, retrieve the model and weights for evaluation using the test dataset.

  1. The following algorithms are included: GaussianNB, BernoulliNB, Decision tree, Random forest, Extra tree, Logistic regression, SVM, Adaboost, k nearest neighbors, LDA and QDA.

  2. The multi-label classification is transformed using LabelPowerset, and GridSearchCV (default cv = 3) is used for tuning parameters.

  3. Model can be saved for evaluation and predition.

  4. Output:
    a) training: best-parameters and best-score,

b) evaluation: score using different metrics (accuracy, f1_macro, precision_macro, recall_macro, f1_samples), multilabel confusion matrix

Request Body

NameDatatypeDescriptionMandatorySample ValueList of possible valuesNotes
clientIdStringIt is meant for identification purpose as information are stored under unique id valueYes
classifierStringClassifier is an algorithm that maps the input data to a specific target. With the given data, the selected algorithm will be trained to predict the targetYes"decisionTree"'GaussianNaiveBayes','BernoulliNaiveBayes','decisionTree','randomForest','extraTrees','logisticRegression','supportVectorMachine','Adaboost','kNearestNeighbors','LDA','QDA'
metricStringMetric is used to measure and evaluate the performance of the machine learning algorithm. Different metric will give different performance result for trained modelYes"precision"'recall''precision''accuracy''f1Macro', 'f1Sample'
cvIntegerCross validation is a technique for evaluating Machine Learning model by training the model on k-1 different subsets of data and evaluating the model on the complementary subset that was not used for training. Cross validation is used to detect overfittingYes3>=2 and <=50
evaluationBooleanIf True, the output will contain validation results based on the selected metric as well as training results. If False, the output will only contain training results, such as model hyperparameter and training scoreYestruetrue or false
saveModelBooleanSave model in databaseYestruetrue or false

Response Body

NameDatatypeDescriptionSample ValuesNo. of decimalsNotes
classificationReportDictionaryA report containing performance measures of the algorithm. The dictionary contains 2 main keys: avgs and labels. avgs is an array of dictionaries that has keys of avgName and metrics. Valid avgName are: macro avg, micro avg, samples avg, weighted avg. Valid metrics are: precision, recall, f1-score, support. labels is an array of dictionaries that has keys of goalType value and metrics of precision, recall, f1-score, support"classificationReport": { "avgs": [ { "avgName": "macro avg", "metrics": [ { "name": "precision", "value": 0.49439 }, { "name": "recall", "value": 0.46809 }, { "name": "f1-score", "value": 0.4672 }, { "name": "support", "value": 756 } ] }, { "avgName": "micro avg", "metrics": [ { "name": "precision", "value": 0.69369 }, { "name": "recall", "value": 0.71296 }, { "name": "f1-score", "value": 0.7032 }, { "name": "support", "value": 756 } ] }, { "avgName": "samples avg", "metrics": [ { "name": "precision", "value": 0.70333 }, { "name": "recall", "value": 0.73611 }, { "name": "f1-score", "value": 0.70244 }, { "name": "support", "value": 756 } ] }, { "avgName": "weighted avg", "metrics": [ { "name": "precision", "value": 0.6764 }, { "name": "recall", "value": 0.71296 }, { "name": "f1-score", "value": 0.67947 }, { "name": "support", "value": 756 } ] } ], "labels": [ { "labelName": "retirement", "metrics": [ { "name": "precision", "value": 0.83333 }, { "name": "recall", "value": 0.89912 }, { "name": "f1-score", "value": 0.86498 }, { "name": "support", "value": 228 } ] }, { "labelName": "growWealth", "metrics": [ { "name": "precision", "value": 0.68478 }, { "name": "recall", "value": 0.51639 }, { "name": "f1-score", "value": 0.58879 }, { "name": "support", "value": 122 } ] }, { "labelName": "wedding", "metrics": [ { "name": "precision", "value": 0.76316 }, { "name": "recall", "value": 0.39726 }, { "name": "f1-score", "value": 0.52252 }, { "name": "support", "value": 73 } ] }, { "labelName": "education", "metrics": [ { "name": "precision", "value": 0.68914 }, { "name": "recall", "value": 0.97872 }, { "name": "f1-score", "value": 0.80879 }, { "name": "support", "value": 188 } ] }, ] } ] }
f1-scoreNumberF1 Score is the weighted average of Precision and Recall. Therefore, this score takes both false positives and false negatives into account. F1 is usually more useful than accuracy, especially if you have an uneven class distribution. Accuracy works best if false positives and false negatives have similar cost. If the cost of false positives and false negatives are very different, it’s better to look at both Precision and Recall. F1 Score = 2(Recall Precision) / (Recall + Precision)5
precisionNumberPrecision is the ratio of correctly predicted positive observations to the total predicted positive observations. High precision relates to the low false positive rate. Precision = TP/TP+FP5
recallNumberRecall is the ratio of correctly predicted positive observations to all the positive observations in actual class. Recall = TP/TP + FN5
supportIntegerSupport is the number of occurrences of each class in y_true0
multilabelConfusionMatrixArray of dictionaryIt computes a confusion matrix for each class or sample (for this scenario, it is goalType) in the dataset. multilabelConfusionMatrix has keys of goalType , falseNegative, falsePositive, trueNegative and truePositive"multilabelConfusionMatrix": [ { "falseNegative": 41, "falsePositive": 31, "name": "retirement", "trueNegative": 205, "truePositive": 23 }, { "falseNegative": 29, "falsePositive": 149, "name": "growWealth", "trueNegative": 63, "truePositive": 59 },... }0
trainingResultDictionaryContains keys of bestParameters and trainingScore. bestParameters describes the hyperparameters of the chosen machine learning. training_score describes the training score based on training dataset"trainingResult": { "bestParameters": [ { "name": "n_components", "value": null }, { "name": "priors", "value": null }, { "name": "shrinkage", "value": null }, { "name": "solver", "value": "svd" }, { "name": "store_covariance", "value": true }, { "name": "tol", "value": 0.0001 } ], "trainingScore": 0.55473 }numberhas 5 dp
evaluationScoreNumberIt describes the validation score based on validation dataset0.541525
Language
Authorization
Bearer
Click Try It! to start a request and see the response here!