semvec/pypi-packages huggingface dataset:
gblearn 0.4.1
Machine learning grain boundary properties and structure.

``gblearn``: Machine Learning for Grain Boundaries
==================================================

`API Documentation <https://rosenbrockc.github.io/gblearn/index.html>`__
|Build Status|

Recently, we proposed a universal descriptor for grain boundaries that
has desirable mathematical properties, and which can be applied to
arbitrary grain boundaries. Using this descriptor, we were able to
create a feature matrix for machine learning based on the local atomic
environments present at the grain boundary. In addition to being useful
for predicting grain boundary energy and mobility, the method also
allows important atomic environments to be discovered for each of the
properties.

If you use this package, please cite the paper:

::

       @article{Rosenbrock:2017vd,
       author = {Rosenbrock, Conrad W and Homer, Eric R and Csanyi, G{\'a}bor and Hart, Gus L W},
       title = {{Discovering the building blocks of atomic systems using machine learning: application to grain boundaries}},
       journal = {npj Computational Materials},
       year = {2017},
       volume = {3},
       number = {1},
       pages = {29}
       }

You can generate the Local Environment Representation for the Olmsted
dataset using the following code. It assumes that all the Olmsted [1]
dump files from LAMMPS are in ``/dbs/olmsted``. We tell the framework to
store all representations in the ``/gbs/olmsted`` folder.

.. code:: python

      # Load the perfect FCC as a seed so the LER can be constructed.
      # It assumes the the seed file is found at /seeds/"Ni.pissnnl_seed.txt"
      seed = np.loadtxt("/seeds/Ni.pissnnl_seed.txt")

      from gblearn.gb import GrainBoundaryCollection as GBC
      olmsted = GBC("olmsted", "/dbs/olmsted", "/gbs/olmsted",
            r"ni.p(?P<gbid>\d+).out", seed=seed, padding=6.50)

      # We explicitly call :meth:`load` to parse the GB files. Then, construct
      # the SOAP representation for each GB.
      # As part of the load function, we call it with Z=28 for the nickel database,
      # and also give it a method and pattern to use
      olmsted.load(Z=28, method="cna", pattr="c_cna")

      # Calculate the SOAP representation.
      # The SOAP representation includes padding around the boundary atoms, so
      # that each atom in the GB has a full `rcut` of atoms around it.
      # The "meth: 'soap' auto trims those atoms that don't have full environments.
      olmsted.soap(rcut=3.25, lmax=12, nmax=12, sigma=0.5)

      #Now, we can finally construct the LER.
      olmsted.LER(0.0025)

References
----------

[1]: Olmsted, D. L., Foiles, S. M. & Holm, E. A. Survey of computed
grain boundary properties in face-centered cubic metals: I. Grain
boundary energy. Acta Mater. 57, 3694–3703 (2009).

.. |Build Status| image:: https://travis-ci.org/rosenbrockc/gblearn.svg?branch=master
   :target: https://travis-ci.org/rosenbrockc/gblearn
biterm 0.1.5
Biterm Topic Model

# Biterm Topic Model

This is a simple Python implementation of the awesome
[Biterm Topic Model](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.402.4032&rep=rep1&type=pdf).
This model is accurate in short text classification.
It explicitly models the word co-occurrence patterns in the whole corpus to solve the problem of sparse word co-occurrence at document-level.

Simply install by:
```
pip install biterm
```

Load some short texts and vectorize them via sklearn.

```python
    from sklearn.feature_extraction.text import CountVectorizer

    texts = open('./data/reuters.titles').read().splitlines()[:50]
    vec = CountVectorizer(stop_words='english')
    X = vec.fit_transform(texts).toarray()
```
Get the vocabulary and the biterms from the texts.
```python
    from biterm.utility import vec_to_biterms

    vocab = np.array(vec.get_feature_names())
    biterms = vec_to_biterms(X)
```
Create a BTM and pass the biterms to train it.
```python
    from biterm.cbtm import oBTM

    btm = oBTM(num_topics=20, V=vocab)
    topics = btm.fit_transform(biterms, iterations=100)
```
Save a topic plot using pyLDAvis and explore the results! (also see *simple_btml.py*)
```python
    from biterm.btm import oBTM

    btm = oBTM(num_topics=20, V=vocab)
    topics = btm.fit_transform(biterms, iterations=100)
```
![pyLDAvis Visualization](https://github.com/markoarnauto/biterm/blob/master/vis/simple_btm.png)

Inference is done with Gibbs Sampling and it's not really fast. The implementation is not meant for production.
But if you have to classify a lot of texts you can try using online learning. Use the Cython version to speed up performance a bit.
```python
import numpy as np
import pyLDAvis
from biterm.cbtm import oBTM 
from sklearn.feature_extraction.text import CountVectorizer
from biterm.utility import vec_to_biterms, topic_summuary # helper functions

if __name__ == "__main__":

    texts = open('./data/reuters.titles').read().splitlines()

    # vectorize texts
    vec = CountVectorizer(stop_words='english')
    X = vec.fit_transform(texts).toarray()

    # get vocabulary
    vocab = np.array(vec.get_feature_names())

    # get biterms
    biterms = vec_to_biterms(X)

    # create btm
    btm = oBTM(num_topics=20, V=vocab)

    print("\n\n Train Online BTM ..")
    for i in range(0, len(biterms), 100): # prozess chunk of 200 texts
        biterms_chunk = biterms[i:i + 100]
        btm.fit(biterms_chunk, iterations=50)
    topics = btm.transform(biterms)

    print("\n\n Visualize Topics ..")
    vis = pyLDAvis.prepare(btm.phi_wz.T, topics, np.count_nonzero(X, axis=1), vocab, np.sum(X, axis=0))
    pyLDAvis.save_html(vis, './vis/online_btm.html')

    print("\n\n Topic coherence ..")
    topic_summuary(btm.phi_wz.T, X, vocab, 10)

    print("\n\n Texts & Topics ..")
    for i in range(len(texts)):
        print("{} (topic: {})".format(texts[i], topics[i].argmax()))
```
app-rim 0.0.1
Application Runtime Image Manager

# app-rim
Application Runtime Image Managerc - python module enabling to manage
( backup , restore, organize ) files that get created durring usage 
of applications in users profile dir. This module primarly targets 
linux environments, it may work in other setups. Support for thoose 
might be added in future

## Background

In linux each system user is associated with user profile dir. Next
when a user uses an application like dropbox ( or others ) a subdir
in profile is created named ".dropbox" and it stores the user 
configuration of application as well as logs or other stuff app
needs to work properly. 

## Goal

This project aims to build a python module that will allow the 
following:

1) Create a tar archive of application configuration ( accounting for 
diffrent location of this files ie. ".config", ".local/share" ). 
2) allow restoration from backup stored in a globally defined backup 
dir
3) Provide the means to reconfigure existing application files into 
  directory hierarchy that is more compatible with xdg definition
  ( configuration files go into .config temporary, files go into  
    .cache, logs go into var/log, others go into .local/share )

4) Provied means to detec what applications have been used by user
   based on what configuration files have been created ( carefully 
   crafting a list of known non aplication dirs ie. 
   .loca/share/application )