mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-06 17:29:31 +08:00
Add Z-Score Algorithm (#3065)
Co-authored-by: Andrii Siriak <siryaka@gmail.com>
This commit is contained in:
9
src/main/java/com/thealgorithms/maths/StandardScore.java
Normal file
9
src/main/java/com/thealgorithms/maths/StandardScore.java
Normal file
@ -0,0 +1,9 @@
|
||||
package com.thealgorithms.maths;
|
||||
|
||||
public class StandardScore {
|
||||
public static double zScore(double num, double mean, double stdDev)
|
||||
{
|
||||
double z = (num - mean)/stdDev;
|
||||
return z;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user