Giter Club home page Giter Club logo

Comments (8)

markvanderloo avatar markvanderloo commented on June 2, 2024

Writing spurs thought :).

I guess within validate, for the purpose of confrontation we can do the former: translate to abs(x-y) < eps. Within validate.errloc we can do the second.

from validate.

edwindj avatar edwindj commented on June 2, 2024

Agreed! Some parts to rewrite equality expressions into inequalities are present in validate.errloc

from validate.

edwindj avatar edwindj commented on June 2, 2024

Another option could be to rewrite it into an all.equal statement which is arguably the most natural R thing to do

from validate.

markvanderloo avatar markvanderloo commented on June 2, 2024

I tried that :-) since it would work for nonnumerics as well, but all.equal expects two vectors of equal size. That would make translation rather awkward.

from validate.

markvanderloo avatar markvanderloo commented on June 2, 2024

I now added the option lin.eq.eps which, if non-zero, only causes linear rules to be translated to the abs-version. Since it is difficult to discover whether variables (or outcomes of R-statements) are numeric, and also since linear statements are very common I think this is a good compromise for now. Users can always do

some_nonlinear_complex_function_of(x) < their_own_epsilon

to formulate rules in the non-linear case., See upcoming push

from validate.

markvanderloo avatar markvanderloo commented on June 2, 2024

btw: the slack introduced in validate.errloc could be set to

max(lin.eq.eps, [the default for errloc])

but we'll have to see how user-friendly that is. I put the default for lin.eq.eps to 0 so users must explicitly set a tolerance. Not sure about that choice really. In the future we could possibly do this rule-wise as well.

from validate.

markvanderloo avatar markvanderloo commented on June 2, 2024

ok. Changing the default to 1e-8. Since this will not hurt comparisons between integer-rounded values, and works better in many cases of fractional numbers it is probably better. It is also reported in the summary of a confrontation object (since the actually evaluated expression is shown).

from validate.

markvanderloo avatar markvanderloo commented on June 2, 2024

for general equality rules we could also write our own eq function that can handle numeric and categorical data and takes a tolerance.

from validate.

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.