Coder Social home page Coder Social logo

jianglst / catlearn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from suncat-center/catlearn

0.0 1.0 1.0 91.27 MB

A machine learning environment for atomic-scale modeling in surface science and catalysis.

Home Page: http://catlearn.readthedocs.io/

License: GNU General Public License v3.0

Dockerfile 0.06% Jupyter Notebook 70.07% Python 29.86% Shell 0.01%

catlearn's Introduction

CatLearn

An environment for atomistic machine learning in Python for applications in catalysis.

DOI Build Status Coverage Status Documentation Status PyPI version License: GPL v3

Utilities for building and testing atomic machine learning models. Gaussian Processes (GP) regression machine learning routines are implemented. These will take any numpy array of training and test feature matrices along with a vector of target values.

In general, any data prepared in this fashion can be fed to the GP routines, a number of additional functions have been added that interface with ASE. This integration allows for the manipulation of atoms objects through GP predictions, as well as dynamic generation of descriptors through use of the many ASE functions.

Please see the tutorials for a detailed overview of what the code can do and the conventions used in setting up the predictive models. For an overview of all the functionality available, please read the documentation.

Table of contents

Installation

(Back to top)

The easiest way to install the code is with:

$ pip install catlearn

This will automatically install the code as well as the dependencies. Alternatively, you can clone the repository to a local directory with:

$ git clone https://github.com/SUNCAT-Center/CatLearn.git

And then put the <install_dir>/ into your $PYTHONPATH environment variable.

Be sure to install dependencies in with:

$ pip install -r requirements.txt

Docker

To use the docker image, it is necessary to have docker installed and running. After cloning the project, build and run the image as follows:

$ docker build -t catlearn .

Then it is possible to use the image in two ways. It is possible to run the docker image as a bash environment in which CatLearn can be used will all dependencies in place.

$ docker run -it catlearn bash

Or python can be run from the docker image.

$ docker run -it catlearn python2 [file.py]
$ docker run -it catlearn python3 [file.py]

Use Ctrl + d to exit the docker image when done.

Optional Dependencies

The tutorial scripts will generally output some graphical representations of the results etc. For these scripts, it is advisable to have at least matplotlib installed:

$ pip install matplotlib seaborn

Usage

(Back to top)

In the most basic form, it is possible to set up a GP model and make some predictions using the following lines of code:

import numpy as np
from catlearn.regression import GaussianProcess

# Define some input data.
train_features = np.arange(200).reshape(50, 4)
target = np.random.random_sample((50,))
test_features = np.arange(100).reshape(25, 4)

# Setup the kernel.
kernel = [{'type': 'gaussian', 'width': 0.5}]

# Train the GP model.
gp = GaussianProcess(kernel_list=kernel, regularization=1e-3,
                     train_fp=train_features, train_target=target,
                     optimize_hyperparameters=True)

# Get the predictions.
prediction = gp.predict(test_fp=test_features)

Tutorials

(Back to top)

The above sample of code will train a GP with the squared exponential kernel, fitting some random function. Of course, this isn't so useful, more helpful examples and test scripts are present for most features; primarily, please see the tutorials.

Functionality

(Back to top)

There is much functionality in CatLearn to assist in handling atom data and building optimal models. This includes:

  • API to other codes:
  • Fingerprint generators:
    • Bulk systems
    • Support/slab systems
    • Discrete systems
  • Preprocessing routines:
    • Data cleaning
    • Feature elimination
    • Feature engineering
    • Feature extraction
    • Feature scaling
  • Regression methods:
    • Regularized ridge regression
    • Gaussian processes regression
  • Cross-validation:
    • K-fold cv
    • Ensemble k-fold cv
  • Machine Learning Algorithms
    • Machine Learning Nudged Elastic Band (ML-NEB) algorithm.
  • General utilities:
    • K-means clustering
    • Neighborlist generators
    • Penalty functions
    • SQLite db storage

Contribution

(Back to top)

Anyone is welcome to contribute to the project. Please see the contribution guide for help setting up a local copy of the code. There are some TODO items in the README files for the various modules that give suggestions on parts of the code that could be improved.

catlearn's People

Contributors

pcjennings avatar mhangaard avatar jagarridotorres avatar doylead avatar raulf2012 avatar ziyun-wang avatar graph-theory-natcatal avatar mhoffman avatar schlexer avatar mamunm avatar

Watchers

James Cloos avatar

Forkers

springlau

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.