{"id":13471522,"url":"https://github.com/mikeizbicki/HLearn","last_synced_at":"2025-03-26T13:31:11.789Z","repository":{"id":3993059,"uuid":"5089764","full_name":"mikeizbicki/HLearn","owner":"mikeizbicki","description":"Homomorphic machine learning","archived":false,"fork":false,"pushed_at":"2016-05-29T16:51:53.000Z","size":17533,"stargazers_count":1627,"open_issues_count":23,"forks_count":133,"subscribers_count":140,"default_branch":"master","last_synced_at":"2025-03-23T14:42:37.456Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Haskell","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/mikeizbicki.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":"2012-07-18T00:08:33.000Z","updated_at":"2025-02-23T12:14:16.000Z","dependencies_parsed_at":"2022-07-12T23:20:32.439Z","dependency_job_id":null,"html_url":"https://github.com/mikeizbicki/HLearn","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeizbicki%2FHLearn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeizbicki%2FHLearn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeizbicki%2FHLearn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikeizbicki%2FHLearn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikeizbicki","download_url":"https://codeload.github.com/mikeizbicki/HLearn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245662837,"owners_count":20652093,"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-07-31T16:00:46.197Z","updated_at":"2025-03-26T13:31:10.986Z","avatar_url":"https://github.com/mikeizbicki.png","language":"Haskell","funding_links":[],"categories":["Haskell"],"sub_categories":["Tools","[Tools](#tools-1)","Speech Recognition"],"readme":"# HLearn\n\n\u003c!--![](https://travis-ci.org/mikeizbicki/HLearn.svg)--\u003e\n\nHLearn is a high performance machine learning library written in [Haskell](http://haskell.org).\nFor example, it currently has the fastest nearest neighbor implementation for arbitrary metric spaces (see [this blog post](http://izbicki.me)).\n\nHLearn is also a research project.\nThe research goal is to discover the \"best possible\" interface for machine learning.\nThis involves two competing demands:\nThe library should be as fast as low-level libraries written in C/C++/Fortran/Assembly;\nbut it should be as flexible as libraries written in high level languages like Python/R/Matlab.\n[Julia](http://julialang.org/) is making amazing progress in this direction,\nbut HLearn is more ambitious.\nIn particular, HLearn's goal is to be *faster* than the low level languages and *more flexible* than the high level languages.\n\nTo achieve this goal, HLearn uses a very different interface than standard learning libraries.\nThe H in HLearn stands for three separate concepts that are fundamental to HLearn's design:\n\n1. The H stands for [Haskell](http://haskell.org).\nMachine learning is about estimating *functions* from data,\nso it makes sense that a functional programming language would be well suited for machine learning.\nBut Functional programming languages are not widely used in machine learning because they traditionally lack strong support for the fast numerical computations required for learning algorithms.\nHLearn uses the [SubHask](http://github.com/mikeizbicki/subhask) library to get this fast numeric support in Haskell.\nThe two libraries are being developed in tandem with each other.\n\u003c!--Languages like Agda/Coq/Idris provide more advanced type systems,--\u003e\n\u003c!--but their compilers lack the support for real world optimizations needed for numerical applications.--\u003e\n\u003c!--Haskell strikes a nice balance.--\u003e\n\n1. The H stands for [Homomorphisms](https://en.wikipedia.org/wiki/Homomorphism).\nHomomorphisms are a fundamental concept in [abstract algebra](https://en.wikipedia.org/wiki/Abstract_algebra),\nand HLearn exploits the algebraic structures inherrent in learning systems.\nThe following table gives a brief overview of what these structures give us:\n\n    | Structure     | What we get                           |\n    |:--------------|:--------------------------------------|\n    | Monoid        | parallel batch training               |\n    | Monoid        | online training                       |\n    | Monoid        | fast cross-validation                 |\n    | Abelian group | \"untraining\" of data points           |\n    | Abelian group | more fast cross-validation            |\n    | R-Module      | weighted data points                  |\n    | Vector space  | fractionally weighted data points     |\n    | Functor       | fast simple preprocessing of data     |\n    | Monad         | fast complex preprocessing of data    |\n\n1. The H stands for the [History monad](https://github.com/mikeizbicki/HLearn/blob/master/src/HLearn/History.hs).\nOne of the most difficult tasks of developing a new learning algorithm is debugging the optimization procedure.\nThere has previously been essentially no work on making this debugging process easier,\nand the `History` monad tries to solve this problem.\nIt lets you thread debugging information throughout the optimization code *without modifying the original code*.\nFurthermore, there is no runtime overhead associated with this technique.\n\nThe downside of HLearn's ambition is that it currently does not implement many of the popular machine learning techniques.\n\n## More Documentation\n\nDue to the rapid pace of development, HLearn's documentation is sparse.\nThat said, the [examples](https://github.com/mikeizbicki/HLearn/tree/master/examples) folder is a good place to start.\nThe haddock documentation embedded within the code is decent;\nbut unfortunately, hackage is unable to compile the haddocks because it uses an older version of GHC.\n\nHLearn has several academic papers:\n\n* ICML15 - [Faster Cover Trees](http://izbicki.me/public/papers/icml2015-faster-cover-trees.pdf)\n* ICML13 - [Algebraic Classifiers: a generic approach to fast cross-validation, online training, and parallel training](http://izbicki.me/public/papers/icml2013-algebraic-classifiers.pdf)\n* TFP13 - [HLearn: A Machine Learning Library for Haskell](http://izbicki.me/public/papers/tfp2013-hlearn-a-machine-learning-library-for-haskell.pdf)\n\nThere are also a number of blog posts on [my personal website](http://izbicki.me).\nUnfortunately, they are mostly out of date with the latest version of HLearn.\nThey might help you understand some of the main concepts in HLearn, but the code they use won't work at all.\n\n* [The categorical distribution's monoid/group/module Structure](http://izbicki.me/blog/the-categorical-distributions-algebraic-structure)\n* [The categorical distribution's functor/monad structure](http://izbicki.me/blog/functors-and-monads-for-analyzing-data)\n* [Markov Networks, monoids, and futurama](http://izbicki.me/blog/markov-networks-monoids-and-futurama)\n* [Solving NP-complete problems with HLearn, and how to write your own HomTrainer instances](http://izbicki.me/public/papers/monoids-for-approximating-np-complete-problems.pdf)\n* [Nuclear weapon statistics using monoids, groups, and modules](http://izbicki.me/blog/nuclear-weapon-statistics-using-monoids-groups-and-modules-in-haskell)\n* [Gaussian distributions form a monoid](http://izbicki.me/blog/gausian-distributions-are-monoids)\n* [HLearn cross-validates \u003e400x faster than Weka](http://izbicki.me/blog/hlearn-cross-validates-400x-faster-than-weka)\n* [HLearn's code is shorter and clearer than Weka's](http://izbicki.me/blog/hlearns-code-is-shorter-and-clearer-than-wekas)\n\n## Contributing\n\n\u003c!--If you want to contribute, I'd be happy to help you get started.--\u003e\nI'd love to have you contribute, and I'd be happy to help you get started!\nJust [create an issue](https://github.com/mikeizbicki/hlearn/issues) to let me know you're interested and we can work something out.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeizbicki%2FHLearn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikeizbicki%2FHLearn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikeizbicki%2FHLearn/lists"}