Is there a way to completely flush memmap from memory in Python and somehow just store a pointer? I notice memmap_object.flush()
and del memmap_object
have different effects.
Complete Code:
temp_train_data=X_train[1000:]
temp_labels=y[1000:]
out = np.empty((200001, 3504), np.int64)
for index,row in enumerate(temp_train_data):
actual_index=index+1000
data=X_train[actual_index-1000:actual_index+1].ravel()
__,cd_i=pywt.dwt(data,'haar')
out[index] = cd_i
out.flush()
pca_obj=IncrementalPCA()
clf = pca_obj.fit(out)
Edit 1:(@stark suggestion) Main problems relating to the question:
clf = pca_obj.fit(out)
trashes my RAM.- I want more RAM freed up so I can increase the batch-size of iterative PCA.