Metadata-Version: 2.4
Name: robust-mixed-dist
Version: 0.2.0
Summary: Compute statistical robust distances for mixed data.
Home-page: https://github.com/FabioScielzoOrtiz/robust_mixed_dist-package
Author: Fabio Scielzo-Ortiz
Author-email: fabio.scielzoortiz@gmail.com
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: polars
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: scikit-learn
Requires-Dist: scipy<=1.16.2
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# robust-mixed-dist

Data scientists address real-world problems using multivariate and heterogeneous
datasets, characterized by multiple variables of different natures. Selecting a suitable
distance function between units is crucial, as many statistical techniques and machine
learning algorithms depend on this concept. Traditional distances, such as Euclidean
or Manhattan, are unsuitable for mixed-type data, and although Gower distance was
designed to handle this kind of data, it may lead to suboptimal results in the presence
of outlying units or underlying correlation structure.

In the paper ***Grané , Aurea; Scielzo-Ortiz, Fabio. “On generalized Gower distance for mixed-type data: extensive simulation study and new software tools”. SORT-Statistics and Operations Research Transactions, pp. 213-44, doi:10.57645/20.8080.02.28.*** robust distances for mixed-type data are defined and explored, namely **robust generalized Gower** and **robust related metric scaling**. In addition,  the new Python package `robust-mixed-dist` is developed, which enables to
compute these robust proposals as well as classical ones.

The package is located in Python Package Index (PyPI), the standard repository of packages for the Python programming language: https://pypi.org/project/robust_mixed_dist/

- **Package documentation:** https://fabioscielzoortiz.github.io/robust-mixed-dist-docu/intro.html

- **Paper link:** https://raco.cat/index.php/SORT/article/view/9900373

## Changes in version 0.2.0

- `simple_gower_dist` and `simple_gower_dist_matrix` now compute Gower's (1971) distance, $\sqrt{1-s}$, where $s$ averages the partial similarities over the valid comparisons: range-normalised for quantitative variables, Jaccard for binary variables (double absences are not counted) and simple matching for multi-class variables. Missing values (NaN) are allowed and are not counted. Previous versions returned the sum of the three block distances, so results differ from versions <= 0.1.31.
- `S_robust` with `weights`: the data are now centred with the weighted mean and scaled with the weighted standard deviations. With equal weights the result coincides with the unweighted estimate. Generalized Gower and related metric scaling distances were not affected by the previous scaling, since they standardise each block by its geometric variability.
- Generalized Gower and related metric scaling now check that binary variables are coded 0/1 and that categorical variables are numeric and have no missing values, and raise an informative error otherwise.
