'Validate X whenever one tries to predict, apply, predict_proba'

def _validate_X_predict(self, X, check_input):

    if check_input:
        X = check_array(X, dtype=DTYPE, accept_sparse='csr')
        if (issparse(X) and ((X.indices.dtype != np.intc) or (X.indptr.dtype != np.intc))):
            raise ValueError('No    support    for    np.int64    index    based    sparse    matrices')
    n_features = X.shape[1]
    if (self.n_features_ != n_features):
        raise ValueError(('Number    of    features    of    the    model    must    match    the    input.    Model    n_features    is    %s    and    input    n_features    is    %s    ' % (self.n_features_, n_features)))
    return X
