Skip to content

Commit

Permalink
appveyor.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
gagolews committed Jul 18, 2020
1 parent 0dfd591 commit 0b25a9f
Show file tree
Hide file tree
Showing 24 changed files with 78 additions and 71 deletions.
22 changes: 12 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,30 +125,26 @@ https://genieclust.gagolewski.com/.
Installation
------------

*This package is in beta-stage (development and testing is currently
Linux-only).*

Python Version
~~~~~~~~~~~~~~

PyPI
^^^^

**TODO** To install via ``pip`` (the current version is a little
outdated, see `PyPI <https://pypi.org/project/genieclust/>`__):
To install via ``pip`` (see `PyPI <https://pypi.org/project/genieclust/>`_):

.. code:: bash
pip3 install genieclust --user # or sudo pip3 install genieclust
pip3 install genieclust
**TODO**: Windows builds

**TODO**: OS X builds
The package requires Python 3.6+ together with ``cython`` as well as
``numpy``, ``scipy``, ``matplotlib``, and ``sklearn``. Optional
dependencies: ``mlpack`` and ``nmslib``.



Development Version
^^^^^^^^^^^^^^^^^^^

Expand All @@ -168,9 +164,15 @@ R Version
CRAN
^^^^

**TODO**: CRAN
To install the most recent release, call:

.. code:: r
install.packages("genieclust")
See the package entry on `CRAN <https://cran.r-project.org/web/packages/genieclust/>`_.

.. _development-version-1:

Development Version
^^^^^^^^^^^^^^^^^^^
Expand Down
9 changes: 0 additions & 9 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,6 @@ environment:
PYTHON_VERSION: "3.5"
PYTHON_ARCH: "64"

- PYTHON: "C:\\Python34"
PYTHON_VERSION: "3.4"
PYTHON_ARCH: "32"
PARALLEL: ""

- PYTHON: "C:\\Python34-x64"
PYTHON_VERSION: "3.4"
PYTHON_ARCH: "64"
PARALLEL: ""

clone_depth: 5

Expand Down
8 changes: 5 additions & 3 deletions devel/sphinx/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ R's interface is compatible with ``hclust()``, but there is more.
# or genie(X, k=2)
The `genieclust` package is available for Python (**TODO**: PyPI--link, how to install)
and R (**TODO**: CRAN--link, how to install). Its source code is distributed
The `genieclust` package is available for Python (via
`PyPI <https://pypi.org/project/genieclust/>`_\ )
and R (on `CRAN <https://cran.r-project.org/web/packages/genieclust/>`_\ ).
Its source code is distributed
under the open source GNU AGPL v3 license and can be downloaded from
`https://github.com/gagolews/genieclust <https://github.com/gagolews/genieclust>`_.
`GitHub <https://github.com/gagolews/genieclust>`_.
Note that the core functionality is implemented in the form of a header-only C++
library, hence it might be relatively easily adapted to new environments.

Expand Down
1 change: 1 addition & 0 deletions devel/sphinx/rmd/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ with the true corresponding partition (by an expert).

.. code:: python
# see https://github.com/gagolews/genieclust/tree/master/devel/sphinx/rmd
dataset = "jain"
# Load an example 2D dataset:
X = np.loadtxt("%s.data.gz" % dataset, ndmin=2)
Expand Down
1 change: 1 addition & 0 deletions devel/sphinx/rmd/basics.rstw
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ Let's load an example benchmark set, ``jain`` [2]_, which comes along
with the true corresponding partition (by an expert).

<<basics-load>>=
# see https://github.com/gagolews/genieclust/tree/master/devel/sphinx/rmd
dataset = "jain"
# Load an example 2D dataset:
X = np.loadtxt("%s.data.gz" % dataset, ndmin=2)
Expand Down
1 change: 1 addition & 0 deletions devel/sphinx/rmd/string.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ We'll use one of the benchmark datasets mentioned in [1]_ as an example:

.. code:: python
# see https://github.com/gagolews/genieclust/tree/master/devel/sphinx/rmd
strings = np.loadtxt("actg1.data.gz", dtype=np.str).tolist()
strings[:5] # preview
Expand Down
1 change: 1 addition & 0 deletions devel/sphinx/rmd/string.rstw
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ np.set_printoptions(precision=3, threshold=50, edgeitems=50)
We'll use one of the benchmark datasets mentioned in [1]_ as an example:

<<string-example-strings>>=
# see https://github.com/gagolews/genieclust/tree/master/devel/sphinx/rmd
strings = np.loadtxt("actg1.data.gz", dtype=np.str).tolist()
strings[:5] # preview
@
Expand Down
8 changes: 5 additions & 3 deletions docs/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ R's interface is compatible with ``hclust()``, but there is more.
# or genie(X, k=2)
The `genieclust` package is available for Python (**TODO**: PyPI--link, how to install)
and R (**TODO**: CRAN--link, how to install). Its source code is distributed
The `genieclust` package is available for Python (via
`PyPI <https://pypi.org/project/genieclust/>`_\ )
and R (on `CRAN <https://cran.r-project.org/web/packages/genieclust/>`_\ ).
Its source code is distributed
under the open source GNU AGPL v3 license and can be downloaded from
`https://github.com/gagolews/genieclust <https://github.com/gagolews/genieclust>`_.
`GitHub <https://github.com/gagolews/genieclust>`_.
Note that the core functionality is implemented in the form of a header-only C++
library, hence it might be relatively easily adapted to new environments.

Expand Down
1 change: 1 addition & 0 deletions docs/_sources/rmd/basics.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ with the true corresponding partition (by an expert).

.. code:: python
# see https://github.com/gagolews/genieclust/tree/master/devel/sphinx/rmd
dataset = "jain"
# Load an example 2D dataset:
X = np.loadtxt("%s.data.gz" % dataset, ndmin=2)
Expand Down
1 change: 1 addition & 0 deletions docs/_sources/rmd/string.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ We'll use one of the benchmark datasets mentioned in [1]_ as an example:

.. code:: python
# see https://github.com/gagolews/genieclust/tree/master/devel/sphinx/rmd
strings = np.loadtxt("actg1.data.gz", dtype=np.str).tolist()
strings[:5] # preview
Expand Down
Binary file modified docs/genieclust_plots-1.pdf
Binary file not shown.
Binary file modified docs/genieclust_plots-2.pdf
Binary file not shown.
Binary file modified docs/genieclust_plots-3.pdf
Binary file not shown.
Binary file modified docs/genieclust_plots-4.pdf
Binary file not shown.
8 changes: 5 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,12 @@ <h1><cite>genieclust</cite>: Fast and Robust Hierarchical Clustering with Noise
<span class="c1"># or genie(X, k=2)</span>
</pre></div>
</div>
<p>The <cite>genieclust</cite> package is available for Python (<strong>TODO</strong>: PyPI–link, how to install)
and R (<strong>TODO</strong>: CRAN–link, how to install). Its source code is distributed
<p>The <cite>genieclust</cite> package is available for Python (via
<a class="reference external" href="https://pypi.org/project/genieclust/">PyPI</a>)
and R (on <a class="reference external" href="https://cran.r-project.org/web/packages/genieclust/">CRAN</a>).
Its source code is distributed
under the open source GNU AGPL v3 license and can be downloaded from
<a class="reference external" href="https://github.com/gagolews/genieclust">https://github.com/gagolews/genieclust</a>.
<a class="reference external" href="https://github.com/gagolews/genieclust">GitHub</a>.
Note that the core functionality is implemented in the form of a header-only C++
library, hence it might be relatively easily adapted to new environments.</p>
<div class="toctree-wrapper compound">
Expand Down
14 changes: 7 additions & 7 deletions docs/r.html
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ <h3>References<a class="headerlink" href="#references" title="Permalink to this
</div>
<div class="section" id="examples">
<h3>Examples<a class="headerlink" href="#examples" title="Permalink to this headline"></a></h3>
<div class="highlight-r notranslate"><div class="highlight"><pre><span></span><span class="n">y_true</span> <span class="o">&lt;-</span> <span class="n">iris[[5]]</span>
<span class="n">y_pred</span> <span class="o">&lt;-</span> <span class="nf">kmeans</span><span class="p">(</span><span class="nf">as.matrix</span><span class="p">(</span><span class="n">iris[1</span><span class="o">:</span><span class="m">4</span><span class="n">]</span><span class="p">),</span> <span class="m">3</span><span class="p">)</span><span class="o">$</span><span class="n">cluster</span>
<div class="highlight-r notranslate"><div class="highlight"><pre><span></span><span class="n">y_true</span> <span class="o">&lt;-</span> <span class="n">iris</span><span class="p">[[</span><span class="m">5</span><span class="p">]]</span>
<span class="n">y_pred</span> <span class="o">&lt;-</span> <span class="nf">kmeans</span><span class="p">(</span><span class="nf">as.matrix</span><span class="p">(</span><span class="n">iris</span><span class="p">[</span><span class="m">1</span><span class="o">:</span><span class="m">4</span><span class="p">]),</span> <span class="m">3</span><span class="p">)</span><span class="o">$</span><span class="n">cluster</span>
<span class="nf">adjusted_rand_score</span><span class="p">(</span><span class="n">y_true</span><span class="p">,</span> <span class="n">y_pred</span><span class="p">)</span>
<span class="nf">rand_score</span><span class="p">(</span><span class="nf">table</span><span class="p">(</span><span class="n">y_true</span><span class="p">,</span> <span class="n">y_pred</span><span class="p">))</span> <span class="c1"># the same</span>
<span class="nf">adjusted_fm_score</span><span class="p">(</span><span class="n">y_true</span><span class="p">,</span> <span class="n">y_pred</span><span class="p">)</span>
Expand Down Expand Up @@ -639,12 +639,12 @@ <h3>Seealso<a class="headerlink" href="#seealso" title="Permalink to this headli
<span id="id13"></span><h3>Examples<a class="headerlink" href="#examples-1" title="Permalink to this headline"></a></h3>
<div class="highlight-r notranslate"><div class="highlight"><pre><span></span><span class="nf">library</span><span class="p">(</span><span class="s">&quot;datasets&quot;</span><span class="p">)</span>
<span class="nf">data</span><span class="p">(</span><span class="s">&quot;iris&quot;</span><span class="p">)</span>
<span class="n">X</span> <span class="o">&lt;-</span> <span class="n">iris[1</span><span class="o">:</span><span class="m">4</span><span class="n">]</span>
<span class="n">X</span> <span class="o">&lt;-</span> <span class="n">iris</span><span class="p">[</span><span class="m">1</span><span class="o">:</span><span class="m">4</span><span class="p">]</span>
<span class="n">h</span> <span class="o">&lt;-</span> <span class="nf">gclust</span><span class="p">(</span><span class="n">X</span><span class="p">)</span>
<span class="n">y_pred</span> <span class="o">&lt;-</span> <span class="nf">cutree</span><span class="p">(</span><span class="n">h</span><span class="p">,</span> <span class="m">3</span><span class="p">)</span>
<span class="n">y_test</span> <span class="o">&lt;-</span> <span class="n">iris[</span><span class="p">,</span><span class="m">5</span><span class="n">]</span>
<span class="nf">plot</span><span class="p">(</span><span class="n">iris[</span><span class="p">,</span><span class="m">2</span><span class="n">]</span><span class="p">,</span> <span class="n">iris[</span><span class="p">,</span><span class="m">3</span><span class="n">]</span><span class="p">,</span> <span class="n">col</span><span class="o">=</span><span class="n">y_pred</span><span class="p">,</span>
<span class="n">pch</span><span class="o">=</span><span class="nf">as.integer</span><span class="p">(</span><span class="n">iris[</span><span class="p">,</span><span class="m">5</span><span class="n">]</span><span class="p">),</span> <span class="n">asp</span><span class="o">=</span><span class="m">1</span><span class="p">,</span> <span class="n">las</span><span class="o">=</span><span class="m">1</span><span class="p">)</span>
<span class="n">y_test</span> <span class="o">&lt;-</span> <span class="n">iris</span><span class="p">[,</span><span class="m">5</span><span class="p">]</span>
<span class="nf">plot</span><span class="p">(</span><span class="n">iris</span><span class="p">[,</span><span class="m">2</span><span class="p">],</span> <span class="n">iris</span><span class="p">[,</span><span class="m">3</span><span class="p">],</span> <span class="n">col</span><span class="o">=</span><span class="n">y_pred</span><span class="p">,</span>
<span class="n">pch</span><span class="o">=</span><span class="nf">as.integer</span><span class="p">(</span><span class="n">iris</span><span class="p">[,</span><span class="m">5</span><span class="p">]),</span> <span class="n">asp</span><span class="o">=</span><span class="m">1</span><span class="p">,</span> <span class="n">las</span><span class="o">=</span><span class="m">1</span><span class="p">)</span>
<span class="nf">adjusted_rand_score</span><span class="p">(</span><span class="n">y_test</span><span class="p">,</span> <span class="n">y_pred</span><span class="p">)</span>
<span class="nf">pair_sets_index</span><span class="p">(</span><span class="n">y_test</span><span class="p">,</span> <span class="n">y_pred</span><span class="p">)</span>

Expand Down Expand Up @@ -891,7 +891,7 @@ <h2>mst<a class="headerlink" href="#mst" title="Permalink to this headline">¶</
<span id="id29"></span><h3>Examples<a class="headerlink" href="#examples-3" title="Permalink to this headline"></a></h3>
<div class="highlight-r notranslate"><div class="highlight"><pre><span></span><span class="nf">library</span><span class="p">(</span><span class="s">&quot;datasets&quot;</span><span class="p">)</span>
<span class="nf">data</span><span class="p">(</span><span class="s">&quot;iris&quot;</span><span class="p">)</span>
<span class="n">X</span> <span class="o">&lt;-</span> <span class="n">iris[1</span><span class="o">:</span><span class="m">4</span><span class="n">]</span>
<span class="n">X</span> <span class="o">&lt;-</span> <span class="n">iris</span><span class="p">[</span><span class="m">1</span><span class="o">:</span><span class="m">4</span><span class="p">]</span>
<span class="n">tree</span> <span class="o">&lt;-</span> <span class="nf">mst</span><span class="p">(</span><span class="n">X</span><span class="p">)</span>
</pre></div>
</div>
Expand Down
15 changes: 8 additions & 7 deletions docs/rmd/basics.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,17 +197,18 @@ <h1>Basics<a class="headerlink" href="#basics" title="Permalink to this headline
and <a class="reference internal" href="timings.html"><span class="doc">speed</span></a>.</p>
<p>Here are a few examples of basic interactions with the Python version
of the <cite>genieclust</cite> package.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">numpy</span> <span class="kn">as</span> <span class="nn">np</span>
<span class="kn">import</span> <span class="nn">pandas</span> <span class="kn">as</span> <span class="nn">pd</span>
<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="kn">as</span> <span class="nn">plt</span>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span>
<span class="kn">import</span> <span class="nn">genieclust</span>
</pre></div>
</div>
<div class="section" id="breaking-the-ice">
<h2>Breaking the Ice<a class="headerlink" href="#breaking-the-ice" title="Permalink to this headline"></a></h2>
<p>Let’s load an example benchmark set, <code class="docutils literal notranslate"><span class="pre">jain</span></code> <a class="footnote-reference brackets" href="#id7" id="id2">2</a>, which comes along
with the true corresponding partition (by an expert).</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">dataset</span> <span class="o">=</span> <span class="s2">&quot;jain&quot;</span>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># see https://github.com/gagolews/genieclust/tree/master/devel/sphinx/rmd</span>
<span class="n">dataset</span> <span class="o">=</span> <span class="s2">&quot;jain&quot;</span>
<span class="c1"># Load an example 2D dataset:</span>
<span class="n">X</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">loadtxt</span><span class="p">(</span><span class="s2">&quot;</span><span class="si">%s</span><span class="s2">.data.gz&quot;</span> <span class="o">%</span> <span class="n">dataset</span><span class="p">,</span> <span class="n">ndmin</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>

Expand Down Expand Up @@ -237,7 +238,7 @@ <h2>Breaking the Ice<a class="headerlink" href="#breaking-the-ice" title="Permal
In particular, an object of class <cite>Genie</cite> is equipped with the
<cite>fit</cite> and <cite>fit_predict</cite> methods.</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="n">g</span> <span class="o">=</span> <span class="n">genieclust</span><span class="o">.</span><span class="n">Genie</span><span class="p">(</span><span class="n">n_clusters</span><span class="o">=</span><span class="n">n_clusters</span><span class="p">)</span>
<span class="k">print</span><span class="p">(</span><span class="n">g</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="n">g</span><span class="p">)</span>
</pre></div>
</div>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Genie</span><span class="p">()</span>
Expand Down Expand Up @@ -406,11 +407,11 @@ <h2>A Comparison with HDBSCAN*<a class="headerlink" href="#a-comparison-with-hdb
<h2>Dendrograms<a class="headerlink" href="#dendrograms" title="Permalink to this headline"></a></h2>
<p>Plotting of dendrograms is possible with <cite>scipy.cluster.hierarchy</cite>:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">scipy.cluster.hierarchy</span>
<span class="n">g</span> <span class="o">=</span> <span class="n">genieclust</span><span class="o">.</span><span class="n">Genie</span><span class="p">(</span><span class="n">compute_full_tree</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
<span class="n">g</span> <span class="o">=</span> <span class="n">genieclust</span><span class="o">.</span><span class="n">Genie</span><span class="p">(</span><span class="n">compute_full_tree</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">g</span><span class="o">.</span><span class="n">fit</span><span class="p">(</span><span class="n">X</span><span class="p">)</span>
<span class="n">linkage_matrix</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">column_stack</span><span class="p">([</span><span class="n">g</span><span class="o">.</span><span class="n">children_</span><span class="p">,</span> <span class="n">g</span><span class="o">.</span><span class="n">distances_</span><span class="p">,</span> <span class="n">g</span><span class="o">.</span><span class="n">counts_</span><span class="p">])</span>
<span class="n">scipy</span><span class="o">.</span><span class="n">cluster</span><span class="o">.</span><span class="n">hierarchy</span><span class="o">.</span><span class="n">dendrogram</span><span class="p">(</span><span class="n">linkage_matrix</span><span class="p">,</span>
<span class="n">show_leaf_counts</span><span class="o">=</span><span class="bp">False</span><span class="p">,</span> <span class="n">no_labels</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
<span class="n">show_leaf_counts</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">no_labels</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">plt</span><span class="o">.</span><span class="n">show</span><span class="p">()</span>
</pre></div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions docs/rmd/noise.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,9 @@

<div class="section" id="clustering-with-noise-points-detection">
<h1>Clustering with Noise Points Detection<a class="headerlink" href="#clustering-with-noise-points-detection" title="Permalink to this headline"></a></h1>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">numpy</span> <span class="kn">as</span> <span class="nn">np</span>
<span class="kn">import</span> <span class="nn">pandas</span> <span class="kn">as</span> <span class="nn">pd</span>
<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="kn">as</span> <span class="nn">plt</span>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">import</span> <span class="nn">pandas</span> <span class="k">as</span> <span class="nn">pd</span>
<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span>
<span class="kn">import</span> <span class="nn">genieclust</span>
</pre></div>
</div>
Expand Down
Loading

0 comments on commit 0b25a9f

Please sign in to comment.