Is it possible to calculate the size of a model ( let's say a Random Forest classifier ) in scikit-learn?
For example:
from sklearn.ensemble import RandomForestClassifier clf = RandomForestClassifier(n_jobs=-1, n_estimators=10000, min_samples_leaf=50) clf.fit(self.X_train, self.y_train)
Can I determine the size of clf
?
sys.getsizeof()
would return the size of only that object in memory. If there are references to other objects, it won't take into account the size of those objects, so there's a real risk of underestimating size. See getsizeof documentation – Derte