Git Product home page Git Product logo

Comments (8)

sscdotopen avatar sscdotopen commented on July 30, 2024

Hi Paul,

Happy to see that you are using Deequ! Actually, histograms on numeric columns should work, I wrote a test for this here #96 .

Can you provide us with more details about the error that you are seeing?

Best,
Sebastian

from deequ.

paulsukow avatar paulsukow commented on July 30, 2024

@sscdotopen I was using the column profiler and the histogram analysis was only working with String and boolean columns. On further investigation I found this code in ColumnProfiler.scala
`
/* Identifies all columns, which:
*

  • (1) have type string or boolean
  • (2) have less than lowCardinalityHistogramThreshold approximate distinct values
    */
    private[this] def findTargetColumnsForHistograms(
    schema: StructType,
    genericStatistics: GenericColumnStatistics,
    lowCardinalityHistogramThreshold: Long)
    : Seq[String] = {
val originalStringOrBooleanColumns = schema
  .flatMap { field =>
    if (field.dataType == StringType || field.dataType == BooleanType) {
      Some(field.name)
    } else {
      None
    }
  }
  .toSet

genericStatistics.approximateNumDistincts
  .filter { case (column, _) => originalStringOrBooleanColumns.contains(column) }
  .filter { case (column, _) =>
    genericStatistics.typeOf(column) == String || genericStatistics.typeOf(column) == Boolean
  }
  .filter { case (_, count) => count <= lowCardinalityHistogramThreshold }
  .map { case (column, _) => column }
  .toSeq

}
`

from deequ.

paulsukow avatar paulsukow commented on July 30, 2024

I could be wrong, but it looks like the column profiler is filtering out the numeric columns before using the histogram class you wrote the test for. Thanks for the quick response btw. Deequ is pretty sweet so far

from deequ.

sscdotopen avatar sscdotopen commented on July 30, 2024

Ah, good find. You are right that we do not consider low-cardinality numeric columns as categorical here. Would you like to write a PR to fix this?

from deequ.

paulsukow avatar paulsukow commented on July 30, 2024

Ya, I'll write up a pr later today.

from deequ.

sscdotopen avatar sscdotopen commented on July 30, 2024

Cool, looking forward to that!

from deequ.

paulsukow avatar paulsukow commented on July 30, 2024

pr for fix #97

from deequ.

paulsukow avatar paulsukow commented on July 30, 2024

#97 merged. Closing issue

from deequ.

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.