Refefer / fastxml

FastXML / PFastXML / PFastreXML - Implementation of Extreme Multi-label Classification

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can not run as sample, is something wrong with the source code?

BAIMEI1 opened this issue · comments

commented

from fastxml import Trainer, Inferencer
X = [Sparse or numpy arrays]
y = [[1, 3]] # Currently requires list[list[int]]
trainer = Trainer(n_trees=32, n_jobs=-1)
trainer.fit(X, y)
my input X is list of csr_matrix and input y is csr_matrix
but after my run error happen like this
file ''build/bdist.linux-x86_64/egg/fastxml/trainer.py'', line 389, in _build_roots
TypeError: iteration over a 0-d array
besides: Only when input X is list of csr_matrix the program is ok
def _build_roots(self, X, y, weights):
assert isinstance(X, list) and isinstance(X[0], sp.csr_matrix), "Requires list of csr_matrix"
if self.n_jobs > 1:
f = proc.fork_call(self.grow_root)
else:
f = proc.faux_fork_call(self.grow_root)

The error is complaining that you didn't pass in a a list of csr_matrix. My guess is you passed in a single csr_matrix for X, which we disallow due to memory blow up in COW. Note you also claim to pass in a csr_matrix for your y. That needs to be a list of lists for the same reason as X.

Can you provide your X,y preprocessing logic?

Closing for now.