{"id":25631015,"url":"https://github.com/mikediessner/simplelhs","last_synced_at":"2025-04-14T16:52:49.456Z","repository":{"id":47194963,"uuid":"515934603","full_name":"mikediessner/simplelhs","owner":"mikediessner","description":"Simple implementation of Latin Hypercube Sampling.","archived":false,"fork":false,"pushed_at":"2023-04-18T07:06:40.000Z","size":25,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-23T15:48:40.239Z","etag":null,"topics":["design-of-experiments","latin-hypercube-sampling","numpy","space-filling-designs"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikediessner.png","metadata":{"files":{"readme":"README.md","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}},"created_at":"2022-07-20T10:24:55.000Z","updated_at":"2024-05-22T12:33:12.000Z","dependencies_parsed_at":"2022-09-02T07:00:18.599Z","dependency_job_id":null,"html_url":"https://github.com/mikediessner/simplelhs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikediessner%2Fsimplelhs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikediessner%2Fsimplelhs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikediessner%2Fsimplelhs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikediessner%2Fsimplelhs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikediessner","download_url":"https://codeload.github.com/mikediessner/simplelhs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248922493,"owners_count":21183942,"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":["design-of-experiments","latin-hypercube-sampling","numpy","space-filling-designs"],"created_at":"2025-02-22T20:18:21.174Z","updated_at":"2025-04-14T16:52:49.434Z","avatar_url":"https://github.com/mikediessner.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# simplelhs\nSimple implementation of Latin Hypercube Sampling.\n\n[![Downloads](https://static.pepy.tech/personalized-badge/simplelhs?period=total\u0026units=none\u0026left_color=grey\u0026right_color=blue\u0026left_text=Downloads)](https://pepy.tech/project/simplelhs)  \n\n# Example\n\nThe example below shows how to sample from a random Latin Hypercube Design with five points for three inputs.\n\n```python\nfrom simplelhs import LatinHypercubeSampling\n\nlhs = LatinHypercubeSampling(3)\nhc = lhs.random(5)\n\nprint(hc)\n```\n\n```\n[[0.65830165 0.26660356 0.78491755]\n [0.42168063 0.43244666 0.979281  ]\n [0.39058169 0.76099351 0.34764726]\n [0.07122137 0.15507069 0.58082752]\n [0.87530571 0.94575193 0.03949576]]\n ```\n\nThe example below shows how to sample from a Maximin Latin Hypercube Design with five points for three inputs. Out of 1000 randomly sampled Latin Hypercube samples the sample with the maximal minimal distance between points is selected.\n\n```python\nfrom simplelhs import LatinHypercubeSampling\n\nlhs = LatinHypercubeSampling(3)\nhc = lhs.maximin(5, 1000)\n\nprint(hc)\n```\n\n```\n[[0.24607101 0.11399068 0.5456922 ]\n [0.88731638 0.40600431 0.32305333]\n [0.47416121 0.99487745 0.03087923]\n [0.06288706 0.7227211  0.78248764]\n [0.77081332 0.36862214 0.99449703]]\n ```\n \nTo scale the data to unit cube and back to its original range the functions `normalise()` and `unnormalise()` are provided. The example below scales the Maximin Latin Hypercube sample back to its original range.\n\n```python\nfrom simplelhs import unnormalise\n\nlower = np.array([0., -5., 10.,])\nupper = np.array([1., 5., 40.])\nhc_maximin_scaled = unnormalise(hc_maximin, lower, upper)\n\nprint(hc_maximin_scaled)\n```\n\n ```\n [[ 0.24607101 -3.86009322 26.37076609]\n [ 0.88731638 -0.93995687 19.69159997]\n [ 0.47416121  4.94877447 10.92637679]\n [ 0.06288706  2.22721099 33.47462916]\n [ 0.77081332 -1.31377864 39.83491091]]\n ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikediessner%2Fsimplelhs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikediessner%2Fsimplelhs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikediessner%2Fsimplelhs/lists"}