Questions tagged [approximate]

Finding or verifying that a value is 'close enough' to some target value.

The tag is used both for questions relating to determining an approximate value (i.e. calculating a value to withing a certain tolerance) and the act of verifying or determining the 'closeness' of a value to a another (e.g. approximate string matching).

See also: .

99 questions
3
votes
3 answers

Pulling information from the first approximate match of a text string in R (and summing the total number of matches)

I'm having trouble summing approximate matches of text strings, as well as pulling information from the string that was matched first in time. I have data that look like this: text<-c("THEN it goes West","AT it falls East","it goes West", "it falls…
R-Enthusiast
  • 340
  • 1
  • 3
  • 10
2
votes
2 answers

How best to select record with the closest matching value in BigQuery?

I have table_a and table_b. In table_a is a list of new SKUs with shipping weight and dimensions (separate fields for length, width, height; see table_a below). In table_b is a list of existing SKUs with the same columns as table_a, plus estimated…
Phuel
  • 21
  • 2
2
votes
3 answers

How to test approximate equality for a specific number significant digits in Julia

The isapprox() function in Julia is used to test if two numbers or arrays are approximately equal. I want to be able to test for approximate equality for any desired number of significant digits. As the code sample below demonstrates, the tolerance…
Pål Bjartan
  • 793
  • 1
  • 6
  • 18
2
votes
2 answers

Infinite loop in program written as an exercise about finding the value of Pi

I have this assignment The value of Pi can be determined by the following product 2 * 2 4 * 4 6 * 6 N * N Pi = 2 * ----- * ----- * ----- * ... * ----------------- 1 * 3 3 * 5 5 * 7 (N - 1) * (N +…
Jack_Kai
  • 19
  • 5
2
votes
1 answer

Trying to find point of intersection using approx function, results are correct on y but off on x axis

Working in R, I am attempting to plot stream cross sections, interpolate a point at an intersection opposite an identified "bankful" point, and calculate the area under the bankful line. It is part of a loop that is processing many cross sections.…
2
votes
1 answer

What is the logic of approximate string matching?

Does anybody know what is the reason for the following example: agrepl("cold", "cool") #> [1] FALSE agrepl("cool", "cold") #> [1] TRUE
2
votes
2 answers

Recursive program to compute Taylor approx of cosine not functioning in Prolog

I'm still pretty new to Prolog, and i'm not sure why this code isn't working. I believe it is most likely a problem with the base case or in the last 3 lines of the recursive case. Everything else works just fine. This program determines cosine…
ItsDraig
  • 51
  • 5
2
votes
1 answer

Approximate String Matching Algorithms for names

I'm looking for fuzzy string algorithms for the following example: given a database of existing names, match inputs to either the best-matched name if the match accuracy is higher than the input threshold (say 90%), or NA otherwise database = [James…
2
votes
1 answer

Is there a MySQL % (approximation) equivalent in VBA?

I want a VBA to look through a cell and determine whether the word XXX appears anywhere in it using the %. If yes I want VBA to change the entire cell to the word YYY. Can anyone help me with this?
DanteeChaos
  • 313
  • 1
  • 6
  • 19
2
votes
2 answers

Django approximate matching of unicode strings with ascii equivalents

I have the following model and instance: class Bashable(models.Model): name = models.CharField(max_length=100) >>> foo = Bashable.objects.create(name=u"piñata") Now I want to be able to search for objects, but using ascii characters rather…
user85461
  • 6,510
  • 2
  • 34
  • 40
2
votes
2 answers

CLPFD for real numbers

CLP(FD) allows user to set the domain for every wannabe-integer variable, so it's able to solve equations. So far so good. However you can't do the same in CLP(R) or similar languages (where you can do only simple inferences). And it's not hard to…
gnidorah
  • 25
  • 3
2
votes
3 answers

Algorithm for approximate search in sorted integer list

Consider an array of integers (assumed to be sorted); I would like to find the array index of the integer that is closest to a given integer in the fastest possible way. And the case where there are multiple possibilities, the algorithm should…
OnRoadCoder
  • 61
  • 1
  • 5
2
votes
2 answers

position of approximate matches

I am working on a script able to make an approximate match of a certain pattern in a string, reporting just the positions in which these patterns (they could be overlapping) initiate. So far, I obtained a script able to report the positions of the…
Andrés F
  • 73
  • 6
2
votes
1 answer

Finding multiple regex hits using approximate matching via the tre library

Using C, I'm trying to find the location and number of matches of a substring within another parent string. Because I also need to include approximate (hamming distance) matches, I'm using the tre library found here: http://laurikari.net/tre/. I'm…
David M
  • 710
  • 1
  • 8
  • 14
2
votes
3 answers

Lucene/Solr for approximate (company) name matching

I have a question regarding Lucene/Solr. I am trying to solve a general (company) name matching problem. Let me present one oversimplified example: We have two (possibly large) lists of names viz., list_A and list_B. We want to find the…
learning_spark
  • 669
  • 1
  • 8
  • 19