Coder Social home page Coder Social logo

Comments (4)

jqnatividad avatar jqnatividad commented on May 27, 2024 1

I see your point @tmtmtmtm.

I'll add an option to explicitly turn off boolean inferencing. I'll also fine-tune the inferencing heuristic a bit more to further minimize false positives:

  • if there are only two records, turn it off
  • add more conditions to the inferencing logic

from qsv.

jqnatividad avatar jqnatividad commented on May 27, 2024

Yes. This is by design @tmtmtmtm

If the cardinality of a column is 2, and the two unique values are "truthy" - i.e. the first character is 1/0, t/f, y/n case-insensitive, then its inferred to be a boolean field.

In the real world - this heuristic should be good enough.

Did you find this behavior in a "real-world" dataset?

from qsv.

jqnatividad avatar jqnatividad commented on May 27, 2024

I improved it a bit to minimize True/False boolean inferencing false positives.

Lemme know how it works for you. Feel free to reopen.

from qsv.

tmtmtmtm avatar tmtmtmtm commented on May 27, 2024

Did you find this behavior in a "real-world" dataset?

Yes. I don't think I'd have stumbled across it otherwise :)

A large part of my use of qsv is in a pipeline of handling changes to data. In the case in question here, exactly two records had changed, but this time the names triggered this false inference, so when the CSV was turned into JSON and passed through to the next stage of the pipeline, everything went badly awry.

Am I reading the code correctly the new failure case would be if the names started with "Tr" and "Fa" rather than just "T" and "F"? If so, that's definitely better, but it's still not one I'm particularly comfortable in presuming would never happen.

Perhaps there could be an option to turn this behaviour off? It smells too much like all those scenarios where Excel silently mangles some dates on import etc.

from qsv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.