semvec/pypi-packages huggingface dataset:
infnum 0.2.0
Infinite and infinitesimal numbers for JAX
Requires Python: >=3.12

# infnum

**infnum** is a Python library that provides infinite and infinitesimal numbers using the [Levi-Civita Field](https://en.wikipedia.org/wiki/Levi-Civita_field). It uses [JAX](https://github.com/google/jax) under the hood.

## Installation

You can install **infnum** via `pip`:

```bash
pip install infnum
```

## Usage

### Creating Levi-Civita Numbers

The main constructor expects a dictionary with numerical keys and values. The keys represent the exponents and the values the coefficients. In the following example, note that ε⁻³ is an *infinite* number.

```python
from infnum import LeviCivitaNumber

# Create a Levi-Civita number from a real number
num = LeviCivitaNumber.from_number(5.0) # 5.0
print(num)  # Output: 5.0
# Create a Levi-Civita number with infinitesimal parts
num = LeviCivitaNumber({0: 1.0, 1: 2.0, 2: 3.0, -3: 4.0}) # -4.0ε⁻³ + 1.0 + 2.0ε + 3.0ε² 
print(num)  # Output: -4.0ε⁻³ + 1.0 + 2.0ε + 3.0ε² 
```

### Operations

Levi-Civita numbers support arithmetic operations like addition, subtraction, multiplication, and division. Division is truncated to 8 terms by default since it may result in an infinite series, but the higher terms are infinitesimal with respect to the lower terms.


You may compare Levi-Civita numbers using the `<, <=, >, >=, ==, !=` operators, which considers the lexicographical order of the coefficients.

### Testing

Levi-Civita numbers come with unit tests to ensure correctness. You can run the tests using:

```bash
python -m unittest discover tests
```

## Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

## License

This project is licensed under the Apache 2 License.

## TODO

- [ ] add complex number support
- [ ] support non-integer powers for non-pure terms
pyMFDR 0.1.5
A python package for MF (matrix factorization) based DR (dimensionality reduction) algorithms.
Requires Python: >=3.6

# pyMFDR

<b>publication:</b> <i>Matrix Factorization Based Dimensionality Reduction Algorithms - A Comparative Study on Spectroscopic Profiling Data. Analytical Chemistry, 2022, DOI: [10.1021/acs.analchem.2c01922](https://doi.org/10.1021/acs.analchem.2c01922)</i>

<hr/>
This is a python package for MF (matrix factorization) based DR (dimensionality reduction) algorithms.  

<pre>
  Content of repo
  ├── src : source code
  ├── data : contains the dataset (.csv) used for the study
  └── notebooks : contains the jupyter notebook for the study
</pre>

# Installation 

pip install pyMFDR

# How to use 

Download the sample dataset from the /data folder
Use the following sample code to use the package:

<pre>
  # import the library
  from pyMFDR import mfdr

  # load the dataset or generate a toy dataset by X,y = mvg(md = 2)
  df = pd.read_csv('7047_C02.csv')
  X = df.iloc[:,2:cols-1].values # -1 for removing the last column that contains NAN
  y = df.iloc[:,1].values.ravel() # first col is index and not used in this study

  # get a list of available MFDR algorithms
  mfdr.get_algorithms() # it will ouptut ['PCA', 'NMF', 'LAE', 'RP', 'SRP', 'VQ', 'AA', 'ICA']

  # Run PCA on X. It will return W, H, Xr and the inner algorithm object.
  W,H,Xr,o = mfdr.mf(X, 3, alg = 'PCA', display = False) 

  # evaluate the dimensionality reduction quality by various metrics
  mfdr.evaluate_dr(X,W,Xr)

  # visualize H
  mfdr.visualize_dictionary(H)

</pre>