train(item, category) {
        // If the data object doesn't have any values
        // for this category, create a new object for it.
        if (!this.data[category]) {
            this.data[category] = {};
        }

        // Iterate through each key in the item.
        for (const k in item) {
            const v = item[k];
            // Initialize the nested object `data[category][k][item[k]]`
            // with an object of keys that equal 0.
            if (this.data[category][k] === undefined) {
                this.data[category][k] = {};
            }
            if (this.data[category][k][v] === undefined) {
                this.data[category][k][v] = 0;
            }

            // And increment the key for this key/value combination.
            this.data[category][k][v]++;
        }

        // Increment the number of items classified
        this.totalCount++;
    }
Train the classifier with a new item, which has a single
dimension of Javascript literal keys and values.

@param {Object} item an object with singly-deep properties
@param {string} category the category this item belongs to
@return {undefined} adds the item to the classifier