{ "info": { "author": "Lifan Liang", "author_email": "lil115@pitt.edu", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "# EM_BMF\n\nRobust Boolean matrix factorization via EM_BMF\nThe code is completely process-oriented. Sorry for contaminating your name space.\n\nDependency: (I think it will work as long as Annaconda on Python3 is installed)\n\nnumpy -- 1.11.3\n\nscipy -- 1.1.0\n\nnumba -- 0.40.0\n\n\n\nExample usage:\n\n```python\nimport numpy as np\nfrom boolem import boolem\n\ndef synthesis(shape, latent_size, P, noise_p=0.0):\n '''\n In this synthesis, the probability of X was sampled from the joint probability of the latent factors.\n P is the parameter as Beta(1/(1-p),2) for generating the probability in latent factors.\n '''\n\n a = np.zeros((shape[0], latent_size))\n b = np.zeros((latent_size, shape[1]))\n X = np.zeros(shape)\n for l in range(latent_size):\n a[:,l] = np.random.binomial(1, P[l], shape[0])\n b[l,:] = np.random.binomial(1, P[l], shape[1])\n X += np.outer(a[:,l],b[l,:]) \n X[X>1] = 1\n flip = np.random.binomial(1, noise_p, X.shape)\n X_noisy = np.abs(X-flip)\n return X_noisy, X, a, b\n\n# Generate a Boolean matrice with heterogeneous Boolean factors and uniform noise. \nX_noisy, X, a, b = synthesis((1000, 1000), 4, np.random.uniform(0.2,0.5,4), noise_p=0.2)\n\n# Feed the model with noisy matrix. \n# Latent_size: the dimension of latent Boolean factors. \n# alpha: the alpha for the beta prior. Default is recommended.\n# beta: the beta for the beta prior. Default is recommended.\n# mask: the matrix with the same shape as X. 0 means the correponding element in X is missing.\n# max_iter: the maximum iteration for gradient-based optimization\nmodel = boolem(np.int8(X_noisy), latent_size=5, alpha=0.95, beta=0.95, mask=np.ones(X.shape, dtype=np.int8), max_iter=200)\nmodel.run()\n\n# After running factorization, the model will contain several new attributes as the output:\n# model.U: the latent factor with the shape (X.shape[0], latent_size)\n# model.Z: the latent facotr with the shape (latent_size, X.shape[1])\n# model.X_hat: reconstructed Boolean matrix from U and Z. Note that values in X_hat is continuous within [0,1]\nprint('Reconstruction error:', np.abs((model.X_hat>0.5)-X).mean())\n```\n\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/LifanLiang/EM_BMF", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "boolem", "package_url": "https://pypi.org/project/boolem/", "platform": "", "project_url": "https://pypi.org/project/boolem/", "project_urls": { "Homepage": "https://github.com/LifanLiang/EM_BMF" }, "release_url": "https://pypi.org/project/boolem/0.0.5/", "requires_dist": null, "requires_python": ">=3.4", "summary": "Boolean matrix factorization on RNA expression data", "version": "0.0.5", "yanked": false, "yanked_reason": null }, "last_serial": 6171778, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "6a27da7f508bf4e2d6e8dffecd41f568", "sha256": "c306bcc5c54b0df06d18e8057cbb33548ad85fce689cb6d6807492f6eb9c7cc7" }, "downloads": -1, "filename": "boolem-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "6a27da7f508bf4e2d6e8dffecd41f568", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 6424, "upload_time": "2019-10-25T03:06:56", "upload_time_iso_8601": "2019-10-25T03:06:56.106416Z", "url": "https://files.pythonhosted.org/packages/ac/7c/e5453d7eeb34ba03bcbce95602232ff71d3a2a47b0e9a2be337e2edd5b68/boolem-0.0.2-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "079706322ac9c2e12f95cfc50cdf993e", "sha256": "9b0ae421a274c1d245e8e4fa14454565b64ab181006e3136e477545b89c49650" }, "downloads": -1, "filename": "boolem-0.0.2.tar.gz", "has_sig": false, "md5_digest": "079706322ac9c2e12f95cfc50cdf993e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 3918, "upload_time": "2019-10-25T03:06:59", "upload_time_iso_8601": "2019-10-25T03:06:59.050285Z", "url": "https://files.pythonhosted.org/packages/26/83/ec4464edc75dece10006aee758590f6a8acdfc915f52fb080b57a942b3a5/boolem-0.0.2.tar.gz", "yanked": false, "yanked_reason": null } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "ec974713f891306709b702dac937e077", "sha256": "5bdabbb7c2b2535bef7945d03d30aca16a8876cf9a897d5fb095305fa4ee33b2" }, "downloads": -1, "filename": "boolem-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "ec974713f891306709b702dac937e077", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 6468, "upload_time": "2019-10-25T03:14:25", "upload_time_iso_8601": "2019-10-25T03:14:25.444975Z", "url": "https://files.pythonhosted.org/packages/29/fb/d91fbb52a76497481a1917ec02e20f8c4c7115559d914d3dabda5a0d3cba/boolem-0.0.3-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "5e054127ed8aacf969015b6711df7311", "sha256": "832f33021775302db275c5512546790e520ce6751fa9d103c642e0d29f46f36a" }, "downloads": -1, "filename": "boolem-0.0.3.tar.gz", "has_sig": false, "md5_digest": "5e054127ed8aacf969015b6711df7311", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 3924, "upload_time": "2019-10-25T03:14:27", "upload_time_iso_8601": "2019-10-25T03:14:27.607478Z", "url": "https://files.pythonhosted.org/packages/4a/50/f99ec5f3bfc7233e6004b09788c47e8c82a323fab2eba717d2df07b69a5b/boolem-0.0.3.tar.gz", "yanked": false, "yanked_reason": null } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "2c908c9c4732c847e3389be2c8482740", "sha256": "629d01d9ebf7905d0d5aa7ff56d3ddbdbfbc27bf227c895a6e7401d1f34cc16e" }, "downloads": -1, "filename": "boolem-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "2c908c9c4732c847e3389be2c8482740", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 6495, "upload_time": "2019-11-20T22:07:28", "upload_time_iso_8601": "2019-11-20T22:07:28.760126Z", "url": "https://files.pythonhosted.org/packages/e8/9d/f201b8bde04ba23ee62aad4abcece6d827ae6b877bdb4203d8486c211daa/boolem-0.0.4-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "ede1a00b5b08e93a1cb1ea55661fa6ef", "sha256": "41675c7eedb644a659f928b2945892fd09f362009ede451df00db4e4de8b8f48" }, "downloads": -1, "filename": "boolem-0.0.4.tar.gz", "has_sig": false, "md5_digest": "ede1a00b5b08e93a1cb1ea55661fa6ef", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 3957, "upload_time": "2019-11-20T22:07:30", "upload_time_iso_8601": "2019-11-20T22:07:30.482450Z", "url": "https://files.pythonhosted.org/packages/36/b0/7b6230fb23971e06841e020735a360c7bbe90d5d425bd87466900ff1bff4/boolem-0.0.4.tar.gz", "yanked": false, "yanked_reason": null } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "69e1860cc05df2cb0cedef851523c5d5", "sha256": "c754583c93b5abbdc1cf488c4e0435c49161431e242ddfb9485d00acd34237b0" }, "downloads": -1, "filename": "boolem-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "69e1860cc05df2cb0cedef851523c5d5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 6499, "upload_time": "2019-11-20T22:16:13", "upload_time_iso_8601": "2019-11-20T22:16:13.574825Z", "url": "https://files.pythonhosted.org/packages/33/20/275eb8b75414bacf143cc91decd0c7d43e60b603a407b04f05033732fe58/boolem-0.0.5-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "74043adf0feda10a68ca668d7a88f6c8", "sha256": "3daebffa83d2f9a8ba30b3703d8add5196b6e8138ff9ac4b2c156077dc3ec6a7" }, "downloads": -1, "filename": "boolem-0.0.5.tar.gz", "has_sig": false, "md5_digest": "74043adf0feda10a68ca668d7a88f6c8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 3957, "upload_time": "2019-11-20T22:16:15", "upload_time_iso_8601": "2019-11-20T22:16:15.005944Z", "url": "https://files.pythonhosted.org/packages/7a/e1/bb7f87997e6efdc73654487eef5e311d9be77e1a84bcf9471c83dc07264b/boolem-0.0.5.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "69e1860cc05df2cb0cedef851523c5d5", "sha256": "c754583c93b5abbdc1cf488c4e0435c49161431e242ddfb9485d00acd34237b0" }, "downloads": -1, "filename": "boolem-0.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "69e1860cc05df2cb0cedef851523c5d5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4", "size": 6499, "upload_time": "2019-11-20T22:16:13", "upload_time_iso_8601": "2019-11-20T22:16:13.574825Z", "url": "https://files.pythonhosted.org/packages/33/20/275eb8b75414bacf143cc91decd0c7d43e60b603a407b04f05033732fe58/boolem-0.0.5-py3-none-any.whl", "yanked": false, "yanked_reason": null }, { "comment_text": "", "digests": { "md5": "74043adf0feda10a68ca668d7a88f6c8", "sha256": "3daebffa83d2f9a8ba30b3703d8add5196b6e8138ff9ac4b2c156077dc3ec6a7" }, "downloads": -1, "filename": "boolem-0.0.5.tar.gz", "has_sig": false, "md5_digest": "74043adf0feda10a68ca668d7a88f6c8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 3957, "upload_time": "2019-11-20T22:16:15", "upload_time_iso_8601": "2019-11-20T22:16:15.005944Z", "url": "https://files.pythonhosted.org/packages/7a/e1/bb7f87997e6efdc73654487eef5e311d9be77e1a84bcf9471c83dc07264b/boolem-0.0.5.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }