cognitive-discovery-system-v2 2.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cognitive_discovery_system_v2-2.0.0/.github/workflows/docs.yml +42 -0
- cognitive_discovery_system_v2-2.0.0/.github/workflows/release.yml +37 -0
- cognitive_discovery_system_v2-2.0.0/.github/workflows/tests.yml +45 -0
- cognitive_discovery_system_v2-2.0.0/.gitignore +36 -0
- cognitive_discovery_system_v2-2.0.0/CHANGELOG.md +59 -0
- cognitive_discovery_system_v2-2.0.0/LICENSE +21 -0
- cognitive_discovery_system_v2-2.0.0/PKG-INFO +145 -0
- cognitive_discovery_system_v2-2.0.0/README.md +99 -0
- cognitive_discovery_system_v2-2.0.0/docs/api/cli.md +5 -0
- cognitive_discovery_system_v2-2.0.0/docs/api/graph.md +5 -0
- cognitive_discovery_system_v2-2.0.0/docs/api/integrate.md +5 -0
- cognitive_discovery_system_v2-2.0.0/docs/api/interpolate.md +5 -0
- cognitive_discovery_system_v2-2.0.0/docs/api/io.md +5 -0
- cognitive_discovery_system_v2-2.0.0/docs/api/linalg.md +5 -0
- cognitive_discovery_system_v2-2.0.0/docs/api/ml.md +5 -0
- cognitive_discovery_system_v2-2.0.0/docs/api/montecarlo.md +5 -0
- cognitive_discovery_system_v2-2.0.0/docs/api/optimize.md +5 -0
- cognitive_discovery_system_v2-2.0.0/docs/api/signals.md +5 -0
- cognitive_discovery_system_v2-2.0.0/docs/api/stats.md +5 -0
- cognitive_discovery_system_v2-2.0.0/docs/api/timeseries.md +5 -0
- cognitive_discovery_system_v2-2.0.0/docs/api/viz.md +5 -0
- cognitive_discovery_system_v2-2.0.0/docs/getting-started.md +163 -0
- cognitive_discovery_system_v2-2.0.0/docs/index.md +45 -0
- cognitive_discovery_system_v2-2.0.0/docs/modules.md +44 -0
- cognitive_discovery_system_v2-2.0.0/mkdocs.yml +61 -0
- cognitive_discovery_system_v2-2.0.0/pyproject.toml +110 -0
- cognitive_discovery_system_v2-2.0.0/src/cds2/__init__.py +293 -0
- cognitive_discovery_system_v2-2.0.0/src/cds2/_version.py +3 -0
- cognitive_discovery_system_v2-2.0.0/src/cds2/cli.py +166 -0
- cognitive_discovery_system_v2-2.0.0/src/cds2/graph.py +219 -0
- cognitive_discovery_system_v2-2.0.0/src/cds2/integrate.py +119 -0
- cognitive_discovery_system_v2-2.0.0/src/cds2/interpolate.py +72 -0
- cognitive_discovery_system_v2-2.0.0/src/cds2/io.py +95 -0
- cognitive_discovery_system_v2-2.0.0/src/cds2/linalg.py +156 -0
- cognitive_discovery_system_v2-2.0.0/src/cds2/ml.py +472 -0
- cognitive_discovery_system_v2-2.0.0/src/cds2/montecarlo.py +80 -0
- cognitive_discovery_system_v2-2.0.0/src/cds2/optimize.py +170 -0
- cognitive_discovery_system_v2-2.0.0/src/cds2/signals.py +194 -0
- cognitive_discovery_system_v2-2.0.0/src/cds2/stats.py +247 -0
- cognitive_discovery_system_v2-2.0.0/src/cds2/timeseries.py +152 -0
- cognitive_discovery_system_v2-2.0.0/src/cds2/viz.py +200 -0
- cognitive_discovery_system_v2-2.0.0/tests/test_cli.py +77 -0
- cognitive_discovery_system_v2-2.0.0/tests/test_graph.py +132 -0
- cognitive_discovery_system_v2-2.0.0/tests/test_integrate.py +71 -0
- cognitive_discovery_system_v2-2.0.0/tests/test_interpolate.py +54 -0
- cognitive_discovery_system_v2-2.0.0/tests/test_io.py +63 -0
- cognitive_discovery_system_v2-2.0.0/tests/test_linalg.py +105 -0
- cognitive_discovery_system_v2-2.0.0/tests/test_ml.py +163 -0
- cognitive_discovery_system_v2-2.0.0/tests/test_montecarlo.py +52 -0
- cognitive_discovery_system_v2-2.0.0/tests/test_optimize.py +78 -0
- cognitive_discovery_system_v2-2.0.0/tests/test_signals.py +111 -0
- cognitive_discovery_system_v2-2.0.0/tests/test_stats.py +153 -0
- cognitive_discovery_system_v2-2.0.0/tests/test_timeseries.py +110 -0
- cognitive_discovery_system_v2-2.0.0/tests/test_viz.py +81 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
pages: write
|
|
11
|
+
id-token: write
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: pages
|
|
15
|
+
cancel-in-progress: false
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
build:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
- uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: "3.12"
|
|
25
|
+
- name: Install package with docs extras
|
|
26
|
+
run: pip install -e .[docs]
|
|
27
|
+
- name: Build documentation
|
|
28
|
+
run: mkdocs build --strict --site-dir site
|
|
29
|
+
- name: Upload Pages artifact
|
|
30
|
+
uses: actions/upload-pages-artifact@v3
|
|
31
|
+
with:
|
|
32
|
+
path: site
|
|
33
|
+
|
|
34
|
+
deploy:
|
|
35
|
+
needs: build
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
environment:
|
|
38
|
+
name: github-pages
|
|
39
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
40
|
+
steps:
|
|
41
|
+
- id: deployment
|
|
42
|
+
uses: actions/deploy-pages@v4
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*.*.*"]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: write
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
uses: ./.github/workflows/tests.yml
|
|
13
|
+
|
|
14
|
+
publish:
|
|
15
|
+
needs: test
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
environment: pypi
|
|
18
|
+
permissions:
|
|
19
|
+
contents: write
|
|
20
|
+
id-token: write
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
with:
|
|
24
|
+
fetch-depth: 0
|
|
25
|
+
- uses: actions/setup-python@v5
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.12"
|
|
28
|
+
- name: Install build tooling
|
|
29
|
+
run: pip install build
|
|
30
|
+
- name: Build sdist and wheel
|
|
31
|
+
run: python -m build
|
|
32
|
+
- name: Publish to PyPI
|
|
33
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
34
|
+
- name: Create GitHub Release
|
|
35
|
+
uses: softprops/action-gh-release@v2
|
|
36
|
+
with:
|
|
37
|
+
generate_release_notes: true
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
workflow_call:
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: ci-${{ github.ref }}
|
|
12
|
+
cancel-in-progress: true
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
lint:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
- uses: actions/setup-python@v5
|
|
20
|
+
with:
|
|
21
|
+
python-version: "3.12"
|
|
22
|
+
- name: Install ruff
|
|
23
|
+
run: pip install ruff
|
|
24
|
+
- name: Lint
|
|
25
|
+
run: ruff check .
|
|
26
|
+
- name: Format check
|
|
27
|
+
run: ruff format --check .
|
|
28
|
+
|
|
29
|
+
test:
|
|
30
|
+
needs: lint
|
|
31
|
+
strategy:
|
|
32
|
+
fail-fast: false
|
|
33
|
+
matrix:
|
|
34
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
35
|
+
python-version: ["3.10", "3.11", "3.12", "3.13"]
|
|
36
|
+
runs-on: ${{ matrix.os }}
|
|
37
|
+
steps:
|
|
38
|
+
- uses: actions/checkout@v4
|
|
39
|
+
- uses: actions/setup-python@v5
|
|
40
|
+
with:
|
|
41
|
+
python-version: ${{ matrix.python-version }}
|
|
42
|
+
- name: Install package with dev extras
|
|
43
|
+
run: pip install -e .[dev]
|
|
44
|
+
- name: Run tests
|
|
45
|
+
run: pytest --cov=cds2 --cov-report=term-missing
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Byte-compiled / cache
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
.eggs/
|
|
6
|
+
|
|
7
|
+
# Environments
|
|
8
|
+
.venv/
|
|
9
|
+
venv/
|
|
10
|
+
env/
|
|
11
|
+
|
|
12
|
+
# Tooling caches
|
|
13
|
+
.pytest_cache/
|
|
14
|
+
.mypy_cache/
|
|
15
|
+
.ruff_cache/
|
|
16
|
+
.hypothesis/
|
|
17
|
+
.coverage
|
|
18
|
+
coverage.xml
|
|
19
|
+
htmlcov/
|
|
20
|
+
|
|
21
|
+
# Build artifacts
|
|
22
|
+
build/
|
|
23
|
+
dist/
|
|
24
|
+
*.whl
|
|
25
|
+
|
|
26
|
+
# Editors / OS
|
|
27
|
+
.vscode/
|
|
28
|
+
.idea/
|
|
29
|
+
.DS_Store
|
|
30
|
+
Thumbs.db
|
|
31
|
+
|
|
32
|
+
# Local scratch
|
|
33
|
+
_scratch/
|
|
34
|
+
|
|
35
|
+
# MkDocs output
|
|
36
|
+
site/
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to **cognitive-discovery-system-v2** will be documented in
|
|
4
|
+
this file. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
|
|
5
|
+
and the project adheres to [Semantic Versioning](https://semver.org/).
|
|
6
|
+
|
|
7
|
+
## [v2.0.0] - 2026-08-21
|
|
8
|
+
|
|
9
|
+
The first release of the v2 generation: a full rewrite on top of the scientific
|
|
10
|
+
Python stack. The pure-Python algorithms proven in
|
|
11
|
+
[cognitive-discovery-system](https://github.com/Furox88/cognitive-discovery-system)
|
|
12
|
+
(v1.x) form the foundation; v2 rebuilds them on NumPy/SciPy for speed and adds
|
|
13
|
+
new domain modules on top.
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **Accelerated core** (NumPy / SciPy backed):
|
|
18
|
+
- `cds2.linalg` — solve, det, inv, pinv, eig/eigh, SVD, least squares,
|
|
19
|
+
cholesky, norms, trace, matrix power, rank, condition number
|
|
20
|
+
- `cds2.stats` — descriptive statistics, t-tests (one-sample, independent,
|
|
21
|
+
Welch, paired), ANOVA, Kruskal-Wallis, Mann-Whitney U, Wilcoxon,
|
|
22
|
+
normality test, Pearson/Spearman/Kendall correlations, chi-square
|
|
23
|
+
independence, effect sizes (Cohen's d, eta-squared, Cramer's V),
|
|
24
|
+
percentiles, z-scores, normal pdf/cdf/ppf
|
|
25
|
+
- `cds2.optimize` — minimize, scalar minimization, root finding
|
|
26
|
+
(brentq/newton/systems), linear programming, nonlinear least squares,
|
|
27
|
+
curve fitting
|
|
28
|
+
- `cds2.integrate` — quad/dblquad/triple integration, ODE solving via
|
|
29
|
+
`solve_ivp`, trapezoid/simpson rules, cumulative integration
|
|
30
|
+
- `cds2.interpolate` — linear/cubic/pchip interpolation, Lagrange
|
|
31
|
+
polynomials, scattered-data gridding, regular-grid interpolation
|
|
32
|
+
- `cds2.signals` — FFT family, periodogram/Welch/spectrogram, Butterworth
|
|
33
|
+
low/high/band-pass filters, peak finding, convolution/correlation,
|
|
34
|
+
Hilbert envelope, resampling, detrending
|
|
35
|
+
- `cds2.montecarlo` — seeded pi estimation, 1-D Monte Carlo integration,
|
|
36
|
+
expectation estimation, hit-or-miss area estimation
|
|
37
|
+
- `cds2.graph` — adjacency builders, connected components, Dijkstra /
|
|
38
|
+
Bellman-Ford / Floyd-Warshall shortest paths, minimum spanning tree,
|
|
39
|
+
degrees, topological order, and **PageRank** (power iteration)
|
|
40
|
+
- **New domain modules**:
|
|
41
|
+
- `cds2.ml` — LinearRegression, LogisticRegression, KMeans (k-means++
|
|
42
|
+
seeding), PCA, KNeighborsClassifier, StandardScaler, train/test split,
|
|
43
|
+
synthetic data generators, classification/regression metrics
|
|
44
|
+
- `cds2.timeseries` — moving average, exponential smoothing, differencing,
|
|
45
|
+
classical seasonal decomposition, ACF/PACF, Ljung-Box test
|
|
46
|
+
- `cds2.viz` — matplotlib helpers: series, histogram, scatter, heatmap,
|
|
47
|
+
spectrum, regression overlay, confusion matrix
|
|
48
|
+
- `cds2.io` — pandas-backed CSV/JSON readers/writers plus optional
|
|
49
|
+
Excel/Parquet bridges and a DataFrame summarizer
|
|
50
|
+
- **CLI**: `cds2 info | stats | integrate | linsolve | plot`
|
|
51
|
+
- **CI**: GitHub Actions matrix (Ubuntu/Windows/macOS x Python 3.10-3.13)
|
|
52
|
+
with ruff + pytest
|
|
53
|
+
|
|
54
|
+
### Changed
|
|
55
|
+
|
|
56
|
+
- Runtime dependencies are now explicit: numpy, scipy, pandas, matplotlib.
|
|
57
|
+
The zero-dependency philosophy of v1.x is intentionally retired in favor of
|
|
58
|
+
a faster, richer stack. The v1 line remains maintained separately at its own
|
|
59
|
+
repository.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Furox88
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: cognitive-discovery-system-v2
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: A NumPy/SciPy/Pandas/Matplotlib-powered scientific computing platform: accelerated linear algebra, statistics, optimization, integration, interpolation, signal processing, Monte Carlo, graphs (with PageRank), machine learning, time series, visualization and I/O.
|
|
5
|
+
Project-URL: Homepage, https://github.com/Furox88/cognitive-discovery-system-v2
|
|
6
|
+
Project-URL: Repository, https://github.com/Furox88/cognitive-discovery-system-v2
|
|
7
|
+
Project-URL: Issues, https://github.com/Furox88/cognitive-discovery-system-v2/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/Furox88/cognitive-discovery-system-v2/releases
|
|
9
|
+
Author-email: Furox88 <furkanarkn1451@gmail.com>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: data-analysis,graph-theory,machine-learning,matplotlib,monte-carlo,numerical-methods,numpy,optimization,pagerank,pandas,scientific-computing,scipy,signal-processing,statistics,time-series
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Mathematics
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: matplotlib>=3.8
|
|
25
|
+
Requires-Dist: numpy>=1.26
|
|
26
|
+
Requires-Dist: pandas>=2.2
|
|
27
|
+
Requires-Dist: scipy>=1.11
|
|
28
|
+
Provides-Extra: all
|
|
29
|
+
Requires-Dist: mkdocs-material>=9.5; extra == 'all'
|
|
30
|
+
Requires-Dist: mkdocs>=1.6; extra == 'all'
|
|
31
|
+
Requires-Dist: mkdocstrings[python]>=0.26; extra == 'all'
|
|
32
|
+
Requires-Dist: mypy>=1.10; extra == 'all'
|
|
33
|
+
Requires-Dist: pytest-cov; extra == 'all'
|
|
34
|
+
Requires-Dist: pytest>=8.0; extra == 'all'
|
|
35
|
+
Requires-Dist: ruff>=0.4; extra == 'all'
|
|
36
|
+
Provides-Extra: dev
|
|
37
|
+
Requires-Dist: mypy>=1.10; extra == 'dev'
|
|
38
|
+
Requires-Dist: pytest-cov; extra == 'dev'
|
|
39
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
40
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
41
|
+
Provides-Extra: docs
|
|
42
|
+
Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
|
|
43
|
+
Requires-Dist: mkdocs>=1.6; extra == 'docs'
|
|
44
|
+
Requires-Dist: mkdocstrings[python]>=0.26; extra == 'docs'
|
|
45
|
+
Description-Content-Type: text/markdown
|
|
46
|
+
|
|
47
|
+
# cognitive-discovery-system-v2
|
|
48
|
+
|
|
49
|
+
[](https://github.com/Furox88/cognitive-discovery-system-v2/actions/workflows/tests.yml)
|
|
50
|
+
[](https://pypi.org/project/cognitive-discovery-system-v2/)
|
|
51
|
+
[](https://pypi.org/project/cognitive-discovery-system-v2/)
|
|
52
|
+
[](LICENSE)
|
|
53
|
+
[](https://github.com/astral-sh/ruff)
|
|
54
|
+
|
|
55
|
+
**CDS v2** is a scientific computing platform built on the scientific Python
|
|
56
|
+
stack — NumPy, SciPy, pandas and matplotlib. The algorithms proven in the
|
|
57
|
+
pure-Python [cognitive-discovery-system](https://github.com/Furox88/cognitive-discovery-system)
|
|
58
|
+
(v1.x) form its foundation; v2 rebuilds them for speed and adds new domain
|
|
59
|
+
modules on top.
|
|
60
|
+
|
|
61
|
+
## Installation
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
pip install cognitive-discovery-system-v2
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
From source:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
git clone https://github.com/Furox88/cognitive-discovery-system-v2.git
|
|
71
|
+
cd cognitive-discovery-system-v2
|
|
72
|
+
pip install -e .[dev]
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Quick start
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
import numpy as np
|
|
79
|
+
import cds2
|
|
80
|
+
|
|
81
|
+
# Linear algebra
|
|
82
|
+
A = [[3.0, 1.0], [1.0, 2.0]]
|
|
83
|
+
b = [9.0, 8.0]
|
|
84
|
+
x = cds2.linalg.solve(A, b)
|
|
85
|
+
|
|
86
|
+
# Statistics
|
|
87
|
+
r = cds2.stats.independent_t_test([1, 2, 3, 4, 5], [3, 4, 5, 6, 7])
|
|
88
|
+
|
|
89
|
+
# Optimization
|
|
90
|
+
res = cds2.optimize.minimize(lambda v: (v[0] - 2) ** 2 + (v[1] + 1) ** 2, x0=[0.0, 0.0])
|
|
91
|
+
print(res.x) # ~ [2.0, -1.0]
|
|
92
|
+
|
|
93
|
+
# Signals
|
|
94
|
+
freqs, psd = cds2.signals.power_spectrum(np.sin(np.linspace(0, 100, 1024)), fs=256.0)
|
|
95
|
+
|
|
96
|
+
# Graphs with PageRank
|
|
97
|
+
adj = cds2.graph.from_edges(4, [(0, 1), (0, 2), (1, 3), (2, 3)], directed=True)
|
|
98
|
+
scores = cds2.graph.pagerank(adj)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## Modules
|
|
102
|
+
|
|
103
|
+
| Module | Built on | Highlights |
|
|
104
|
+
|---|---|---|
|
|
105
|
+
| `cds2.linalg` | NumPy | solve, det, inv, pinv, eig/eigh, SVD, least squares, cholesky, cond |
|
|
106
|
+
| `cds2.stats` | scipy.stats | t-tests, ANOVA, non-parametrics, correlations, chi-square, effect sizes, normal dist helpers |
|
|
107
|
+
| `cds2.optimize` | scipy.optimize | minimize, roots (brentq/newton/system), linprog, least squares, curve fit |
|
|
108
|
+
| `cds2.integrate` | scipy.integrate | quad, 2-D/3-D integration, ODE solvers, trapezoid/simpson |
|
|
109
|
+
| `cds2.interpolate` | scipy.interpolate | linear/cubic/pchip, lagrange, griddata, regular grids |
|
|
110
|
+
| `cds2.signals` | scipy.signal | FFT, PSD/welch/spectrogram, Butterworth filters, peaks, envelope |
|
|
111
|
+
| `cds2.montecarlo` | NumPy Generator | pi estimate, MC integration/expectation, hit-or-miss (all seedable) |
|
|
112
|
+
| `cds2.graph` | scipy.sparse.csgraph | components, Dijkstra/Bellman-Ford/Floyd-Warshall, MST, topological order, PageRank |
|
|
113
|
+
| `cds2.ml` | NumPy/SciPy | LinearRegression, LogisticRegression, KMeans++, PCA, KNN, metrics, data generators |
|
|
114
|
+
| `cds2.timeseries` | pandas | moving average, EWM, differencing, seasonal decomposition, ACF/PACF, Ljung-Box |
|
|
115
|
+
| `cds2.viz` | matplotlib | series/histogram/scatter/heatmap/spectrum/regression/confusion plots |
|
|
116
|
+
| `cds2.io` | pandas | CSV/JSON read-write, optional Excel/Parquet bridges, DataFrame summaries |
|
|
117
|
+
|
|
118
|
+
## CLI
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
cds2 info
|
|
122
|
+
cds2 stats 1,2,3,4,5
|
|
123
|
+
cds2 integrate sin --a 0 --b 3.14159
|
|
124
|
+
cds2 linsolve --a "3,1;1,2" --b "9,8"
|
|
125
|
+
cds2 plot 1,3,2,5,4 --file out.png
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Relationship to CDS v1.x
|
|
129
|
+
|
|
130
|
+
The original zero-dependency pure-Python line lives at
|
|
131
|
+
[Furox88/cognitive-discovery-system](https://github.com/Furox88/cognitive-discovery-system)
|
|
132
|
+
and remains available. v2 is an independent project that trades that
|
|
133
|
+
constraint for the speed and breadth of the scientific Python ecosystem.
|
|
134
|
+
|
|
135
|
+
## Development
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
pip install -e .[dev]
|
|
139
|
+
pytest # run the test suite
|
|
140
|
+
ruff check . # lint
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## License
|
|
144
|
+
|
|
145
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# cognitive-discovery-system-v2
|
|
2
|
+
|
|
3
|
+
[](https://github.com/Furox88/cognitive-discovery-system-v2/actions/workflows/tests.yml)
|
|
4
|
+
[](https://pypi.org/project/cognitive-discovery-system-v2/)
|
|
5
|
+
[](https://pypi.org/project/cognitive-discovery-system-v2/)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[](https://github.com/astral-sh/ruff)
|
|
8
|
+
|
|
9
|
+
**CDS v2** is a scientific computing platform built on the scientific Python
|
|
10
|
+
stack — NumPy, SciPy, pandas and matplotlib. The algorithms proven in the
|
|
11
|
+
pure-Python [cognitive-discovery-system](https://github.com/Furox88/cognitive-discovery-system)
|
|
12
|
+
(v1.x) form its foundation; v2 rebuilds them for speed and adds new domain
|
|
13
|
+
modules on top.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install cognitive-discovery-system-v2
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
From source:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
git clone https://github.com/Furox88/cognitive-discovery-system-v2.git
|
|
25
|
+
cd cognitive-discovery-system-v2
|
|
26
|
+
pip install -e .[dev]
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Quick start
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
import numpy as np
|
|
33
|
+
import cds2
|
|
34
|
+
|
|
35
|
+
# Linear algebra
|
|
36
|
+
A = [[3.0, 1.0], [1.0, 2.0]]
|
|
37
|
+
b = [9.0, 8.0]
|
|
38
|
+
x = cds2.linalg.solve(A, b)
|
|
39
|
+
|
|
40
|
+
# Statistics
|
|
41
|
+
r = cds2.stats.independent_t_test([1, 2, 3, 4, 5], [3, 4, 5, 6, 7])
|
|
42
|
+
|
|
43
|
+
# Optimization
|
|
44
|
+
res = cds2.optimize.minimize(lambda v: (v[0] - 2) ** 2 + (v[1] + 1) ** 2, x0=[0.0, 0.0])
|
|
45
|
+
print(res.x) # ~ [2.0, -1.0]
|
|
46
|
+
|
|
47
|
+
# Signals
|
|
48
|
+
freqs, psd = cds2.signals.power_spectrum(np.sin(np.linspace(0, 100, 1024)), fs=256.0)
|
|
49
|
+
|
|
50
|
+
# Graphs with PageRank
|
|
51
|
+
adj = cds2.graph.from_edges(4, [(0, 1), (0, 2), (1, 3), (2, 3)], directed=True)
|
|
52
|
+
scores = cds2.graph.pagerank(adj)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Modules
|
|
56
|
+
|
|
57
|
+
| Module | Built on | Highlights |
|
|
58
|
+
|---|---|---|
|
|
59
|
+
| `cds2.linalg` | NumPy | solve, det, inv, pinv, eig/eigh, SVD, least squares, cholesky, cond |
|
|
60
|
+
| `cds2.stats` | scipy.stats | t-tests, ANOVA, non-parametrics, correlations, chi-square, effect sizes, normal dist helpers |
|
|
61
|
+
| `cds2.optimize` | scipy.optimize | minimize, roots (brentq/newton/system), linprog, least squares, curve fit |
|
|
62
|
+
| `cds2.integrate` | scipy.integrate | quad, 2-D/3-D integration, ODE solvers, trapezoid/simpson |
|
|
63
|
+
| `cds2.interpolate` | scipy.interpolate | linear/cubic/pchip, lagrange, griddata, regular grids |
|
|
64
|
+
| `cds2.signals` | scipy.signal | FFT, PSD/welch/spectrogram, Butterworth filters, peaks, envelope |
|
|
65
|
+
| `cds2.montecarlo` | NumPy Generator | pi estimate, MC integration/expectation, hit-or-miss (all seedable) |
|
|
66
|
+
| `cds2.graph` | scipy.sparse.csgraph | components, Dijkstra/Bellman-Ford/Floyd-Warshall, MST, topological order, PageRank |
|
|
67
|
+
| `cds2.ml` | NumPy/SciPy | LinearRegression, LogisticRegression, KMeans++, PCA, KNN, metrics, data generators |
|
|
68
|
+
| `cds2.timeseries` | pandas | moving average, EWM, differencing, seasonal decomposition, ACF/PACF, Ljung-Box |
|
|
69
|
+
| `cds2.viz` | matplotlib | series/histogram/scatter/heatmap/spectrum/regression/confusion plots |
|
|
70
|
+
| `cds2.io` | pandas | CSV/JSON read-write, optional Excel/Parquet bridges, DataFrame summaries |
|
|
71
|
+
|
|
72
|
+
## CLI
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
cds2 info
|
|
76
|
+
cds2 stats 1,2,3,4,5
|
|
77
|
+
cds2 integrate sin --a 0 --b 3.14159
|
|
78
|
+
cds2 linsolve --a "3,1;1,2" --b "9,8"
|
|
79
|
+
cds2 plot 1,3,2,5,4 --file out.png
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Relationship to CDS v1.x
|
|
83
|
+
|
|
84
|
+
The original zero-dependency pure-Python line lives at
|
|
85
|
+
[Furox88/cognitive-discovery-system](https://github.com/Furox88/cognitive-discovery-system)
|
|
86
|
+
and remains available. v2 is an independent project that trades that
|
|
87
|
+
constraint for the speed and breadth of the scientific Python ecosystem.
|
|
88
|
+
|
|
89
|
+
## Development
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
pip install -e .[dev]
|
|
93
|
+
pytest # run the test suite
|
|
94
|
+
ruff check . # lint
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## License
|
|
98
|
+
|
|
99
|
+
MIT — see [LICENSE](LICENSE).
|