Skip to content

Incorrect reading of headers results in wrong output #2

@tkortekaas

Description

@tkortekaas

Given input:

final RunParameters runParameters = new RunParameters("path/to/dataset.csv", SimEnum.PEARSON_CORRELATION, 1, 1);
runParameters.setTopK(1);
runParameters.setQueryType(QueryTypeEnum.TOPK);

final CorrelationDetective correlationDetective = new CorrelationDetective(runParameters);
queries.ResultSet res = correlationDetective.run();

System.out.println(res.toJson());

and dataset.csv

,A,B
x,1,5
y,2,6
z,3,7
w,4,8

The output is:

[{"LHS":[1],"RHS":[0],"similarity":1.0,"lHeaders":["A"],"rHeaders":[""],"timestamp":5069158821500}]

Whereas one would expect lHeaders = ["B"] and rHeaders = ["A"]

This is caused by the header including an empty string which it finds here -> , A , B

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions