Comments (8)
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.
Agreed! Some parts to rewrite equality expressions into inequalities are present in validate.errloc
from validate.
Another option could be to rewrite it into an all.equal
statement which is arguably the most natural R thing to do
from validate.
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.
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.
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.
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.
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)
- Should validate warn when a rule is an `&` of two rules?
- Features for slicing validator objects by metadata
- `violating`, `satisfying` and `lacking` are not generic HOT 1
- Error in section 3.3 of Cookbook HOT 1
- git clone ~ make install choking at: Processing code chunks with options ...
- Consequence of passing a rule HOT 1
- Replace values when a rule passes (or fails) HOT 1
- Minor typos on the cookbook HOT 2
- Validate GUI for interactive data validation HOT 6
- Loading functions using devtools::load_all leads to different output of summary(validation_result) HOT 4
- Turn `validate::violation`s into conditions HOT 1
- Test new data against existing data HOT 1
- Cookbook: table of contents doesn't work? HOT 3
- Question: YAML schema validation HOT 1
- or not working properly HOT 3
- Compare values of two columns based on complex conditions HOT 3
- Using the %in% operator to compare values across columns
- Question: searching for duplicated and empty records HOT 1
- `$linear_coefficients` does not expand `var_group`
- Make cookbook again to include spelling fixes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from validate.