-
-
Notifications
You must be signed in to change notification settings - Fork 1
GalaktaGlareDATA
GalaktaGlareDATA Package Documentation
Introduction: GalaktaGlareDATA is a Go package designed to provide various statistical functions for analyzing numerical data. It includes functions for calculating measures such as mean, median, standard deviation, mode, quartiles, percentile, correlation, and detecting anomalies in datasets.
Installation:
To use GalaktaGlareDATA package, you need to have Go installed on your system. You can then install the package using the go get
command:
go get github.com/simplyYan/GalaktaGlare/src/GalaktaGlareDATA
Functions:
-
Mean:
func Mean(numbers []float64) float64
Calculates the arithmetic mean (average) of a slice of float64 numbers.
Example:
data := []float64{2.5, 3.5, 4.5, 5.5} mean := GalaktaGlareDATA.Mean(data)
-
Median:
func Median(numbers []float64) float64
Calculates the median of a slice of float64 numbers.
Example:
data := []float64{3, 6, 1, 2, 7} median := GalaktaGlareDATA.Median(data)
-
StandardDeviation:
func StandardDeviation(numbers []float64) float64
Calculates the standard deviation of a slice of float64 numbers.
Example:
data := []float64{10, 20, 30, 40, 50} stdDev := GalaktaGlareDATA.StandardDeviation(data)
-
Max:
func Max(numbers []float64) float64
Finds the maximum value in a slice of float64 numbers.
Example:
data := []float64{3, 1, 7, 4, 9} max := GalaktaGlareDATA.Max(data)
-
Min:
func Min(numbers []float64) float64
Finds the minimum value in a slice of float64 numbers.
Example:
data := []float64{8, 3, 5, 1, 9} min := GalaktaGlareDATA.Min(data)
-
Mode:
func Mode(numbers []float64) []float64
Finds the mode(s) in a slice of float64 numbers.
Example:
data := []float64{3, 2, 3, 4, 5, 3} modes := GalaktaGlareDATA.Mode(data)
-
Quartiles:
func Quartiles(numbers []float64) (float64, float64, float64)
Calculates the first quartile (Q1), median (Q2), and third quartile (Q3) of a slice of float64 numbers.
Example:
data := []float64{12, 14, 15, 17, 18, 20, 22} q1, q2, q3 := GalaktaGlareDATA.Quartiles(data)
-
Percentile:
func Percentile(numbers []float64, p float64) float64
Calculates the p-th percentile of a slice of float64 numbers.
Example:
data := []float64{30, 40, 50, 60, 70, 80, 90} p := 75.0 percentile := GalaktaGlareDATA.Percentile(data, p)
-
Correlation:
func Correlation(x, y []float64) float64
Calculates the correlation coefficient between two slices of float64 numbers.
Example:
x := []float64{10, 20, 30, 40, 50} y := []float64{5, 15, 25, 35, 45} correlation := GalaktaGlareDATA.Correlation(x, y)
-
DetectAnomalies:
func DetectAnomalies(numbers []float64, threshold float64) []float64
Detects anomalies (outliers) in a slice of float64 numbers based on a specified threshold.
Example:
data := []float64{10, 15, 20, 25, 200} threshold := 2.0 anomalies := GalaktaGlareDATA.DetectAnomalies(data, threshold)