Gravicode.Science.GraviFrame
1.0.0
dotnet add package Gravicode.Science.GraviFrame --version 1.0.0
NuGet\Install-Package Gravicode.Science.GraviFrame -Version 1.0.0
<PackageReference Include="Gravicode.Science.GraviFrame" Version="1.0.0" />
<PackageVersion Include="Gravicode.Science.GraviFrame" Version="1.0.0" />
<PackageReference Include="Gravicode.Science.GraviFrame" />
paket add Gravicode.Science.GraviFrame --version 1.0.0
#r "nuget: Gravicode.Science.GraviFrame, 1.0.0"
#:package Gravicode.Science.GraviFrame@1.0.0
#addin nuget:?package=Gravicode.Science.GraviFrame&version=1.0.0
#tool nuget:?package=Gravicode.Science.GraviFrame&version=1.0.0
?# Gravicode.Science
A data science and AI ecosystem for .NET 10 — six libraries that mirror the Python stack, each with a runnable sample, an interactive notebook, benchmarks and tests.
Published from DotNetVibeCoderz/Vibe_ML.
| Library | Python analogue | Focus |
|---|---|---|
| GraviNum | NumPy + autograd | N-dimensional arrays, linear algebra, autodiff, FFT, random, statistics |
| GraviFrame | pandas | DataFrames, group-by, pivot, joins, time series |
| GraviLearn | scikit-learn | Preprocessing, supervised & unsupervised ML, pipelines, metrics |
| GraviText | HuggingFace Transformers | Tokenization, embeddings, transformers, NLP tasks |
| GraviGraph | PyTorch Geometric / DGL | Graph structures, embeddings, GNNs |
| GraviProb | PyMC / Stan | Distributions, MCMC and NUTS, variational inference, probabilistic models |
Install
dotnet add package Gravicode.Science.GraviNum # arrays, linear algebra, autodiff
dotnet add package Gravicode.Science.GraviFrame # dataframes
dotnet add package Gravicode.Science.GraviLearn # machine learning
dotnet add package Gravicode.Science.GraviText # NLP
dotnet add package Gravicode.Science.GraviGraph # graphs and GNNs
dotnet add package Gravicode.Science.GraviProb # Bayesian inference
Take only what you need — every package pulls in GraviNum, and nothing else is mandatory. See
docs/publishing.md for how a release is cut.
Quick start
git clone https://github.com/DotNetVibeCoderz/Vibe_ML.git
cd Vibe_ML/GravicodeScience
dotnet build Gravicode.Science.sln -c Release
dotnet test
dotnet run --project samples/GraviLearn.Console
using Gravicode.Science.GraviLearn;
using Gravicode.Science.GraviLearn.Decomposition;
using Gravicode.Science.GraviLearn.ModelSelection;
using Gravicode.Science.GraviLearn.Preprocessing;
using Gravicode.Science.GraviLearn.Trees;
var iris = Datasets.LoadIris();
var split = Selection.Split(iris.Features, iris.Target, testSize: 0.3, stratify: true);
var pipeline = new Pipeline()
.Add(new StandardScaler())
.Add(new PCA(components: 3))
.Add(new RandomForestClassifier(nTrees: 100));
pipeline.Fit(split.TrainX, split.TrainY);
Console.WriteLine(Metrics.ClassificationReport(split.TestY, pipeline.Predict(split.TestX), iris.LabelNames));
What is in the box
src/ six class libraries
samples/ six console apps, each printing real results
notebooks/ six .NET Interactive notebooks with charts
benchmarks/ six BenchmarkDotNet suites, plus the Python comparison harness
datasets/ Iris, Titanic, MNIST digits, Cora, plus generated data
tests/ 1,049 tests
tools/ ScienceAppGen — an IDE that builds apps from a prompt
docs/ English, with Bahasa Indonesia in docs/id/
ScienceAppGen
A desktop IDE with an assistant that writes the files and runs the build itself rather than printing code for you to copy.
dotnet run --project tools/ScienceAppGen
Editor with syntax highlighting and a file explorer, ten data-science project templates, and a chat panel backed by Semantic Kernel with 16 kernel functions — project and file operations, build and run, web search, scraping, exact arithmetic, the clock, and a curated Gravicode API reference.
Works with OpenAI, Azure OpenAI, Anthropic, Google and Ollama. Claude is served by a hand-written chat completion service, because Semantic Kernel has no official Anthropic connector.
Verified end to end against a live endpoint: from one prompt it created a project, wrote the code
and built it — and the test harness independently rebuilt and ran the result to confirm the output.
The template path was driven through the UI separately; here is ml-pipeline generated, built and
run without a line typed in between.
Details in ScienceAppGen.md.
Design
GraviNum is the foundation. Every other library builds on its array and linear-algebra
layer, and nothing above it is ever referenced back down.
GraviNum ──┬── GraviFrame ── GraviLearn ── GraviText ── GraviGraph
└── GraviProb
Views, not copies. Reshaping, transposing and slicing an NdArray produce views over one
shared buffer. Only Copy() moves data.
Three-tier dispatch. Element-wise work automatically picks a Vector<double> SIMD loop, a
threaded version of it, or a strided broadcast walk, based on shape and size. Callers never choose.
Honest performance. LinAlg.Dot sustains ~24 GFLOP/s at 512×512 on a mid-range laptop CPU,
about 20× the textbook triple loop. GPU support exists through ILGPU but is opt-in: everything
here is float64, and on integrated hardware the GPU measured 5–8× slower. See
benchmarks.md.
How it compares to NumPy, pandas and scikit-learn
Measured with an identical harness on both sides — same shapes, same fixtures, same warmup and repeat protocol. Full tables in benchmarks.md.
| Where the work is… | Winner | Examples |
|---|---|---|
| A LAPACK/BLAS call in disguise | Python, 3–15× | SVD 11×, symmetric eigen 5.6×, PCA 11×, matmul 3–6× |
| Compiled Cython inner loops | Python, 2–11× | pandas group-by 6.8×, kNN 11×, k-means 5× |
| Scalar, branchy or sequential | .NET, 2–132× | scalar log-density 132×, BFS 40×, MCMC 13×, Dijkstra 5.6× |
| Bound by memory bandwidth | .NET, 1.8× | element-wise add, 1M and 10M elements |
| A better algorithm | .NET | rolling mean 8.6× (incremental accumulator vs recompute) |
| Tree building | .NET 1.4× | random forest fit beats scikit-learn |
Tally: .NET faster on 12 measurements, Python faster on 22, parity on 3.
The first row used to read 5–140×. Two v0.2 changes moved it:
- Decompositions. SVD and symmetric eigen used Jacobi methods, which sweep the entire matrix until it stops changing. Householder reduction plus a shifted QR/QL iteration made symmetric eigen 23.6× faster and SVD 5.5× faster, taking the worst gaps from 139× and 66× down to 5.6× and 11×.
- Element-wise arithmetic. The parallel path was copying both operands and the result — three extra passes over memory to satisfy a lambda capture. Removing them made it 3× faster and put it ahead of NumPy.
The split is not random. Wherever an operation bottoms out in decades-tuned Fortran, Python wins, and wherever the work is a tight scalar loop that cannot be vectorised into one library call, a JIT-compiled language wins outright — that is most of graph analytics, sampling and text processing.
Those figures are the managed path. If the machine has OpenBLAS or MKL, NativeBlas and
NativeLapack find it and the first row changes completely: matmul reaches parity with NumPy
and QR goes from 15× behind to 1.3×. Nothing native is bundled, and nothing breaks without it. Both
configurations are reported in benchmarks.md.
The comparison paid for itself immediately: it exposed an O(n²) decision-tree split that made the random-forest benchmark run for 83 minutes without finishing. Fixed, it fits in 1.9 s — and now beats scikit-learn. It also caught a benchmark that the JIT had optimised into nothing.
Verified against reference implementations
The test suite pins results that are independently known, so a regression shows up as a test failure rather than as a plausible-looking number:
| Result | |
|---|---|
| PCA on Iris | 92.46% / 5.31% variance on the first two components |
Digits, StandardScaler → PCA(30) → kNN(3) |
97.96% test accuracy |
| Cora largest weakly connected component | 2,485 of 2,708 nodes |
| Coin-flip posterior, MCMC vs exact conjugate | agrees to ~0.002 |
| Titanic random forest | above the 0.78 published baseline |
Documentation
| English | Bahasa Indonesia | |
|---|---|---|
| Installation | installation.md | id/installation.md |
| Getting started | getting_started.md | id/getting_started.md |
| Benchmarks | benchmarks.md | id/benchmarks.md |
| Datasets | datasets.md | id/datasets.md |
| ScienceAppGen | ScienceAppGen.md | id/ScienceAppGen.md |
| Publishing and CI | publishing.md | id/publishing.md |
Per-library guides sit alongside them in docs/ and docs/id/.
Roadmap: PLAN.md · Status: Progress.md
Samples
Each prints a hardware report, then does real work on real data:
dotnet run --project samples/GraviNum.Console # matrix ops, decompositions, GFLOP/s
dotnet run --project samples/GraviFrame.Console # Titanic: group-by, pivot, joins, time series
dotnet run --project samples/GraviLearn.Console # Iris: forests, cross-validation, grid search
dotnet run --project samples/GraviText.Console # bilingual sentiment, embeddings, transformer
dotnet run --project samples/GraviGraph.Console # Cora: PageRank, centrality, GCN
dotnet run --project samples/GraviProb.Console # Bayesian coin toss, HMM, Bayesian network
They also render the charts in docs/screenshots/.
Requirements
.NET SDK 10.0 or later. Windows, Linux or macOS. A GPU is optional and never required.
Licence
MIT.
Dibuat oleh Gravicode Studios, dipimpin oleh Kang Fadhil
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Gravicode.Science.GraviNum (>= 1.0.0)
- ILGPU (>= 1.5.3)
- ILGPU.Algorithms (>= 1.5.3)
- Parquet.Net (>= 5.6.1)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on Gravicode.Science.GraviFrame:
| Package | Downloads |
|---|---|
|
Gravicode.OfficeNet.ExcelNet
A .NET 10 rewrite of openpyxl with pandas-style analysis: read and write .xlsx, cell formulas, styles, merges and conditional formatting, worksheet management, charts and pivot tables, CSV/JSON/SQL/PDF import and export, and a DataFrame bridge to GraviFrame. Dibuat oleh Gravicode Studios, dipimpin oleh Kang Fadhil. |
|
|
Gravicode.OfficeNet.Rendering
Rasterises OfficeNet documents to images: PDF pages, Word documents, Excel sheets and PowerPoint slides to PNG or JPEG. Kept out of PdfNet so the core libraries stay free of any native dependency; this package brings SkiaSharp. Dibuat oleh Gravicode Studios, dipimpin oleh Kang Fadhil. |
|
|
Gravicode.OfficeNet
OfficeNet — Word, Excel, PowerPoint and PDF for .NET 10 with no Office install and no native dependency. This package pulls in WordNet, ExcelNet, PowerPointNet and PdfNet, and adds a facade that opens any of the four formats by sniffing the file. Dibuat oleh Gravicode Studios, dipimpin oleh Kang Fadhil. |
|
|
Gravicode.Science.GraviLearn
Gravicode.Science - data science and AI ecosystem for .NET. Dibuat oleh Gravicode Studios, dipimpin oleh Kang Fadhil. |
|
|
Gravicode.Visual.Net.Core
Colour, colormap, scale, tick and plotting-statistics primitives shared by Matplotlib.Net, Plotly.Net and Seaborn.Net. Dibuat oleh Gravicode Studios, dipimpin oleh Kang Fadhil. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 289 | 9/1/2026 |