Skip to main content

No project description provided

Project description

osprey is an easy-to-use tool for hyperparameter optimization for machine learning algorithms in python using scikit-learn (or using scikit-learn compatible APIs).

Each osprey experiment combines an dataset, an estimator, a search space (and engine), cross validation and asynchronous serialization for distributed parallel optimization of model hyperparameters.

Documentation

For full documentation, please visit the Osprey homepage.

Installation

If you have an Anaconda Python distribution, installation is as easy as:

$ conda install -c omnia osprey

You can also install with pip:

$ pip install git+git://github.com/pandegroup/osprey.git

Alternatively, you can install directly from this GitHub repo:

$ git clone https://github.com/msmbuilder/osprey.git
$ cd osprey && python setup.py install

Example using MSMBuilder

Below is an example of an osprey config file to cross validate Markov state models based on varying the number of clusters and dihedral angles used in a model:

estimator:
  eval_scope: msmbuilder
  eval: |
    Pipeline([
        ('featurizer', DihedralFeaturizer(types=['phi', 'psi'])),
        ('cluster', MiniBatchKMeans()),
        ('msm', MarkovStateModel(n_timescales=5, verbose=False)),
    ])

search_space:
  cluster__n_clusters:
    min: 10
    max: 100
    type: int
  featurizer__types:
    choices:
      - ['phi', 'psi']
      - ['phi', 'psi', 'chi1']
   type: enum

cv: 5

dataset_loader:
  name: mdtraj
  params:
    trajectories: ~/local/msmbuilder/Tutorial/XTC/*/*.xtc
    topology: ~/local/msmbuilder/Tutorial/native.pdb
    stride: 1

trials:
    uri: sqlite:///osprey-trials.db

Then run osprey worker. You can run multiple parallel instances of osprey worker simultaneously on a cluster too.

$ osprey worker config.yaml

...

----------------------------------------------------------------------
Beginning iteration                                              1 / 1
----------------------------------------------------------------------
History contains: 0 trials
Choosing next hyperparameters with random...
  {'cluster__n_clusters': 20, 'featurizer__types': ['phi', 'psi']}

Fitting 5 folds for each of 1 candidates, totalling 5 fits
[Parallel(n_jobs=1)]: Done   1 jobs       | elapsed:    0.3s
[Parallel(n_jobs=1)]: Done   5 out of   5 | elapsed:    1.8s finished
---------------------------------
Success! Model score = 4.080646
(best score so far   = 4.080646)
---------------------------------

1/1 models fit successfully.
time:         October 27, 2014 10:44 PM
elapsed:      4 seconds.
osprey worker exiting.

You can dump the database to JSON or CSV with osprey dump.

Dependencies

  • six

  • pyyaml

  • numpy

  • scikit-learn

  • sqlalchemy

  • GPy (optional, required for gp strategy)

  • scipy (optional, required for gp strategy)

  • hyperopt (optional, required for hyperopt_tpe strategy)

  • nose (optional, for testing)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

osprey-1.0.0.tar.gz (37.0 kB view details)

Uploaded Source

Built Distributions

osprey-1.0.0-py3-none-any.whl (50.9 kB view details)

Uploaded Python 3

osprey-1.0.0-py2-none-any.whl (50.9 kB view details)

Uploaded Python 2

File details

Details for the file osprey-1.0.0.tar.gz.

File metadata

  • Download URL: osprey-1.0.0.tar.gz
  • Upload date:
  • Size: 37.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for osprey-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5086d471702a79163ae0dc514c2c544c3810895eca73a42872b7f9314d4ce847
MD5 20206becf1b23e25929df2e04593a786
BLAKE2b-256 153432f5cfc79b563b35603382b4bb2d5d6926fbd28b1183d6a27b87c1b6044c

See more details on using hashes here.

File details

Details for the file osprey-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for osprey-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e81f5aa5f83a952458b01d7c8c5e46f1120b1296ea7297820635281fe69d9573
MD5 a2b4dd457f139264c9dc26aa87def216
BLAKE2b-256 d6b25ce18965b9b4d0b7cef569fd9ad31d403c7ee7472f08c2fab627d493a6a7

See more details on using hashes here.

File details

Details for the file osprey-1.0.0-py2-none-any.whl.

File metadata

File hashes

Hashes for osprey-1.0.0-py2-none-any.whl
Algorithm Hash digest
SHA256 308dff91c856d1cb359c95639417792d7a8a5e2064162cda4870876ffb765bfe
MD5 c32e2329809fbedde8d423f9c2a2cf41
BLAKE2b-256 fb509346f9711c6dfbe30c37b51a8618ec6fac18657682e6d9b8cc30c1e8bbea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page