3 ms·
Or you could just do this: double entropy = -1.0d * mydata.Select(x => x * Math.Log10(x)).Sum(); Where 'mydata' is of type IEnumerable<double>.
by profquail 17y ago
Or you could just do this:
double entropy = -1.0d * mydata.Select(x => x * Math.Log10(x)).Sum();
Where 'mydata' is of type IEnumerable<double>.
- trezor 17y agoI knew there was a simple and concise syntax I was missing. Writing code after midnight is definitely a nono :)