pyrea


Namepyrea JSON
Version 1.0.10 PyPI version JSON
download
home_pagehttps://github.com/mdbloice/Pyrea
SummaryMulti-view clustering with deep ensemble structures.
upload_time2023-04-19 13:49:34
maintainer
docs_urlNone
authorMarcus D. Bloice, Bastian Pfeifer
requires_python>=3.6
licenseMIT
keywords multi-view clustering ensemble clustering
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Pyrea

<p align="center">
     <img src="https://raw.githubusercontent.com/mdbloice/AugmentorFiles/master/Pyrea/Pyrea-logos_transparent.png" width="400">
</p>
<p align="center">
     Multi-view clustering with flexible ensemble structures.
</p>
<p align="center">
     <a href="https://pypi.org/project/pyrea/"><img src="https://img.shields.io/pypi/v/Pyrea"></a>
     <a href="https://github.com/mdbloice/Pyrea/blob/master/LICENSE"><img src="https://img.shields.io/pypi/l/Pyrea"></a>
     <a href="https://github.com/mdbloice/Pyrea/actions/workflows/main.yml"><img src="https://img.shields.io/pypi/pyversions/Pyrea"></a>
</p>
<p align="center">
     <em>The name Pyrea is derived from the Greek word Parea, meaning a group of friends who gather to share experiences, values, and ideas.</em>
</p>

---

## Installation

Install Pyrea using `pip`:

```bash
pip install pyrea
```

This will install the latest version of Pyrea from PyPI.

## Demonstration Notebooks
A demonstration of Pyrea's usage on the Nutrimouse dataset can be found in the following Jupyter notebook:

- [Nutrimouse.ipynb](https://github.com/mdbloice/Pyrea/blob/master/notebooks/Nutrimouse.ipynb)

In this notebook, hierarchical and spectral clustering are performed on the Nutrimouse multi-view dataset, tuned using Pyrea's genetic algorithm functionality.

More notebooks will be added in due course.

## Usage
The Pyrea software package is the accompanying software for our paper:

Pfeifer, B., Bloice, M.D., & Schimek, M.G. (2022). *Parea: multi-view ensemble clustering for cancer subtype discovery*. arXiv. <https://arxiv.org/abs/2209.15399>

While Pyrea allows for flexible and custom architectures to be built, two structures are discussed specifically in the paper cited above, namely Parea 1 and Parea 2.

Both the structures, which are described in detail below as well as in the paper mentioned above, can be quickly generated and applied to your data using two helper functions, `parea_1()` and `parea_2()`, and can be quickly run as follows:

```python
import pyrea
import numpy as np

# Create sample data:
d1 = np.random.rand(100,10)
d2 = np.random.rand(100,10)
d3 = np.random.rand(100,10)

data = [d1,d2, d3]

labels = pyrea.parea_2(data)
```

which executes Parea 2.

Default parameters are used which match those used in our experiments discussed in the paper referenced above. These default parameters can of course be overridden. As there are many combinations of parameters that could be used, a genetic algorithm can be utilised to find the optimum parameters, as shown in the next section.

### Genetic Algorithm

The Parea 1 and Parea 2 structures can be optimised using a genetic algorithm in order to find the best combinations of clustering methods, fusion methods, and number of clusters.

For example, to find optimal parameters for Parea 2:

```python
import pyrea
from sklearn import datasets

d1 = datasets.load_iris().data
d2 = datasets.load_iris().data
d3 = datasets.load_iris().data

data = [d1,d2,d3]

params = pyrea.parea_2_genetic(data, k_min=2, k_max=5)
```

where `k_min` and `k_max` refer to the minimum and maximum number of clusters to attempt for each layer, respectively.

Note that `params` contains the optimal parameters found by the genetic algorithm. To get the labels, run `parea_2()` passing your data and these optimal parameters:

```python
pyrea.parea_2(data, *params)
```

which will return the cluster labels for your data.

Also, you may choose to define the **final** number of clusters returned by the algorithm (but allowing it to optimise intermediate numbers of clusters) by defining `k_final`, e.g:

```python
params = pyrea.parea_2_genetic(data, k_min=2, k_max=5, k_final=3)
```

and calling `pyrea_2()` as follows:

```python
pyrea.parea_2(data, params, k_final=3)
```

#### Genetic Algorithm Update

The genetic algorithm functions now support arbitrary numbers of views, and the population and number of generations can now be adjusted. See [this notebook](https://github.com/mdbloice/Pyrea/blob/master/notebooks/Nutrimouse.ipynb) for a demonstration of this usage on the Nutrimouse dataset.

### API

**Please note that Pyrea is work in progress. The API may change from version
to version and introduce breaking changes.**

In Pyrea, your data are organised in to views. A view consists of the data in
the form of a 2D matrix, and an associated clustering algorithm (a *clusterer*).

To create a view you must have some data, and a clusterer:

```python
import pyrea

# Create your data, which must be a 2-dimensional array/matrix.
d = [[1,2,3],
     [4,5,6],
     [7,8,9]]

# Create a clusterer
c = pyrea.clusterer("hierarchical", n_clusters=2, method='ward')

v = pyrea.view(d, c)
```

You now have a view `v`, containing the data `d` using the clustering algorithm
`c`. Note that many views can share the same clusterer, or each view may have a
unique clusterer.

To obtain the cluster solution the specified view can be executed

```python
v.execute()
```

The clustering algorithm can be either 'spectral', 'hierarchical', 'dbscan', or 'optics'. See the documentation for a complete list of parameters that can be passed when creating a clusterer.

As this is a library for multi-view ensemble learning, you will normally have
multiple views.

A fusion algorithm is therefore used to fuse the clusterings created from
multiple views. Therefore, our next step is to create a *fuser* object:

```python
f = pyrea.fuser('disagreement')
```

With you fusion algorithm `f`, you can execute an *ensemble*. The ensemble is created with a set of views and a fusion algorithm,
and its returned object (distance or affinity matrix) can again be specified as a view:

```python
# Create a new clusterer with precomputed=True
c_pre = pyrea.clusterer("hierarchical", n_clusters=2, method='ward', precomputed=True)
v_res = pyrea.view(pyrea.execute_ensemble([v1, v2, v3], f), c_pre)
```

This newly created view, `v_res` can subsequently be fed into another ensemble,
allowing you to create stacked ensemble architectures, with high flexibility.

A full example is shown below, using random data:

```python
import pyrea
import numpy as np

# Create two datasets with random values of 1000 samples and 100 features per sample.
d1 = np.random.rand(1000,100)
d2 = np.random.rand(1000,100)

# Define the clustering algorithm(s) you want to use. In this case we used the same
# algorithm for both views. By default n_clusters=2.
c = pyrea.clusterer('hierarchical', n_clusters=2, method='ward')

# Create the views using the data and the same clusterer
v1 = pyrea.view(d1, c)
v2 = pyrea.view(d2, c)

# Create a fusion object
f = pyrea.fuser('disagreement')

# Specify a clustering algorithm (precomputed = True)
c_pre = pyrea.clusterer("hierarchical", n_clusters=2, method='ward', precomputed=True)
# Execute an ensemble based on your views and a fusion algorithm
v_res = pyrea.view(pyrea.execute_ensemble([v1, v2], f), c_pre)

# The cluster solution can be obtained as follows
v_res.execute()
```

## Ensemble Structures
Complex structures can be built using Pyrea.

For example, examine the two structures below:

![Ensemble Structures](https://raw.githubusercontent.com/mdbloice/AugmentorFiles/master/Pyrea/parea.png)

We will demonstrate how to create deep and flexible ensemble structures using
the examples a) and b) from the image above.

### Example A
This ensemble consists of two sets of three views, which are clustered, fused,
and then once again combined in a second layer.

We create two ensembles, which represent the first layer of structure a) in
the image above:

```python
import pyrea
import numpy as np

# Clusterers:
hc1 = pyrea.clusterer('hierarchical', method='ward', n_clusters=2)
hc2 = pyrea.clusterer('hierarchical', method='complete', n_clusters=2)

# Fusion algorithm:
f = pyrea.fuser('disagreement')

# Create three random datasets
d1 = np.random.rand(100,10)
d2 = np.random.rand(100,10)
d3 = np.random.rand(100,10)

# Views for ensemble 1
v1 = pyrea.view(d1, hc1)
v2 = pyrea.view(d2, hc1)
v3 = pyrea.view(d3, hc1)

# Execute ensemble 1 and retrieve a new view, which is used later.
hc1_pre = pyrea.clusterer('hierarchical', method='ward', n_clusters=2, precomputed=True)
v_ensemble_1 = pyrea.view(pyrea.execute_ensemble([v1, v2, v3], f), hc1_pre)

# Views for ensemble 2
v4 = pyrea.view(d1, hc2)
v5 = pyrea.view(d2, hc2)
v6 = pyrea.view(d3, hc2)

# Execute our second ensemble, and retreive a new view:
hc2_pre = pyrea.clusterer('hierarchical', method='complete', n_clusters=2, precomputed=True)
v_ensemble_2 = pyrea.view(pyrea.execute_ensemble([v4, v5, v6], f), hc2_pre)

# Now we can execute a further ensemble, using the views generated from the
# two previous ensemble methods:
d_fuse  = pyrea.execute_ensemble([v_ensemble_1, v_ensemble_2], f)

# The returned distance matrix is now used as an input for the two clustering methods (hc1 and hc2)
v1_fuse = pyrea.view(d_fuse, hc1_pre)
v2_fuse = pyrea.view(d_fuse, hc2_pre)

# and the cluster solutions are combined
pyrea.consensus([v1_fuse.execute(), v2_fuse.execute()])
```

#### Helper Function
See the `parea_1()` helper function for a pre-built version of structure above.

### Example B
As for structure b) in the image above, this can implemented as follows:

```python
import pyrea
import numpy as np

# Clustering algorithms
c1 = pyrea.clusterer('hierarchical', method='ward', n_clusters=2)
c2 = pyrea.clusterer('hierarchical', method='complete', n_clusters=2)
c3 = pyrea.clusterer('hierarchical', method='single', n_clusters=2)

# Clustering algorithms (so it works with a precomputed distance matrix)
c1_pre = pyrea.clusterer('hierarchical', method='ward', n_clusters=2, precomputed=True)
c2_pre = pyrea.clusterer('hierarchical', method='complete', n_clusters=2, precomputed=True)
c3_pre = pyrea.clusterer('hierarchical', method='single', n_clusters=2, precomputed=True)

# Fusion algorithm
f = pyrea.fuser('disagreement')

# Create the views with the random data directly:
v1 = pyrea.view(np.random.rand(100,10), c1)
v2 = pyrea.view(np.random.rand(100,10), c2)
v3 = pyrea.view(np.random.rand(100,10), c3)

# Create the ensemble and define new views based on the returned disagreement matrix v_res
v_res  = pyrea.execute_ensemble([v1, v2, v3], f)
v1_res = pyrea.view(v_res, c1_pre)
v2_res = pyrea.view(v_res, c2_pre)
v3_res = pyrea.view(v_res, c3_pre)

# Get the final cluster solution
pyrea.consensus([v1_res.execute(), v2_res.execute(), v3_res.execute()])
```

#### Helper Function
See the `parea_2()` helper function for a pre-built version of structure above.

## Extensible
Pyrea has been designed to be extensible. It allows you to use Pyrea's data fusion techniques with custom clustering algorithms that can be loaded in to Pyrea at run-time.

By providing a `View` with a `ClusterMethod` object, it makes providing custom clustering algorithms uncomplicated. See [`Extending Pyrea`](https://pyrea.readthedocs.io/pyrea/extending.html#custom-clustering-algorithms) for details.

# Work In Progress and Future Work
Several features are currently work in progress, future updates will include
the features described in the sections below.

## HCfused Clustering Algorithm
A novel fusion technique, developed by one of the authors of this software
package, named HCfused, will be included soon in a future update.

## General Genetic Optimisation
The package will be extended to allow for any custom Pyrea structures to be optimised using a genetic algorithm.

# Compilation of HC Fused C++ Code
To use the HC Fused method you may need to compile the source code yourself if binaries are not available for your operating system. HC Fused has been implemented in C++, see the `HC_fused_cpp_opt6.cpp` source file for more details.

Pre-compiled binaries are available for Linux and have been tested using Linux only. The instructions below pertain to Linux only. For Windows please consult <https://docs.python.org/3.5/library/ctypes.html#loading-shared-libraries> and use a compiler such as MSVC or MinGW.

To compile HC Fused (and then create a shared library/dynamic library) execute the following on the command line:

```bash
$ clang++ -c -fPIC HC_fused_cpp_opt6.cpp -o HC_fused_cpp_opt6.o
```

and then create the `.so` file shared library file:

```bash
$ clang++ HC_fused_cpp_opt6.o -shared -o libhcfused.so
```

and finally place the `libhcfused.so` file in the root directory of the package's installation directory.

# Tests
Installation is tested using Python versions 3.8, 3.9, 3.10, and 3.11 on Ubuntu 20.04 LTS only. See the project's Actions for details. The package should also work using Python 3.6 and 3.7 on other operating systems, however.

# Miscellaneous
Logo made by Adobe Express Logo Maker: <https://www.adobe.com/express/create/logo>



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mdbloice/Pyrea",
    "name": "pyrea",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "multi-view,clustering,ensemble clustering",
    "author": "Marcus D. Bloice, Bastian Pfeifer",
    "author_email": "marcus.bloice@medunigraz.at",
    "download_url": "https://files.pythonhosted.org/packages/4c/6c/62c6a225ae328a82b5d893ba360c35203541f01f654767214a5b62d9df62/pyrea-1.0.10.tar.gz",
    "platform": null,
    "description": "# Pyrea\n\n<p align=\"center\">\n     <img src=\"https://raw.githubusercontent.com/mdbloice/AugmentorFiles/master/Pyrea/Pyrea-logos_transparent.png\" width=\"400\">\n</p>\n<p align=\"center\">\n     Multi-view clustering with flexible ensemble structures.\n</p>\n<p align=\"center\">\n     <a href=\"https://pypi.org/project/pyrea/\"><img src=\"https://img.shields.io/pypi/v/Pyrea\"></a>\n     <a href=\"https://github.com/mdbloice/Pyrea/blob/master/LICENSE\"><img src=\"https://img.shields.io/pypi/l/Pyrea\"></a>\n     <a href=\"https://github.com/mdbloice/Pyrea/actions/workflows/main.yml\"><img src=\"https://img.shields.io/pypi/pyversions/Pyrea\"></a>\n</p>\n<p align=\"center\">\n     <em>The name Pyrea is derived from the Greek word Parea, meaning a group of friends who gather to share experiences, values, and ideas.</em>\n</p>\n\n---\n\n## Installation\n\nInstall Pyrea using `pip`:\n\n```bash\npip install pyrea\n```\n\nThis will install the latest version of Pyrea from PyPI.\n\n## Demonstration Notebooks\nA demonstration of Pyrea's usage on the Nutrimouse dataset can be found in the following Jupyter notebook:\n\n- [Nutrimouse.ipynb](https://github.com/mdbloice/Pyrea/blob/master/notebooks/Nutrimouse.ipynb)\n\nIn this notebook, hierarchical and spectral clustering are performed on the Nutrimouse multi-view dataset, tuned using Pyrea's genetic algorithm functionality.\n\nMore notebooks will be added in due course.\n\n## Usage\nThe Pyrea software package is the accompanying software for our paper:\n\nPfeifer, B., Bloice, M.D., & Schimek, M.G. (2022). *Parea: multi-view ensemble clustering for cancer subtype discovery*. arXiv. <https://arxiv.org/abs/2209.15399>\n\nWhile Pyrea allows for flexible and custom architectures to be built, two structures are discussed specifically in the paper cited above, namely Parea 1 and Parea 2.\n\nBoth the structures, which are described in detail below as well as in the paper mentioned above, can be quickly generated and applied to your data using two helper functions, `parea_1()` and `parea_2()`, and can be quickly run as follows:\n\n```python\nimport pyrea\nimport numpy as np\n\n# Create sample data:\nd1 = np.random.rand(100,10)\nd2 = np.random.rand(100,10)\nd3 = np.random.rand(100,10)\n\ndata = [d1,d2, d3]\n\nlabels = pyrea.parea_2(data)\n```\n\nwhich executes Parea 2.\n\nDefault parameters are used which match those used in our experiments discussed in the paper referenced above. These default parameters can of course be overridden. As there are many combinations of parameters that could be used, a genetic algorithm can be utilised to find the optimum parameters, as shown in the next section.\n\n### Genetic Algorithm\n\nThe Parea 1 and Parea 2 structures can be optimised using a genetic algorithm in order to find the best combinations of clustering methods, fusion methods, and number of clusters.\n\nFor example, to find optimal parameters for Parea 2:\n\n```python\nimport pyrea\nfrom sklearn import datasets\n\nd1 = datasets.load_iris().data\nd2 = datasets.load_iris().data\nd3 = datasets.load_iris().data\n\ndata = [d1,d2,d3]\n\nparams = pyrea.parea_2_genetic(data, k_min=2, k_max=5)\n```\n\nwhere `k_min` and `k_max` refer to the minimum and maximum number of clusters to attempt for each layer, respectively.\n\nNote that `params` contains the optimal parameters found by the genetic algorithm. To get the labels, run `parea_2()` passing your data and these optimal parameters:\n\n```python\npyrea.parea_2(data, *params)\n```\n\nwhich will return the cluster labels for your data.\n\nAlso, you may choose to define the **final** number of clusters returned by the algorithm (but allowing it to optimise intermediate numbers of clusters) by defining `k_final`, e.g:\n\n```python\nparams = pyrea.parea_2_genetic(data, k_min=2, k_max=5, k_final=3)\n```\n\nand calling `pyrea_2()` as follows:\n\n```python\npyrea.parea_2(data, params, k_final=3)\n```\n\n#### Genetic Algorithm Update\n\nThe genetic algorithm functions now support arbitrary numbers of views, and the population and number of generations can now be adjusted. See [this notebook](https://github.com/mdbloice/Pyrea/blob/master/notebooks/Nutrimouse.ipynb) for a demonstration of this usage on the Nutrimouse dataset.\n\n### API\n\n**Please note that Pyrea is work in progress. The API may change from version\nto version and introduce breaking changes.**\n\nIn Pyrea, your data are organised in to views. A view consists of the data in\nthe form of a 2D matrix, and an associated clustering algorithm (a *clusterer*).\n\nTo create a view you must have some data, and a clusterer:\n\n```python\nimport pyrea\n\n# Create your data, which must be a 2-dimensional array/matrix.\nd = [[1,2,3],\n     [4,5,6],\n     [7,8,9]]\n\n# Create a clusterer\nc = pyrea.clusterer(\"hierarchical\", n_clusters=2, method='ward')\n\nv = pyrea.view(d, c)\n```\n\nYou now have a view `v`, containing the data `d` using the clustering algorithm\n`c`. Note that many views can share the same clusterer, or each view may have a\nunique clusterer.\n\nTo obtain the cluster solution the specified view can be executed\n\n```python\nv.execute()\n```\n\nThe clustering algorithm can be either 'spectral', 'hierarchical', 'dbscan', or 'optics'. See the documentation for a complete list of parameters that can be passed when creating a clusterer.\n\nAs this is a library for multi-view ensemble learning, you will normally have\nmultiple views.\n\nA fusion algorithm is therefore used to fuse the clusterings created from\nmultiple views. Therefore, our next step is to create a *fuser* object:\n\n```python\nf = pyrea.fuser('disagreement')\n```\n\nWith you fusion algorithm `f`, you can execute an *ensemble*. The ensemble is created with a set of views and a fusion algorithm,\nand its returned object (distance or affinity matrix) can again be specified as a view:\n\n```python\n# Create a new clusterer with precomputed=True\nc_pre = pyrea.clusterer(\"hierarchical\", n_clusters=2, method='ward', precomputed=True)\nv_res = pyrea.view(pyrea.execute_ensemble([v1, v2, v3], f), c_pre)\n```\n\nThis newly created view, `v_res` can subsequently be fed into another ensemble,\nallowing you to create stacked ensemble architectures, with high flexibility.\n\nA full example is shown below, using random data:\n\n```python\nimport pyrea\nimport numpy as np\n\n# Create two datasets with random values of 1000 samples and 100 features per sample.\nd1 = np.random.rand(1000,100)\nd2 = np.random.rand(1000,100)\n\n# Define the clustering algorithm(s) you want to use. In this case we used the same\n# algorithm for both views. By default n_clusters=2.\nc = pyrea.clusterer('hierarchical', n_clusters=2, method='ward')\n\n# Create the views using the data and the same clusterer\nv1 = pyrea.view(d1, c)\nv2 = pyrea.view(d2, c)\n\n# Create a fusion object\nf = pyrea.fuser('disagreement')\n\n# Specify a clustering algorithm (precomputed = True)\nc_pre = pyrea.clusterer(\"hierarchical\", n_clusters=2, method='ward', precomputed=True)\n# Execute an ensemble based on your views and a fusion algorithm\nv_res = pyrea.view(pyrea.execute_ensemble([v1, v2], f), c_pre)\n\n# The cluster solution can be obtained as follows\nv_res.execute()\n```\n\n## Ensemble Structures\nComplex structures can be built using Pyrea.\n\nFor example, examine the two structures below:\n\n![Ensemble Structures](https://raw.githubusercontent.com/mdbloice/AugmentorFiles/master/Pyrea/parea.png)\n\nWe will demonstrate how to create deep and flexible ensemble structures using\nthe examples a) and b) from the image above.\n\n### Example A\nThis ensemble consists of two sets of three views, which are clustered, fused,\nand then once again combined in a second layer.\n\nWe create two ensembles, which represent the first layer of structure a) in\nthe image above:\n\n```python\nimport pyrea\nimport numpy as np\n\n# Clusterers:\nhc1 = pyrea.clusterer('hierarchical', method='ward', n_clusters=2)\nhc2 = pyrea.clusterer('hierarchical', method='complete', n_clusters=2)\n\n# Fusion algorithm:\nf = pyrea.fuser('disagreement')\n\n# Create three random datasets\nd1 = np.random.rand(100,10)\nd2 = np.random.rand(100,10)\nd3 = np.random.rand(100,10)\n\n# Views for ensemble 1\nv1 = pyrea.view(d1, hc1)\nv2 = pyrea.view(d2, hc1)\nv3 = pyrea.view(d3, hc1)\n\n# Execute ensemble 1 and retrieve a new view, which is used later.\nhc1_pre = pyrea.clusterer('hierarchical', method='ward', n_clusters=2, precomputed=True)\nv_ensemble_1 = pyrea.view(pyrea.execute_ensemble([v1, v2, v3], f), hc1_pre)\n\n# Views for ensemble 2\nv4 = pyrea.view(d1, hc2)\nv5 = pyrea.view(d2, hc2)\nv6 = pyrea.view(d3, hc2)\n\n# Execute our second ensemble, and retreive a new view:\nhc2_pre = pyrea.clusterer('hierarchical', method='complete', n_clusters=2, precomputed=True)\nv_ensemble_2 = pyrea.view(pyrea.execute_ensemble([v4, v5, v6], f), hc2_pre)\n\n# Now we can execute a further ensemble, using the views generated from the\n# two previous ensemble methods:\nd_fuse  = pyrea.execute_ensemble([v_ensemble_1, v_ensemble_2], f)\n\n# The returned distance matrix is now used as an input for the two clustering methods (hc1 and hc2)\nv1_fuse = pyrea.view(d_fuse, hc1_pre)\nv2_fuse = pyrea.view(d_fuse, hc2_pre)\n\n# and the cluster solutions are combined\npyrea.consensus([v1_fuse.execute(), v2_fuse.execute()])\n```\n\n#### Helper Function\nSee the `parea_1()` helper function for a pre-built version of structure above.\n\n### Example B\nAs for structure b) in the image above, this can implemented as follows:\n\n```python\nimport pyrea\nimport numpy as np\n\n# Clustering algorithms\nc1 = pyrea.clusterer('hierarchical', method='ward', n_clusters=2)\nc2 = pyrea.clusterer('hierarchical', method='complete', n_clusters=2)\nc3 = pyrea.clusterer('hierarchical', method='single', n_clusters=2)\n\n# Clustering algorithms (so it works with a precomputed distance matrix)\nc1_pre = pyrea.clusterer('hierarchical', method='ward', n_clusters=2, precomputed=True)\nc2_pre = pyrea.clusterer('hierarchical', method='complete', n_clusters=2, precomputed=True)\nc3_pre = pyrea.clusterer('hierarchical', method='single', n_clusters=2, precomputed=True)\n\n# Fusion algorithm\nf = pyrea.fuser('disagreement')\n\n# Create the views with the random data directly:\nv1 = pyrea.view(np.random.rand(100,10), c1)\nv2 = pyrea.view(np.random.rand(100,10), c2)\nv3 = pyrea.view(np.random.rand(100,10), c3)\n\n# Create the ensemble and define new views based on the returned disagreement matrix v_res\nv_res  = pyrea.execute_ensemble([v1, v2, v3], f)\nv1_res = pyrea.view(v_res, c1_pre)\nv2_res = pyrea.view(v_res, c2_pre)\nv3_res = pyrea.view(v_res, c3_pre)\n\n# Get the final cluster solution\npyrea.consensus([v1_res.execute(), v2_res.execute(), v3_res.execute()])\n```\n\n#### Helper Function\nSee the `parea_2()` helper function for a pre-built version of structure above.\n\n## Extensible\nPyrea has been designed to be extensible. It allows you to use Pyrea's data fusion techniques with custom clustering algorithms that can be loaded in to Pyrea at run-time.\n\nBy providing a `View` with a `ClusterMethod` object, it makes providing custom clustering algorithms uncomplicated. See [`Extending Pyrea`](https://pyrea.readthedocs.io/pyrea/extending.html#custom-clustering-algorithms) for details.\n\n# Work In Progress and Future Work\nSeveral features are currently work in progress, future updates will include\nthe features described in the sections below.\n\n## HCfused Clustering Algorithm\nA novel fusion technique, developed by one of the authors of this software\npackage, named HCfused, will be included soon in a future update.\n\n## General Genetic Optimisation\nThe package will be extended to allow for any custom Pyrea structures to be optimised using a genetic algorithm.\n\n# Compilation of HC Fused C++ Code\nTo use the HC Fused method you may need to compile the source code yourself if binaries are not available for your operating system. HC Fused has been implemented in C++, see the `HC_fused_cpp_opt6.cpp` source file for more details.\n\nPre-compiled binaries are available for Linux and have been tested using Linux only. The instructions below pertain to Linux only. For Windows please consult <https://docs.python.org/3.5/library/ctypes.html#loading-shared-libraries> and use a compiler such as MSVC or MinGW.\n\nTo compile HC Fused (and then create a shared library/dynamic library) execute the following on the command line:\n\n```bash\n$ clang++ -c -fPIC HC_fused_cpp_opt6.cpp -o HC_fused_cpp_opt6.o\n```\n\nand then create the `.so` file shared library file:\n\n```bash\n$ clang++ HC_fused_cpp_opt6.o -shared -o libhcfused.so\n```\n\nand finally place the `libhcfused.so` file in the root directory of the package's installation directory.\n\n# Tests\nInstallation is tested using Python versions 3.8, 3.9, 3.10, and 3.11 on Ubuntu 20.04 LTS only. See the project's Actions for details. The package should also work using Python 3.6 and 3.7 on other operating systems, however.\n\n# Miscellaneous\nLogo made by Adobe Express Logo Maker: <https://www.adobe.com/express/create/logo>\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Multi-view clustering with deep ensemble structures.",
    "version": "1.0.10",
    "split_keywords": [
        "multi-view",
        "clustering",
        "ensemble clustering"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "413eb0ba3c5d054d52223b3a120fa262a64b31b73e220737fbabe4283fe7e1f2",
                "md5": "0ab965822d9442c8a374a5936eaa7d52",
                "sha256": "dbe70d831eae1f7429825775ea0df5a21b981cbd13b0399778617e9978e73999"
            },
            "downloads": -1,
            "filename": "pyrea-1.0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0ab965822d9442c8a374a5936eaa7d52",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 20534,
            "upload_time": "2023-04-19T13:49:32",
            "upload_time_iso_8601": "2023-04-19T13:49:32.730244Z",
            "url": "https://files.pythonhosted.org/packages/41/3e/b0ba3c5d054d52223b3a120fa262a64b31b73e220737fbabe4283fe7e1f2/pyrea-1.0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4c6c62c6a225ae328a82b5d893ba360c35203541f01f654767214a5b62d9df62",
                "md5": "fc306679533dafffac7978a3a1bfd154",
                "sha256": "4f12f36f28a3a2a9a82f1b78da719207f514cfbb2cfbb04556e43d1a7a68485b"
            },
            "downloads": -1,
            "filename": "pyrea-1.0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "fc306679533dafffac7978a3a1bfd154",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 23904,
            "upload_time": "2023-04-19T13:49:34",
            "upload_time_iso_8601": "2023-04-19T13:49:34.927982Z",
            "url": "https://files.pythonhosted.org/packages/4c/6c/62c6a225ae328a82b5d893ba360c35203541f01f654767214a5b62d9df62/pyrea-1.0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-19 13:49:34",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "mdbloice",
    "github_project": "Pyrea",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pyrea"
}
        
Elapsed time: 0.06967s