0
$\begingroup$

Hi I am trying to improve my error function . I have some data that is in form of nested tuple. These tuple nesting is base on importance of the data (all the lowest depth data is in as real numbers). example, (1,(1,1)) and (1,(1,0.5)). To find error between these two tuples, I use simple recursion version of AME function (this function only work on same type of nested tuple structures). $$ Error(X,Y) = 1/n \sum_{i=1}^n |X_i-Y_i| \text{ if } X_i \in R \text{ or } Y_i \in R \text{ else } Error(X_i,Y_i) $$ $$ n= |X| = |Y| $$ Using this Error( (1,(1,1)),(1,(1,0.5)) ) we get 0.125 error . Now my question is can we represent the nested tuple using complex numbers numbers and find the error faster and more efficiently ? $$ 1 + (1 +i)i \text{ and } 1 + (1 +0.5i)i $$

$\endgroup$
2
  • $\begingroup$ No. Why are you worrying about efficiency while doing 4 arithmetic operations? That’s already efficient. $\endgroup$ Commented Aug 17 at 21:30
  • 1
    $\begingroup$ Whether changing the data representation improves performance depends on the way the data structures are implemented. You should only explore this kind of optimization when you know the calculation is an actual bottleneck in your program. $\endgroup$ Commented Aug 17 at 21:30

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.