{"id":13574076,"url":"https://github.com/Yelp/MOE","last_synced_at":"2025-04-04T14:31:34.634Z","repository":{"id":14440813,"uuid":"17152267","full_name":"Yelp/MOE","owner":"Yelp","description":"A global, black box optimization engine for real world metric optimization.","archived":false,"fork":false,"pushed_at":"2023-03-24T11:00:32.000Z","size":11920,"stargazers_count":1312,"open_issues_count":175,"forks_count":140,"subscribers_count":60,"default_branch":"master","last_synced_at":"2025-03-31T20:06:34.425Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Yelp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/contributing.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-02-24T21:55:56.000Z","updated_at":"2025-03-25T03:02:13.000Z","dependencies_parsed_at":"2022-09-14T12:50:44.773Z","dependency_job_id":"e5a09187-e9bb-4436-95a0-795e37211dd0","html_url":"https://github.com/Yelp/MOE","commit_stats":{"total_commits":646,"total_committers":13,"mean_commits":49.69230769230769,"dds":0.6687306501547987,"last_synced_commit":"5b5a6a2c6c3cf47320126f7f5894e2a83e347f5c"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yelp%2FMOE","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yelp%2FMOE/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yelp%2FMOE/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Yelp%2FMOE/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Yelp","download_url":"https://codeload.github.com/Yelp/MOE/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247194062,"owners_count":20899424,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T15:00:46.135Z","updated_at":"2025-04-04T14:31:33.535Z","avatar_url":"https://github.com/Yelp.png","language":"C++","funding_links":[],"categories":["C++","AutoML","Profiling","参数优化","Scheduling","Libraries","Tools and projects"],"sub_categories":["Profiling","LLM"],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://github.com/yelp/MOE/raw/master/moe/static/img/MOE_full_logo.png\" alt=\"MOE Logo\"\u003e\n\u003c/p\u003e\n\n`[![Build Status](https://travis-ci.org/Yelp/MOE.svg?branch=master)](https://travis-ci.org/Yelp/MOE)`\nNote: travis link temporarily disabled. The last major MOE commit built successfully but our travis flow appears to be broken (out of date packages perhaps?). Tests and docker still pass/build locally and MOE still works.\n\nMetric Optimization Engine. A global, black box optimization engine for real world metric optimization.\n\n  * [Full documentation][1]\n  * [REST documentation][2]\n\nOr, build the documentation locally with `make docs`.\n\n## What is MOE?\n\nMOE (Metric Optimization Engine) is an *efficient* way to optimize a system's parameters, when evaluating parameters is *time-consuming* or *expensive*.\n\nHere are some examples of when you could use MOE:\n\n* **Optimizing a system's click-through rate (CTR).**  MOE is useful when evaluating CTR requires running an A/B test on real user traffic, and getting statistically significant results requires running this test for a substantial amount of time (hours, days, or even weeks).\n\n* **Optimizing tunable parameters of a machine-learning prediction method.**  MOE is useful if calculating the prediction error for one choice of the parameters takes a long time, which might happen because the prediction method is complex and takes a long time to train, or because the data used to evaluate the error is huge.\n\n* **Optimizing the design of an engineering system** (an airplane, the traffic network in a city, a combustion engine, a hospital).  MOE is useful if evaluating a design requires running a complex physics-based numerical simulation on a supercomputer. \n\n* **Optimizing the parameters of a real-world experiment** (a chemistry, biology, or physics experiment, a drug trial).  MOE is useful when every experiment needs to be physically created in a lab, or very few experiments can be run in parallel.\n\nMOE is ideal for problems in which the optimization problem's objective function is a black box, not necessarily convex or concave, derivatives are unavailable, and we seek a global optimum, rather than just a local one. This ability to handle black-box objective functions allows us to use MOE to optimize nearly any system, without requiring any internal knowledge or access. To use MOE, we simply need to specify some [objective function][14], some set of [parameters][15], and any historical data we may have from previous evaluations of the objective function. MOE then finds the set of parameters that maximize (or minimize) the objective function, while evaluating the objective function as little as possible. \n\nInside, MOE uses *Bayesian global optimization*, which performs optimization using Bayesian statistics and *optimal learning*. \n\nOptimal learning is the study of efficient methods for collecting information, particularly when doing so is time-consuming or expensive, and was developed and popularized from its roots in decision theory by [Prof. Peter Frazier][16] ([Cornell, Operations Research and Information Engineering][17]) and [Prof. Warren Powell][18] ([Princeton, Operations Research and Financial Engineering][19]). For more information about the mathematics of optimal learning, and more real-world applications like heart surgery, drug discovery, and materials science, see these [intro slides][20] to optimal learning.\n\n[Why do we need MOE?][21]\n\nVideo and slidedeck introduction to MOE:\n\n* [15 min MOE intro video][10]\n* [MOE intro slides][11]\n* [Full documentation][1]\n\nMOE does this internally by:\n\n1. Building a Gaussian Process (GP) with the historical data\n2. Optimizing the hyperparameters of the Gaussian Process (model selection)\n3. Finding the points of highest Expected Improvement (EI)\n4. Returning the points to sample, then repeat\n\nExternally you can use MOE through:\n\n1. [The REST interface][2]\n2. [The Python interface][9]\n3. [The C++ interface][12]\n\nYou can be up and optimizing in a matter of minutes. [Examples of using MOE][13]\n\n# Install\n\n## Install in docker:\n\nThis is the recommended way to run the MOE REST server. All dependencies and building is done automatically and in an isolated container.\n\n[Docker (http://docs.docker.io/)][6] is a container based virtualization framework. Unlike traditional virtualization Docker is fast, lightweight and easy to use. Docker allows you to create containers holding all the dependencies for an application. Each container is kept isolated from any other, and nothing gets shared.\n\n```bash\n$ docker pull yelpmoe/latest # You can also pull specific versions like yelpmoe/v0.1.0\n$ docker run -p 6543:6543 yelpmoe/latest\n```\nIf you are on OSX, or want a build based on the current master branch you may need to build this manually.\n\n```bash\n$ git clone https://github.com/Yelp/MOE.git\n$ cd MOE\n$ docker build -t moe_container .\n$ docker run -p 6543:6543 moe_container\n```\n\nThe webserver and REST interface is now running on port 6543 from within the container. http://localhost:6543\n\n## Install from source:\n\nSee [Install Documentation][7]\n\n# Running MOE\n\n## REST/web server and interactive demo\n\nfrom the directory MOE is installed:\n\n```bash\n$ pserve --reload development.ini # MOE server is now running at http://localhost:6543\n```\n\n[The REST interface documentation][2]\n\nOr, from the command line,\n\n```bash\n$ curl -X POST -H \"Content-Type: application/json\" -d '{\"domain_info\": {\"dim\": 1}, \"points_to_evaluate\": [[0.1], [0.5], [0.9]], \"gp_historical_info\": {\"points_sampled\": [{\"value_var\": 0.01, \"value\": 0.1, \"point\": [0.0]}, {\"value_var\": 0.01, \"value\": 0.2, \"point\": [1.0]}]}}' http://127.0.0.1:6543/gp/ei\n```\n[`gp_ei` endpoint documentation.][4]\n\n## From ipython\n\n```bash\n$ ipython\n\u003e from moe.easy_interface.experiment import Experiment\n\u003e from moe.easy_interface.simple_endpoint import gp_next_points\n\u003e exp = Experiment([[0, 2], [0, 4]])\n\u003e exp.historical_data.append_sample_points([[[0, 0], 1.0, 0.01]])\n\u003e next_point_to_sample = gp_next_points(exp)\n\u003e print next_point_to_sample\n```\n[`easy_interface` documentation.][5]\n\n## Within Python\n\nSee ``examples/next_point_via_simple_endpoint.py`` for this code or http://yelp.github.io/MOE/examples.html for more examples.\n\n```python\nimport math\nimport random\n\nfrom moe.easy_interface.experiment import Experiment\nfrom moe.easy_interface.simple_endpoint import gp_next_points\nfrom moe.optimal_learning.python.data_containers import SamplePoint\n\n\n# Note: this function can be anything, the output of a batch, results of an A/B experiment, the value of a physical experiment etc.\ndef function_to_minimize(x):\n    \"\"\"Calculate an aribitrary 2-d function with some noise with minimum near [1, 2.6].\"\"\"\n    return math.sin(x[0]) * math.cos(x[1]) + math.cos(x[0] + x[1]) + random.uniform(-0.02, 0.02)\n\nif __name__ == '__main__':\n    exp = Experiment([[0, 2], [0, 4]])  # 2D experiment, we build a tensor product domain\n    # Bootstrap with some known or already sampled point(s)\n    exp.historical_data.append_sample_points([\n        SamplePoint([0, 0], function_to_minimize([0, 0]), 0.05),  # Iterables of the form [point, f_val, f_var] are also allowed\n        ])\n\n    # Sample 20 points\n    for i in range(20):\n        # Use MOE to determine what is the point with highest Expected Improvement to use next\n        next_point_to_sample = gp_next_points(exp)[0]  # By default we only ask for one point\n        # Sample the point from our objective function, we can replace this with any function\n        value_of_next_point = function_to_minimize(next_point_to_sample)\n\n        print \"Sampled f({0:s}) = {1:.18E}\".format(str(next_point_to_sample), value_of_next_point)\n\n        # Add the information about the point to the experiment historical data to inform the GP\n        exp.historical_data.append_sample_points([SamplePoint(next_point_to_sample, value_of_next_point, 0.01)])  # We can add some noise\n```\n\nMore examples can be found in the `\u003cMOE_DIR\u003e/examples` directory.\n\n## Within C++\n\nExpected Improvement Demo - http://yelp.github.io/MOE/gpp_expected_improvement_demo.html\nGaussian Process Hyperparameter Optimization Demo - http://yelp.github.io/MOE/gpp_hyperparameter_optimization_demo.html\nCombined Demo - http://yelp.github.io/MOE/gpp_hyper_and_EI_demo.html\n\n# Contributing\n\nSee [Contributing Documentation][8]\n\n# License\n\nMOE is licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0\n\n[0]: https://www.youtube.com/watch?v=CC6qvzWp9_A\n[1]: http://yelp.github.io/MOE/\n[2]: http://yelp.github.io/MOE/moe.views.rest.html\n[3]: http://github.com/Yelp/MOE/pulls\n[4]: http://yelp.github.io/MOE/moe.views.rest.html#module-moe.views.rest.gp_ei\n[5]: http://yelp.github.io/MOE/moe.easy_interface.html\n[6]: http://docs.docker.io/\n[7]: http://yelp.github.io/MOE/install.html\n[8]: http://yelp.github.io/MOE/contributing.html\n[9]: http://yelp.github.io/MOE/moe.optimal_learning.python.python_version.html\n[10]: http://www.youtube.com/watch?v=CC6qvzWp9_A\n[11]: http://www.slideshare.net/YelpEngineering/optimal-learning-for-fun-and-profit-with-moe\n[12]: http://yelp.github.io/MOE/cpp_tree.html\n[13]: http://yelp.github.io/MOE/examples.html\n[14]: http://yelp.github.io/MOE/objective_functions.html\n[15]: http://yelp.github.io/MOE/objective_functions.html#parameters\n[16]: http://people.orie.cornell.edu/pfrazier/\n[17]: http://www.orie.cornell.edu/\n[18]: http://optimallearning.princeton.edu/\n[19]: http://orfe.princeton.edu/\n[20]: http://people.orie.cornell.edu/pfrazier/Presentations/2014.01.Lancaster.BGO.pdf\n[21]: http://yelp.github.io/MOE/why_moe.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYelp%2FMOE","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FYelp%2FMOE","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FYelp%2FMOE/lists"}