{"id":19866549,"url":"https://github.com/anyoptimization/ezmodel","last_synced_at":"2025-05-02T06:30:35.200Z","repository":{"id":110617637,"uuid":"476472991","full_name":"anyoptimization/ezmodel","owner":"anyoptimization","description":"A Common Interface for Models and Model Selection","archived":false,"fork":false,"pushed_at":"2023-11-25T22:06:50.000Z","size":54,"stargazers_count":3,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T23:13:02.173Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anyoptimization.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-31T20:46:39.000Z","updated_at":"2024-02-18T10:30:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"962b9c67-a6ba-4388-b2f1-a2de29e64516","html_url":"https://github.com/anyoptimization/ezmodel","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anyoptimization%2Fezmodel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anyoptimization%2Fezmodel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anyoptimization%2Fezmodel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anyoptimization%2Fezmodel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anyoptimization","download_url":"https://codeload.github.com/anyoptimization/ezmodel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251998032,"owners_count":21677913,"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-11-12T15:26:12.593Z","updated_at":"2025-05-02T06:30:34.927Z","avatar_url":"https://github.com/anyoptimization.png","language":"Python","readme":"ezmodel - A Common Interface for Models and Model Selection\n====================================================================\n\nFor more information about our toolbox, users are encouraged to read our documentation.\nhttps://anyoptimization.com/projects/ezmodel/\n\n\n|python| |license|\n\n\n.. |python| image:: https://img.shields.io/badge/python-3.9-blue.svg\n   :alt: python 3.6\n\n.. |license| image:: https://img.shields.io/badge/license-apache-orange.svg\n   :alt: license apache\n   :target: https://www.apache.org/licenses/LICENSE-2.0\n\n\n\nInstallation\n====================================================================\n\nThe official release is always available at PyPi:\n\n.. code:: bash\n\n    pip install -U ezmodel\n\n\n\nUsage\n==================================\n\n\n\nBenchmarking\n==================================\n\n\n.. code:: python\n\n    \n    import numpy as np\n\n    import pandas as pd\n    pd.set_option('display.expand_frame_repr', False)\n    pd.set_option('max_colwidth', 1000)\n\n    from ezmodel.core.benchmark import Benchmark\n    from ezmodel.core.factory import models_from_clazzes\n    from ezmodel.models.kriging import Kriging\n    from ezmodel.models.rbf import RBF\n    from ezmodel.util.partitioning.crossvalidation import CrossvalidationPartitioning\n\n    X = np.random.random((100, 3)) * 2 * np.pi\n    y = np.sin(X).sum(axis=1)\n\n    models = models_from_clazzes(RBF, Kriging)\n\n    # set up the benchmark and add the models to be used\n    benchmark = Benchmark(models, n_threads=4, verbose=True, raise_exception=True)\n\n    # create partitions to validate the performance of each model\n    partitions = CrossvalidationPartitioning(k_folds=5, seed=1).do(X)\n\n    # runs the experiment with the specified partitioning\n    benchmark.do(X, y, partitions=partitions)\n\n    # print out the benchmark results\n    print(benchmark.statistics(\"mae\"))\n\n\n\n::\n\n                                                                      mae\n                                                                     mean       std       min        max    median\n    label\n    Kriging[regr=constant,corr=gauss,thetaU=100,ARD=False]       0.017159  0.007472  0.009658   0.025359  0.014855\n    Kriging[regr=constant,corr=gauss,thetaU=20,ARD=False]        0.017159  0.007472  0.009658   0.025359  0.014855\n    Kriging[regr=linear,corr=gauss,thetaU=100,ARD=False]         0.018064  0.008069  0.010350   0.027456  0.014246\n    Kriging[regr=linear,corr=gauss,thetaU=20,ARD=False]          0.018064  0.008069  0.010350   0.027456  0.014246\n    Kriging[regr=constant,corr=gauss,thetaU=100,ARD=True]        0.021755  0.007409  0.011955   0.028896  0.025163\n    Kriging[regr=constant,corr=gauss,thetaU=20,ARD=True]         0.021755  0.007409  0.011955   0.028896  0.025163\n    Kriging[regr=linear,corr=gauss,thetaU=20,ARD=True]           0.025018  0.011348  0.011576   0.040585  0.022124\n    Kriging[regr=linear,corr=gauss,thetaU=100,ARD=True]          0.025018  0.011348  0.011576   0.040585  0.022124\n    Kriging[regr=constant,corr=exp,thetaU=100,ARD=False]         0.034493  0.009328  0.025092   0.045610  0.030661\n    Kriging[regr=constant,corr=exp,thetaU=20,ARD=False]          0.034493  0.009328  0.025092   0.045610  0.030661\n    Kriging[regr=linear,corr=exp,thetaU=100,ARD=False]           0.035734  0.009922  0.025611   0.047926  0.031473\n    Kriging[regr=linear,corr=exp,thetaU=20,ARD=False]            0.035734  0.009922  0.025611   0.047926  0.031473\n    Kriging[regr=constant,corr=exp,thetaU=100,ARD=True]          0.051527  0.010941  0.037944   0.065866  0.047440\n    Kriging[regr=constant,corr=exp,thetaU=20,ARD=True]           0.051527  0.010941  0.037944   0.065866  0.047440\n    Kriging[regr=linear,corr=exp,thetaU=100,ARD=True]            0.065867  0.025312  0.039058   0.104449  0.059957\n    Kriging[regr=linear,corr=exp,thetaU=20,ARD=True]             0.065867  0.025312  0.039058   0.104449  0.059957\n    RBF[kernel=cubic,tail=quadratic,normalized=True]             0.121947  0.033552  0.077895   0.167120  0.127345\n    RBF[kernel=cubic,tail=constant,normalized=True]              0.125348  0.037982  0.072579   0.169413  0.140753\n    RBF[kernel=cubic,tail=linear,normalized=True]                0.125474  0.038609  0.071268   0.169843  0.137987\n    RBF[kernel=cubic,tail=linear+quadratic,normalized=True]      0.126070  0.039773  0.071279   0.171862  0.135489\n\n\n\n\nRBF\n----------------------------------\n\n\n.. code:: python\n\n    \n    import matplotlib.pyplot as plt\n    import numpy as np\n\n    from ezmodel.models.rbf import RBF\n    from ezmodel.util.sample_from_func import sine_function\n\n    rbf = RBF(kernel=\"gaussian\")\n\n    # create some data to test this model on\n    X, y, _X, _y = sine_function(20, 200)\n\n    # let the model fit the data\n    rbf.fit(X, y)\n\n    # predict the data using the model\n    y_hat = rbf.predict(_X)\n\n    # predict the data using the model\n    _X = _X[np.argsort(_X[:, 0])]\n    y_hat = rbf.predict(_X)\n\n    plt.scatter(X, y, label=\"Data\")\n    plt.plot(_X, y_hat, color=\"black\", label=\"RBF\")\n    plt.legend()\n    plt.show()\n\n\n\nKriging\n----------------------------------\n\n\n.. code:: python\n\n    \n    import matplotlib.pyplot as plt\n    import numpy as np\n\n    from ezmodel.models.kriging import Kriging\n    from ezmodel.util.sample_from_func import square_function\n\n    model = Kriging(regr=\"linear\",\n                    corr=\"gauss\",\n                    ARD=False)\n\n    # create some data to test this model on\n    X, y, _X, _y = square_function(100, 20)\n\n    # let the model fit the data\n    model.fit(X, y)\n\n    # predict the data using the model\n    y_hat = model.predict(_X)\n\n    # predict the data using the model\n    _X = _X[np.argsort(_X[:, 0])]\n    y_hat = model.predict(_X)\n\n    plt.scatter(X, y, label=\"Data\")\n    plt.plot(_X, y_hat, color=\"black\", label=\"RBF\")\n    plt.legend()\n    plt.show()\n\n\n\n\nContact\n=======\n\n\nFeel free to contact us if you have any question:\n\n::\n\n    Julian Blank (blankjul [at] msu.edu)\n    Michigan State University\n    Computational Optimization and Innovation Laboratory (COIN)\n    East Lansing, MI 48824, USA\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanyoptimization%2Fezmodel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanyoptimization%2Fezmodel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanyoptimization%2Fezmodel/lists"}