Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dkackman/linqstatistics
Linq extensions to calculate basic statistics
https://github.com/dkackman/linqstatistics
c-sharp linq-extensions statistics
Last synced: 22 days ago
JSON representation
Linq extensions to calculate basic statistics
- Host: GitHub
- URL: https://github.com/dkackman/linqstatistics
- Owner: dkackman
- License: apache-2.0
- Created: 2013-08-05T23:51:27.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2024-03-27T00:58:11.000Z (7 months ago)
- Last Synced: 2024-09-17T23:49:20.909Z (about 2 months ago)
- Topics: c-sharp, linq-extensions, statistics
- Language: C#
- Homepage: https://dkackman.github.io/LinqStatistics/
- Size: 30.1 MB
- Stars: 99
- Watchers: 18
- Forks: 29
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: License.md
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# LinqStatistics
[![.NET](https://github.com/dkackman/LinqStatistics/actions/workflows/dotnet.yml/badge.svg)](https://github.com/dkackman/LinqStatistics/actions/workflows/dotnet.yml)
[![CodeQL](https://github.com/dkackman/LinqStatistics/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/dkackman/LinqStatistics/actions/workflows/github-code-scanning/codeql)
[![NuGet](https://img.shields.io/nuget/dt/LinqStatistics)](https://www.nuget.org/packages/LinqStatistics/)- [API Documentation](https://dkackman.github.io/LinqStatistics/)
Linq extensions to calculate basic statistics.
Extension methods to compute basic statistics modeled after Enumerable.Average. Stats include:
- Covariance
- Median
- Mode
- Pearson's Correlation Coefficient
- Range
- Standard Deviation (sample and population)
- Variance (sample and population)
- Root Mean Square
- Least Squares Linear Regression
- CountEach
- HistogramBasic usage looks like:
```csharp
static void Main(string[] args)
{
IEnumerable data = new int[] { 1, 2, 5, 6, 6, 8, 9, 9, 9 };Console.WriteLine("Count = {0}", data.Count());
Console.WriteLine("Average = {0}", data.Average());
Console.WriteLine("Median = {0}", data.Median());
Console.WriteLine("Mode = {0}", data.Mode());
Console.WriteLine("Sample Variance = {0}", data.Variance());
Console.WriteLine("Sample Standard Deviation = {0}", data.StandardDeviation());
Console.WriteLine("Population Variance = {0}", data.VarianceP());
Console.WriteLine("Population Standard Deviation = {0}", data.StandardDeviationP());
Console.WriteLine("Range = {0}", data.Range());
}
```## Building
This project makes heavy use of T4 templates. You will need Visual Studio and [this extension](https://github.com/RdJNL/TextTemplatingCore) if you want to build from source. VSCode doesn't seem to support T4 templates, nor does `dotnet build`.
## Older Versions
The latest version of this library target .NET 8 LTS. If you need to target older versions of .NET, you can find the appropriate version of this library on NuGet. [Version 2.3.0](https://www.nuget.org/packages/LinqStatistics/?version=2.3.0) targets .Net Standard 1.1 and .Net Framework 4.x.