custom formula

admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: custom formula

Post by admin »

No
outs are supposed to be unique
Don't forget to run script update
Fett
Posts: 85
Joined: Tue Feb 28, 2017 1:23 pm

Re: custom formula

Post by Fett »

okay something I am missing because when I paste it, priority becomes zero for all trades:


1; $_POST[priority] = @round((($d['day']['cd']/$d['day']['od'])*100)*($d['day']['ud']/$d['day']['rd']+1)*(($d['day']['quality'])/1000)*(($d['day']['rd']/['day']['od'])*100));

1st part: ($d['day']['cd']/$d['day']['od'])*100) basically 24 hrs value

2nd part: ($d['day']['ud']/$d['day']['rd']+1) unique/raw ratio (favours bigger trades with more uniques)

3rd part: (($d['day']['quality'])/1000) daily clicks to trade quality - countries weight

4rd part: (($d['day']['rd']/['day']['od'])*100)) owed ratio raw, if > 1 then we owe them if < 1 they owe us



what am I missing please?

:?
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: custom formula

Post by admin »

Ah sorry, forgot to tell you
To evaluate this we have to allow "eval" function which can be harmful to your script if you mess up something

so you have to add

$config['allow_eval'] = true;

to includes/config.php
Don't forget to run script update
Fett
Posts: 85
Joined: Tue Feb 28, 2017 1:23 pm

Re: custom formula

Post by Fett »

TOTAL_OWED*0 +
HOUR_OWED*0+
HOUR_HITS*0 +
HOUR_TRADE_PROD*0+
HOUR_PROD*0 +
TOTAL_HITS*0 +
TOTAL_TRADE_PROD*0+
TOTAL_PROD*0 +
TOTAL_OUT2CLICK*0 +
HOUR_OUT2CLICK*0 +
TOTAL_RELOWN*0 +
HOUR_RELOWN*0

is this the full list of variables?

TOTAL_HITS is total raw ins right?
then where is total uniques in?

I also need "total clicks"

and "total outs"
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: custom formula

Post by admin »

Why don't you use eval version ?
Don't forget to run script update
Fett
Posts: 85
Joined: Tue Feb 28, 2017 1:23 pm

Re: custom formula

Post by Fett »

sorry to spam this post with so many questions :-)

so I put

$config['allow_eval'] = true;

includes/config.php

but still, result for priority is 0.

does it matter where I put in config file?

Thanks
Fett
Posts: 85
Joined: Tue Feb 28, 2017 1:23 pm

Re: custom formula

Post by Fett »

okay I put last line. Amd now ok. :-) At least other user made formulas working, so might be some sysntax error with mine but will sort that out.
Fett
Posts: 85
Joined: Tue Feb 28, 2017 1:23 pm

Re: custom formula

Post by Fett »

yeah


I was missing a $d before a variable thats why it was giving zero :-)
Fett
Posts: 85
Joined: Tue Feb 28, 2017 1:23 pm

Re: custom formula

Post by Fett »

okay here is the final for those who want a more complex algo :-)


final
-----



1; $_POST[priority] = @round( (((($d['day']['cd']/$d['day']['od'])*100)*0.7) + ((($d['day']['ud']/$d['day']['rd'])*100)*0.3)) + ( (((($d['day']['rd']-$d['day']['od'])/$d['day']['rd'])*100)*0.25) + ((($d['day']['rd']/$d['day']['od'])*100)*0.75) ) );





--------------------
explanation of algo
--------------------



Algo has 2 big parts, one part is QUALITY factors, other part is SCALE of exchanged traffic factors.
These 2 scores are added up.




1.Quality factors:
------------------

The quality part of the algo is made up of two quality sub algos:



1.1 24 hours value(also known as effect) with weight of 70%
---------------------------------------------------------------
This can be trabslated to "cost of sales" or "cost of transaction".
Its clicks/outs. So basically favors trades where cost of transaction is low.
It is self-regulating, so for example value will start to fall if trade cannot return more to us,
value will also start to fall if we "drop out" from trades toplist positions, and so we start to get
lower productivity traffic.

Gets 70% weight from the algo quality part.



and



1.2 24 hours unique 2 raw ratio with weight of 30%
------------------------------------------------------

This checks the proportion of unique ins to raw ins. uniques in daily / raw ins daily.
1 means that unique = raw, this is best scenario for quality, the lower this number,
the less uniques is in the mix.
Favors trades with high unique % in the mix. (Basically punishes small trades that can't send us uniques. We are all after uniques, right?)

Gets 30% weight from the algo quality part.





2.Scale of exchanged traffic factors:
-------------------------------------

The scale of exchanged traffic part of the algo is made up of two sub algos:



2.1 Daily urgency (also known as TOTAL_RELOWN, total relative owed), with weight of 25%
-------------------------------------------------------------------------------------------
This is daily owed / daily raws in.
Basically it means urgency to give back traffic to this trade, example:


situation1:

owed=20 (we owe this trade 20 hits) daily raw ins from this trade = 25. so: 20/25 = 0.8
This means high urgency, (the highest urgency would be 1) , we owe this trade a very high percent of the traffic compared to the total traffic he sent.


situation2:

owed=20 (we owe this trade 20 hits) daily raw ins from this trade = 50. so: 20/50 = 0.4
Here, he sent us 50 raws, but we already sent back 30 hits (thats how owed is 20: 50-30=20). So urgency is much lower, only 0.4.

Gets 25% weight from scale part of algo.



and





2.2 Owed 24 hrs ratio raw, with weight of 75%
-------------------------------------------------
This checks raws in daily / outs daily.
If we owe them this is bigger than 1, and so final priority will be higher,
if lower than 1, they owe us and so final priority number becomes smaller.

examples:

situation1:
24 hrs raws in=50 , 24 hrs outs=40. Here, score is 50/40= 1.25 we owe them 25% more traff than they owe us.

situation1:
24 hrs raws in=50 , 24 hrs outs=60. Here, score is 50/60= 0.83 they owe us 17% more traff than we owe them.

Gets 75% weight from scale part of algo.





Note that in all cases, we multiply base score by 100 to avoid low scores and bad precision.

Of course you can change the weights as you like :-)

Enjoy!

dont forget to put

$config['allow_eval'] = true;

in
includes/config.php
Fett
Posts: 85
Joined: Tue Feb 28, 2017 1:23 pm

Re: custom formula

Post by Fett »

okay here is a much better (and shorter) one:




1; if ( $d['day']['cd'] < 1 and $d['day']['ud'] > 0 and $d['day']['od'] > 0 ) {
$_POST[priority] = ( ($d['day']['ud']/$d['day']['od'])*10 );
} elseif ( $d['day']['od'] < 1 and $d['day']['cd'] > 0 ) {
$_POST[priority] = ( ($d['day']['quality'] + $d['day']['quality_url'])*10 );
} elseif ( $d['day']['od'] < 1 and $d['day']['cd'] < 1 ) {
$_POST[priority] = ( ($d['day']['ud'])*10 );
} else {
$_POST[priority] = @round ( (($d['day']['cd']/$d['day']['od'])*100) * ($d['day']['ud']/$d['day']['od']) );
}




Its basically 24 hrs effect x 24 hrs uniq owed ratio, for the main algo.
It also covers all scenarios where there is a digit missing for adequate priority calculation,
so priority point will be calculated in all cases, even if trade sends only hits (but no clicks yet) and no outs to trade (yet).

In other words priority will never be zero, not even for baby size trades.
Post Reply