1
$\begingroup$

I tried to add a binary import method to class FileFormat(metaclass=FileFormatMeta) in io.py, but gave up trying to adapt a copy of the CSV method since so much is specific to CSV issues and the comments are sparse...

Basically, given an Ncols x Mrows raw file of known type and meta data, one should be able to supply the shape, sample rate etc as defaults, and then one "only" needs to satisfy the parameters for Table.from_numpy(). It is the creation of Orange-specific objects that have me stuck, and mainly the domain object:

def data_table_from_bin(cls, data, headers=None):
    ...
    domain = Domain(attrs, clses, metas)

    table = Table.from_numpy(domain, X, Y, M, W)
    return table

Has anyone else tried this, or have suggestions?

$\endgroup$

1 Answer 1

1
$\begingroup$

What is the problem exactly?

When you create Domain you have to specify each Feature eg:

from Orange.data import Domain, Table, ContinuousVariable, DiscreteVariable

d = Domain([ContinuousVariable.make('Attribute 1'), DiscreteVariable.make('Attribute 2')])


Here is a link to doc, regarding Domain (yes, it's not the best)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.