
sample_weight array-like of shape (n_samples,), default=None y array-like of shape (n_samples,) or (n_samples, n_outputs) Parameters : X array-like of shape (n_samples, n_features) Which is a harsh metric since you require for each sample thatĮach label set be correctly predicted. In multi-label classification, this is the subset accuracy Order, as they appear in the attribute classes_. Returns the probability of the samples for each class in Return probability estimates for the test vector X. Returns the log-probability of the samples for each class in Returns : C array-like of shape (n_samples, n_classes) Return log-probability estimates for the test vector X. The columns correspond to the classes in sorted Returns the joint log-probability of the samples for each class in Returns : C ndarray of shape (n_samples, n_classes) Where log P(y) is the class prior probability and log P(x|y) is predict_joint_log_proba ( X ) ¶įor each row x of X and class y, the joint log probability is given by Returns : C ndarray of shape (n_samples,) Perform classification on an array of test vectors X. Must be provided at the first call to partial_fit, can be omitted List of all the classes that can possibly appear in the y vector. classes array-like of shape (n_classes,), default=None Training vectors, where n_samples is the number of samples and Hence it is better to call partial_fit on chunks of data that areĪs large as possible (as long as fitting in the memory budget) to This method has some performance and numerical stability overhead, This is especially useful when the whole dataset is too big to fit in On different chunks of a dataset so as to implement out-of-core This method is expected to be called several times consecutively partial_fit ( X, y, classes = None, sample_weight = None ) ¶ If True, will return the parameters for this estimator andĬontained subobjects that are estimators. Please check User Guide on how the routing New in version 0.17: Gaussian Naive Bayes supports fitting with sample_weight. Weights applied to individual samples (1. Training vectors, where n_samples is the number of samplesĪnd n_features is the number of features. Request metadata passed to the score method.įit ( X, y, sample_weight = None ) ¶įit Gaussian Naive Bayes according to X, y. Request metadata passed to the partial_fit method. Request metadata passed to the fit method. Return the mean accuracy on the given test data and labels. Return joint log probability estimates for the test vector X. predict (])) įit Gaussian Naive Bayes according to X, y. unique ( Y )) GaussianNB() > print ( clf_pf.

predict (])) > clf_pf = GaussianNB () > clf_pf. fit ( X, Y ) GaussianNB() > print ( clf. array () > from sklearn.naive_bayes import GaussianNB > clf = GaussianNB () > clf.
