Skip to main content

Machine Gnostics

Machine Gnostics

PyPI version Python Versions License: GPL v3 Downloads Downloads GitHub stars

Machine Gnostics: Laws of Nature, Encoded — For Everyone!

Machine Gnostics is a Python library for robust, assumption-free data analysis and machine learning. It replaces the probabilistic assumptions of classical statistics with Mathematical Gnostics — a deterministic, finite, algebraic theory rooted in Riemannian geometry, Einsteinian relativity, vector bi-algebra, and thermodynamics.

The result: analysis that treats every data point as a real event with its own importance and uncertainty — resilient to outliers, honest about structure, and reliable even on small datasets.


Why Machine Gnostics?

  • Non-statistical by design — deterministic gnostic algebra instead of probability and averages
  • Outlier-resilient — gnostic weights automatically downweight leverage and corruption
  • Finite theory for finite data — works directly with small, real-world datasets
  • Structure-aware — detects curves, clusters, and degenerate cases that summary statistics flatten
  • Deep learning with MAGNET — PyTorch-backed neural networks with gnostic layers
  • Classical + gnostic metrics — accuracy, R2, F1 alongside gnostic mean, relevance, entropy
  • MLflow integration — tracking, registry, reproducibility

Benchmark: Anscombe's Quartet

▶ View the interactive benchmark on machinegnostics.com

Four datasets share identical classical statistics — mean x≈9, mean y≈7.5, r²≈0.67, slope≈0.5 — yet they are radically different: linear, parabolic, outlier-distorted, and degenerate. Classical statistics reports the same summary for all four. Machine Gnostics reads the structure of each.

Key results

Case Classical Statistics Machine Gnostics
Dataset I — linear ✅ Fit is valid ✅ Fit is valid
Dataset II — parabola ❌ Linear fit is structurally wrong ✅ Parabolic shape exposed via weight pattern
Dataset III — outlier ❌ One high-leverage point distorts the line ✅ Outlier weight ≈ 0.04 — leverage removed
Dataset IV — degenerate ❌ Regression is meaningless ✅ Vertical cluster flagged as degenerate

Capability radar (1–10)

Capability Classical Machine Gnostics
Shape detection 1 9
Outlier flagging 1 9
Fit quality 3 9
Structural honesty 1 9
Diagnostic power 1 9
Average 1.4 9.0
Benchmark comparison — MG structural read vs classical statistical summary
Image 1 — MG structural read vs classical summary (Anscombe quartet)
Benchmark radar — capability scores and regression/interval metrics
Image 2 — Capability radar & metrics (MG 9.0 vs Classical 1.4)

This is the first time Machine Gnostics solves the Anscombe case through calculation — deterministic gnostic weight computation, centered coordinate, structural divergence — rather than through plotting or visual inspection alone. Numerical weights reveal the parabola, downweight the outlier (weight ~0.04), and flag the degenerate vertical cluster structurally.

Machine Gnostics is presented as a complementary lens that adds structural insight — not as a replacement for classical statistics. Scores are benchmark comparisons, not peer-reviewed ratings; the direction of the difference is the key result.


Installation

# create an environment (uv or venv)
uv venv .mg-env --python 3.11 && source .mg-env/bin/activate
# or: python3 -m venv .mg-env && source .mg-env/bin/activate

# install
pip install machinegnostics        # or: uv add machinegnostics
Windows
uv venv .mg-env --python 3.11
.mg-env\Scripts\activate
pip install machinegnostics

Verify:

import machinegnostics
print("imported successfully!")

Quick Start

Gnostic Distribution Function

import numpy as np
from machinegnostics.magcal import EGDF

data = np.array([-13.5, 0, 1., 2., 3., 4., 5., 6., 7., 8., 9., 10.])
egdf = EGDF()
egdf.fit(data)
egdf.plot()
print(egdf.params)

Robust Polynomial Regression

import numpy as np
from machinegnostics.models import PolynomialRegressor

X = np.array([0., 0.4, 0.8, 1.2, 1.6, 2.])
y = np.array([17.89, 69.62, -7.20, 9.38, -10.56, 16.58])

model = PolynomialRegressor(degree=2)
model.fit(X, y)
print("Predictions:", model.predict(X))
print("Coefficients:", model.coefficients)

Deep Learning with MAGNET

from machinegnostics.magnet import Sequential, Dense, ReLU, Adam

model = Sequential(layers=[
    Dense(in_features=64, out_features=32),
    ReLU(),
    Dense(in_features=32, out_features=1),
])
model.compile(loss='mse', optimizer=Adam(lr=0.001))
model.fit(X_train, y_train, epochs=10, batch_size=32)
model.predict(X_test)

What's Inside

Module Contents
Data Analysis Gnostic distribution functions, cluster & interval analysis, gnostic data tests
Machine Learning Regression, classification, clustering, forecasting
Metrics Classical statistical metrics + gnostic algebra metrics (mean, median, MAE, MSE, R², relevance, entropy, …)
MAGNET Activations, losses, initializers, optimizers, models, layers — PyTorch-backed
Integration MLflow experiment tracking and model registry

Resources


License

Machine Gnostics is released under the GPL v3 License.


Machine Gnostics is a pioneering open-source initiative redefining the mathematical underpinnings of machine learning. As a young project, some features are still being refined — new models, methods, and benchmarks are on the way. Community support and collaboration are essential to building a new AI grounded in a rational and resilient paradigm.

Author: Nirmal Parmar

Metadata

Release files for machinegnostics 0.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for machinegnostics 0.0.8
File Size Uploaded Provenance Actions
machinegnostics-0.0.8.tar.gz 343.9 kB Without provenance Details for machinegnostics-0.0.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for machinegnostics 0.0.8
File Interpreter ABI Platform Actions
machinegnostics-0.0.8-py3-none-any.whl Python 3 none any Details for machinegnostics-0.0.8-py3-none-any.whl

Total release size: 845.9 kB

Release files / machinegnostics-0.0.8.tar.gz

Download URL machinegnostics-0.0.8.tar.gz
Size 343.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f700fa7e0110302108cdce6ad329d8c28f05117fe08d8bd3401259775fe2e62a
BLAKE2b-256 checksum
How to use checksums
8438b73937be10fb9a81655fbd5fcbb90cd3037642c1f95867b2f314a660d890
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.18

Release files / machinegnostics-0.0.8-py3-none-any.whl

Download URL machinegnostics-0.0.8-py3-none-any.whl
Size 502.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0bdc70047e4959fdc13fa78ecf7815ee0c211410457698415aa55f969e5f5d5b
BLAKE2b-256 checksum
How to use checksums
1572484fdd890c544c0c70ce97a0f6c8cef8fd3ff1130ea8e96d616d961eb5b8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.18

Security for machinegnostics 0.0.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page