{ "info": { "author": "Sergio", "author_email": "sergio@holvi.com", "bugtrack_url": null, "classifiers": [], "description": "# Django-Learn\n### A simplistic SciKitLearn Machine learning model persistence layer for django.\n\n[![Build Status](https://travis-ci.org/open-holvi/djangolearn.svg?branch=master)](https://travis-ci.org/open-holvi/djangolearn) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/bd14b53e401548eb8324afa414f15f9c)](https://www.codacy.com/app/sergio_4/djangolearn?utm_source=github.com&utm_medium=referral&utm_content=open-holvi/djangolearn&utm_campaign=Badge_Grade)\n\n## Basic Usage\n```py\nfrom sklearn import svm\nfrom sklearn import datasets\nfrom djangolearn.models import SciKitLearnModel\n\niris = datasets.load_iris()\n\nclass IrisModel(SciKitLearnModel):\n\n def train(self, X, Y):\n clf = svm.SVC()\n\n clf.fit(X, Y)\n self.store(clf)\n\n def evaluate(self, x):\n # This is an example. Don't do this at request time\n # Loading the model takes a bit\n restored = self.restore()\n restored_results = restored.predict(x)\n\nX, y = iris.data, iris.target\n\ninstance = IrisModel.objects.create()\ninstance.train(X, y)\ninstance.evaluate(X[0:1])\n```\n\n## Storage:\n\nDjango Learn uses [Django Storages](https://github.com/jschneier/django-storages)\n\nIf you want to specify a different storage system than the default one,\nspecify it through the setting:\n\n```py\nDJANGOLEARN_STORAGE = 'storages.backends.s3boto.S3BotoStorage'\n```\n\nNote that you will need to do the configuration management mentioned in the\nDjango Storage page.\n\n## What's under the hood?\n\nOne simple solution would be to Pickle the model. [That's quite insecure](http://pyvideo.org/pycon-us-2014/pickles-are-for-delis-not-software.html).\nFor that reason we use joblib to store the models. There's a bit of validation sauce,\nlike making sure that the scikit version is the same as the one used to\ntrain the system. There is also the option to specify the version of the\ncode/library used to pre-process the data, so that train data and evaluation\ndata have the same features.\n\n## Security\nEvery object de-serialization is dangerous. Only store models you trust and\nkeep your model storage secure.\nWe try to make basic validations of the models, but python can only go so far. Use at your own risk.\n\n## Performance\nThis is supposed to be an MVP for small jobs, and for playing around with machine learning in Django.\nLoading models at request time is not recomemdend.\n\n## Requirements\n* Python 2.7 3.4 3.5\n* Django > 1.7 (tests being deprecated for 1.7)\n* SciKitLearn >= 0.15\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "djangolearn", "package_url": "https://pypi.org/project/djangolearn/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/djangolearn/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/djangolearn/0.1/", "requires_dist": null, "requires_python": null, "summary": "UNKNOWN", "version": "0.1" }, "last_serial": 2493873, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "3dced9242a64a572786c667a6a755d71", "sha256": "e20cffbfae5e0f3b22cd0fbebdf4c92a6561cb59efccce84cff51972bb6d47d2" }, "downloads": -1, "filename": "djangolearn-0.1.tar.gz", "has_sig": false, "md5_digest": "3dced9242a64a572786c667a6a755d71", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25444, "upload_time": "2016-12-01T14:47:59", "url": "https://files.pythonhosted.org/packages/5a/a3/cbea4efb4d2ecbcf5c0db38ae976e63a3992705384f3faba107941524bbe/djangolearn-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3dced9242a64a572786c667a6a755d71", "sha256": "e20cffbfae5e0f3b22cd0fbebdf4c92a6561cb59efccce84cff51972bb6d47d2" }, "downloads": -1, "filename": "djangolearn-0.1.tar.gz", "has_sig": false, "md5_digest": "3dced9242a64a572786c667a6a755d71", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25444, "upload_time": "2016-12-01T14:47:59", "url": "https://files.pythonhosted.org/packages/5a/a3/cbea4efb4d2ecbcf5c0db38ae976e63a3992705384f3faba107941524bbe/djangolearn-0.1.tar.gz" } ] }