Calculation of the effective dimension
Project description
Dimension Calculation
Dimension Calculation is a Python package designed to estimate the effective dimension of a dataset using several statistical and geometrical approaches. It is particularly useful when dealing with high-dimensional data, mixed variable types, or when studying the curse of dimensionality.
✨ Features
- Supports multiple dimension estimation methods.
- Works with numerical and categorical data.
- Automatic preprocessing:
- Missing value handling,
- Label encoding for categorical variables,
- Feature normalisation.
- Designed for data analysis and research purposes.
📦 Installation
Install the package from PyPI:
pip install dimension-calculation
🚀 Quick start
import pandas as pd
import dimension_calculation as dc
df = pd.read_csv("data.csv")
dimension = dc.dimension_calculation(df)
print(dimension)
By default, the method "nearest-neighbour-3" is used.
🧠 Available methods
The dimension_calculation function supports the following methods:
"variance-ratio""n1""n2""infinite-n""MCMC""nearest-neighbour-1""nearest-neighbour-2""nearest-neighbour-3"(default)
Example:
dc.dimension_calculation(df, method="variance-ratio")
📊 Function signature
dimension_calculation(
dataframe: pd.DataFrame,
method: str = "nearest-neighbour-3"
) -> int
Parameters
-
dataframe (
pd.DataFrame) Input dataset. Must contain at least two columns. -
method (
str) Dimension estimation method to use.
Returns
- int Estimated effective dimensionality of the dataset.
⚠️ Notes and assumptions
- Missing values are automatically replaced with
0. - Categorical variables are encoded using
LabelEncoder. - Features are scaled to
[0, 1]usingMinMaxScaler. - Some methods rely on random sampling and may produce slightly different results across runs.
📚 Research and documentation
This package is based on extensive research into the curse of dimensionality and effective dimension estimation.
You can find the full research materials here:
-
📄 Research paper (theoretical background)
-
📓 Jupyter Notebook (experiments and implementation)
-
📊 All data used
🛠 Dependencies
- numpy
- pandas
- scikit-learn
- scipy
All dependencies are automatically installed via pip.
📜 Licence
This project is licensed under the MIT Licence. You are free to use, modify, and distribute this software, provided that the original copyright notice is retained.
👤 Author
💬 Feedback and contributions
This project was developed primarily for research and experimentation. Feedback, discussions, and improvements are welcome.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dimension_calculation-0.3.0.tar.gz.
File metadata
- Download URL: dimension_calculation-0.3.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d984036f2bf58560766326aa438a5d285522a5da68ca3e71426cc2d7dcc5c36
|
|
| MD5 |
7ddb18add105d1104be7b47996291849
|
|
| BLAKE2b-256 |
fbad7384ee0997957d0fffeefbaab4c3cc74860db6170edcd68bb0774dfbad2f
|
File details
Details for the file dimension_calculation-0.3.0-py3-none-any.whl.
File metadata
- Download URL: dimension_calculation-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
695bcfa9b934151ee3fd11fe3049349fffe9da675d526a13d5f2b1c039e7dc62
|
|
| MD5 |
73a2a73c505dc6234af0f3d4077fccc1
|
|
| BLAKE2b-256 |
affebc9a25bbd0b0deb9f75df8339b2625effea4d4706c5adca08c0aab79f494
|