mirror of
https://github.com/optim-enterprises-bv/nDPId.git
synced 2025-10-29 09:22:23 +00:00
py-machine-learning: Print CSV line numbers for invalid lines (SKLearn Random Forest Classificator).
* c-analysed: fix wrong length check Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
@@ -148,7 +148,7 @@ static void csv_buf_add(csv_buf_t buf, size_t * const csv_buf_used, char const *
|
||||
{
|
||||
size_t len;
|
||||
|
||||
if (siz_len > 1 && str != NULL)
|
||||
if (siz_len > 0 && str != NULL)
|
||||
{
|
||||
len = MIN(BUFFER_REMAINING(*csv_buf_used), siz_len);
|
||||
if (len == 0)
|
||||
|
||||
@@ -280,7 +280,7 @@ if __name__ == '__main__':
|
||||
X += getRelevantFeaturesCSV(line)
|
||||
y += [isProtoClass(args.proto_class, line['proto'])]
|
||||
except RuntimeError as err:
|
||||
print('Error: `{}\'\non line: {}'.format(err, line))
|
||||
print('Error: `{}\'\non line {}: {}'.format(err, reader.line_num - 1, line))
|
||||
|
||||
sys.stderr.write('CSV data set contains {} entries.\n'.format(len(X)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user