predict(features) {
        // Only predict if previously trained
        // on the same size feature array(s).
        if (features.length !== this.weights.length) {
            return null;
        }

        // Calculate the sum of features times weights,
        // with the bias added (implicitly times one).
        let score = 0;
        for (let i = 0; i < this.weights.length; i++) {
            score += this.weights[i] * features[i];
        }
        score += this.bias;

        // Classify as 1 if the score is over 0, otherwise 0.
        if (score > 0) {
            return 1;
        } else {
            return 0;
        }
    }
**Predict**: Use an array of features with the weight array and bias
to predict whether an example is labeled 0 or 1.

@param {Array<number>} features an array of features as numbers
@returns {number} 1 if the score is over 0, otherwise 0