aboutsummaryrefslogtreecommitdiff
path: root/examples/py-machine-learning/sklearn-random-forest.py
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2023-01-30 22:33:53 +0100
committerToni Uhlig <matzeton@googlemail.com>2023-01-30 22:36:17 +0100
commit4236aafa0dc68caeea85c785c83524ecb2b87783 (patch)
treebfe992895ace7b0248939df8ee90c1c926311e4c /examples/py-machine-learning/sklearn-random-forest.py
parent23816f14036a46d0a43d6fa7f004d6a00542b6c3 (diff)
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>
Diffstat (limited to 'examples/py-machine-learning/sklearn-random-forest.py')
-rwxr-xr-xexamples/py-machine-learning/sklearn-random-forest.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/py-machine-learning/sklearn-random-forest.py b/examples/py-machine-learning/sklearn-random-forest.py
index 090206b4e..9103bb427 100755
--- a/examples/py-machine-learning/sklearn-random-forest.py
+++ b/examples/py-machine-learning/sklearn-random-forest.py
@@ -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)))