Created
August 30, 2020 14:24
-
-
Save statwonk/e4b55cb3a80d6bd19d93a33286923dda to your computer and use it in GitHub Desktop.
scikit-learn partial_fit out-of-core learning.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sklearn | |
from sklearn import naive_bayes | |
import pandas as pd | |
import numpy as np | |
d = pd.read_csv("data.csv") | |
y = d.iloc[:, 1] | |
X = d.iloc[:,list(range(2, d.shape[1]))] | |
fit = naive_bayes.BernoulliNB() | |
fit.partial_fit(X, y, y_all) | |
fit.predict_log_proba(X[2:3]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment