Skip to content

Instantly share code, notes, and snippets.

@statwonk
Created August 30, 2020 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save statwonk/e4b55cb3a80d6bd19d93a33286923dda to your computer and use it in GitHub Desktop.
Save statwonk/e4b55cb3a80d6bd19d93a33286923dda to your computer and use it in GitHub Desktop.
scikit-learn partial_fit out-of-core learning.
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