aksnzhy / xlearn

High performance, easy-to-use, and scalable machine learning (ML) package, including linear model (LR), factorization machines (FM), and field-aware factorization machines (FFM) for Python and CLI interface.
https://xlearn-doc.readthedocs.io/en/latest/index.html
Apache License 2.0
3.09k stars 519 forks source link

Error reading csv file #229

Open EvanZ opened 5 years ago

EvanZ commented 5 years ago

I'm trying to read in a csv file and getting the following error:

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

I simply modified the demo code for my data set:

import xlearn as xl

train_path = '/Volumes/GoogleDrive/My Drive/issues/PDAE-1663/train/{}'.format('part-00000-c8bf4ba4-706a-4bc5-af13-aacc7e0835de-c000.csv')
test_path = '/Volumes/GoogleDrive/My Drive/issues/PDAE-1663/test/{}'.format('part-00000-3750abd4-62cf-4413-a71d-e44361040f2f-c000.csv')

fm_model = xl.create_fm()
fm_model.setTrain(train_path)
fm_model.setValidate(test_path)

param = {
    'task': 'binary',
    'lr': 0.1,
    'lambda': 0.00002,
    'metric': 'auc',
    'fold': 10,
    'k': 4
}

fm_model.cv(param)
fm_model.show()

fm_model.fit(param, './model.out')

fm_model.setTest(test_path)
fm_model.setSigmoid()

fm_model.predict("./model.out", "./output.txt")

Is there a parameter I need to specify to make CSV work?

etveritas commented 5 years ago

@EvanZ Program access not real address on your machine. Does your program generate .bin file correctly(like a bin file with 0 kb or no bin file)?And you run it on 64-bit or 32-bit system?

EvanZ commented 5 years ago

I do see a .bin file being generated inside the train path with 0 bytes. I am running on Mac OS X Mojave, so I guess that is 64 bit.

etveritas commented 5 years ago

@EvanZ Maybe there are some characters can not be transformed to int or float number in your csv file. You can check whether have not character of number(characters like 'abc' or something else ) in file.

EvanZ commented 5 years ago

Hmm...does it not allow a header row?

etveritas commented 5 years ago

@EvanZ Yes. You can find details in https://xlearn-doc.readthedocs.io/en/latest/python_api/index.html

aksnzhy commented 5 years ago

@etveritas Thanks for resolving this issue!