Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

entropy formula pyhon

import math

def entropy_cal(array):
    total_entropy = 0
    
    for i in array:
        total_entropy += -i * math.log(2, i)
    return total_entropy

def main():
    probabilities = [0.5, 0.5]
    entropy = entropy_cal(probabilities)
    print(entropy)
 
PREVIOUS NEXT
Tagged: #entropy #formula #pyhon
ADD COMMENT
Topic
Name
4+2 =