Closed xiaohan2012 closed 7 years ago
Hi there!
The problem you're running into is that we need to have each example as a separate csr_matrix, with data type float32. The reason we do this is due to how we split the training set as FastXML trains each level of the tree: after each split, we operate on a smaller subset of the data.
Why not do this automatically for the user? Big reason is because splitting CSR matrices is really expensive: we can easily double training time just by creating slices of the matrix. On some larger datasets, it requires nearly double the amount of memory and makes larger datasets harder to operate on.
Same reason applies for why we use float32 instead of float64: it doubles the memory requirement.
As for how to solve your immediate problem:
X_train_new = [X_train[i].astype('float32') for i in range(X_train.shape[0])]
Let me know if this helps :)
Hi,
It works! Thank you!
Han
On Thu, Aug 31, 2017 at 2:57 AM, Andrew Stanton notifications@github.com wrote:
Hi there!
The problem you're running into is that we need to have each example as a separate csr_matrix, with data type float32. The reason we do this is due to how we split the training set as FastXML trains each level of the tree: after each split, we operate on a smaller subset of the data.
Why not do this automatically for the user? Big reason is because splitting CSR matrices is really expensive: we can easily double training time just by creating slices of the matrix. On some larger datasets, it requires nearly double the amount of memory and makes larger datasets harder to operate on.
Same reason applies for why we use float32 instead of float64: it doubles the memory requirement.
As for how to solve your immediate problem: X_train_new = [X_train[i].astype('float32') for i in range(x.shape[0])]
Let me know if this helps :)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Refefer/fastxml/issues/3#issuecomment-326151075, or mute the thread https://github.com/notifications/unsubscribe-auth/AAwLaUJY5hMEr66Z-cHtpV6JETwGUZnaks5sdfbhgaJpZM4PGglY .
-- Best
Han
I tried to train a model with input:
then I run:
it gives
why does it require list of
csr_matrix
? what does eachcsr_matrix
mean?