How to use the ml-cart.DecisionTreeClassifier function in ml-cart

To help you get started, we’ve selected a few ml-cart examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AliaElKattan / survivalofthebestfit / game-source / public / game / controllers / machine-learning / modelTraining.js View on Github external
const buildFakeDataModel = (featPref) => {
    const [featureArr, labelArr] = preprocResumes(cvCollection.cvData, featPref);
    const [trainX, trainY, validX, validY] =_splitTrainTest(featureArr, labelArr, 0.2);

    const options = {
        gainFunction: 'gini',
        maxDepth: 15,
        minNumSamples: 10,
    };

    const classifier = new DTClassifier(options);
    classifier.train(trainX, trainY);
    //test
    const prediction = classifier.predict(validX);
    reportMetrics(prediction, validY);

    return classifier;
};
github AliaElKattan / survivalofthebestfit / game-source / public / game / controllers / machine-learning / modelTraining.js View on Github external
const buildUserModel = (acceptedIndices, rejectedIndices) => {
    const [featureArr, labelArr] = _userModelCvPreProc(acceptedIndices, rejectedIndices);

    const options = {
        gainFunction: 'gini',
        maxDepth: 5,
        minNumSamples: 3,
    };

    const classifier = new DTClassifier(options);
    classifier.train(featureArr, labelArr);
    return classifier;
};

ml-cart

CART decision tree algorithm

MIT
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis

Popular ml-cart functions