09.10.2023 Views

Advanced Data Analytics Using Python_ With Machine Learning, Deep Learning and NLP Examples ( 2023)

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 7

Analytics at Scale

else:

(pred1,prob1) = self.get_

score('ctr', str(ctr))

(pred2,prob2) = self.get_

score('avt', str(avt))

(pred3,prob3) = self.get_

score('avv', str(avv))

(pred4,prob4) = self.get_

score(f, value)

if self.big:

return (howbig1 + howbig2 +

howbig3 + howbig4), (pred1

+ pred2 + pred3 + pred4),

(prob1 + prob2 + prob3 +

prob4),(pred_big1 + pred_

big2 + pred_big3 + pred_

big4),(prob_big1 + prob_big2

+ prob_big3 + prob_big4)

else:

return (pred1 + pred2 + pred3

+ pred4), (prob1 + prob2 +

prob3 + prob4)

except:

return 0,0

if f == 'client_time':

value = str(self.get_hour(int(value)))

return self.get_score(f, value)

def get_multiplier(self):

key = self.client.key('multiplier_all_num',

self.domain)

res = self.client.get(key)

175

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!