{ "info": { "author": "Andrew Ross", "author_email": "andrewslavinross@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "Object-Oriented Decision Trees\n==============================\n\nThis repository will contain several variants of decision tree /\nensemble classification algorithms, written in an object-oriented style.\nMy immediate goal is to try to reproduce some of the results from `this\npaper `__ on canonical correlation\nforests, which I am testing against `the same\ndatasets `__.\n\nWhere possible, external parameters names will match ``scikit-learn``'s\nimplementations of `decision\ntrees `__\nand `random\nforests `__.\n\nUsage\n-----\n\nOne major difference from ``scikit-learn`` is that datasets and their\nattributes are treated as first-class objects. Additionally, all\nclassifiers must be initialized with their training dataset (as opposed\nto calling ``fit``).\n\n.. code:: python\n\n from oo_trees.dataset import Dataset\n from oo_trees.decision_tree import DecisionTree\n from oo_trees.random_forest import RandomForest\n\n X = examples # numpy 2D numeric array\n y = outcomes # numpy 1D array\n\n dataset = Dataset(X, y)\n\n training_dataset, test_dataset = dataset.random_split(0.75)\n\n d_tree = DecisionTree(training_dataset)\n forest = RandomForest(training_dataset)\n\n print(d_tree.classify(test_dataset.X[0]))\n print(forest.classify(test_dataset.X[0]))\n\n d_tree_confusion_matrix = d_tree.performance_on(test_dataset)\n forest_confusion_matrix = forest.performance_on(test_dataset)\n\n print(d_tree_confusion_matrix.accuracy)\n print(forest_confusion_matrix.accuracy)\n\nWhen initializing datasets, we assume all attributes of the training\nexamples are categorical. If that is not the case, you can pass in an\nadditional ``attribute_types`` variable on initialize:\n\n.. code:: python\n\n from oo_trees.dataset import Dataset\n from oo_trees.attribute import NumericAttribute, CategoricalAttribute\n\n X = examples\n y = outcomes\n\n attributes = [\n NumericAttribute(index=0, name='age'),\n CategoricalAttribute(index=1, name='sex'),\n NumericAttribute(index=2, name='income')\n ]\n\n dataset = Dataset(X, y, attributes)\n\nThe logic for finding the best split is differs for each attribute type,\nand in the future there may be additional type-specific parameters (such\nas importance or number-to-name mappings) useful for classification or\ndisplay.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/asross/oo_trees", "keywords": null, "license": "Apache Software License", "maintainer": null, "maintainer_email": null, "name": "oo_trees", "package_url": "https://pypi.org/project/oo_trees/", "platform": "any", "project_url": "https://pypi.org/project/oo_trees/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/asross/oo_trees" }, "release_url": "https://pypi.org/project/oo_trees/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "Object-oriented implementations of decision tree variants", "version": "0.0.1" }, "last_serial": 1900284, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "a77b1b32863e724b09484c9c85570e12", "sha256": "f67442d6b872e51a338791e0612210b7c9ba111b0e32efa738b5a90f6ddb7557" }, "downloads": -1, "filename": "oo_trees-0.0.1.tar.gz", "has_sig": false, "md5_digest": "a77b1b32863e724b09484c9c85570e12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3938, "upload_time": "2016-01-11T18:33:57", "url": "https://files.pythonhosted.org/packages/ef/60/e5f388298fd023b70d8b9d1aa053089ca8ced85ee6bab5447ef941eb16bf/oo_trees-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a77b1b32863e724b09484c9c85570e12", "sha256": "f67442d6b872e51a338791e0612210b7c9ba111b0e32efa738b5a90f6ddb7557" }, "downloads": -1, "filename": "oo_trees-0.0.1.tar.gz", "has_sig": false, "md5_digest": "a77b1b32863e724b09484c9c85570e12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3938, "upload_time": "2016-01-11T18:33:57", "url": "https://files.pythonhosted.org/packages/ef/60/e5f388298fd023b70d8b9d1aa053089ca8ced85ee6bab5447ef941eb16bf/oo_trees-0.0.1.tar.gz" } ] }