model-wrapper


Namemodel-wrapper JSON
Version 0.3.9 PyPI version JSON
download
home_pagehttps://gitee.com/summry/model-wrapper
SummaryModel wrapper for Pytorch, which can training, predict, evaluate, etc.
upload_time2024-12-19 03:58:38
maintainerNone
docs_urlNone
authorsummy
requires_python>=3.6
licenseNone
keywords pytorch training ai machine learning deep learning torch
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Usage Sample
''''''''''''

.. code:: python

        from model_wrapper import SplitClassModelWrapper

        classes = ['class1', 'class2', 'class3'...]
        X = [[...], [...],]
        y = [0, 0, 1, 2, 1...]

        model = ...
        wrapper = SplitClassModelWrapper(model, classes=classes)
        wrapper.train(X, y, val_size=0.2)

        X_test = [[...], [...],]
        y_test = [0, 1, 1, 2, 1...]
        result = wrapper.evaluate(X_test, y_test)
        # 0.953125

        result = wrapper.predict(X_test)
        # [0, 1]

        result = wrapper.predict_classes(X_test)
        # ['class1', 'class2']

        result = wrapper.predict_proba(X_test)
        # ([0, 1], array([0.99439645, 0.99190724], dtype=float32))

        result = wrapper.predict_classes_proba(X_test)
        # (['class1', 'class2'], array([0.99439645, 0.99190724], dtype=float32))



            

Raw data

            {
    "_id": null,
    "home_page": "https://gitee.com/summry/model-wrapper",
    "name": "model-wrapper",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "Pytorch, Training, AI, Machine learning, Deep learning, torch",
    "author": "summy",
    "author_email": "fkfkfk2024@2925.com",
    "download_url": "https://files.pythonhosted.org/packages/70/46/4a7c8db42d8250221cdffc412ad31341e81eaf519b86d90500320078c5a7/model-wrapper-0.3.9.tar.gz",
    "platform": null,
    "description": "Usage Sample\n''''''''''''\n\n.. code:: python\n\n        from model_wrapper import SplitClassModelWrapper\n\n        classes = ['class1', 'class2', 'class3'...]\n        X = [[...], [...],]\n        y = [0, 0, 1, 2, 1...]\n\n        model = ...\n        wrapper = SplitClassModelWrapper(model, classes=classes)\n        wrapper.train(X, y, val_size=0.2)\n\n        X_test = [[...], [...],]\n        y_test = [0, 1, 1, 2, 1...]\n        result = wrapper.evaluate(X_test, y_test)\n        # 0.953125\n\n        result = wrapper.predict(X_test)\n        # [0, 1]\n\n        result = wrapper.predict_classes(X_test)\n        # ['class1', 'class2']\n\n        result = wrapper.predict_proba(X_test)\n        # ([0, 1], array([0.99439645, 0.99190724], dtype=float32))\n\n        result = wrapper.predict_classes_proba(X_test)\n        # (['class1', 'class2'], array([0.99439645, 0.99190724], dtype=float32))\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Model wrapper for Pytorch, which can training, predict, evaluate, etc.",
    "version": "0.3.9",
    "project_urls": {
        "Homepage": "https://gitee.com/summry/model-wrapper"
    },
    "split_keywords": [
        "pytorch",
        " training",
        " ai",
        " machine learning",
        " deep learning",
        " torch"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "70464a7c8db42d8250221cdffc412ad31341e81eaf519b86d90500320078c5a7",
                "md5": "1ffbc43f1926a18748755594f52578b8",
                "sha256": "bb3d24889f530ea4797dd660f2fb11a3dc35f7c8ed8449dffdd5967f64f1c047"
            },
            "downloads": -1,
            "filename": "model-wrapper-0.3.9.tar.gz",
            "has_sig": false,
            "md5_digest": "1ffbc43f1926a18748755594f52578b8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 15020,
            "upload_time": "2024-12-19T03:58:38",
            "upload_time_iso_8601": "2024-12-19T03:58:38.964539Z",
            "url": "https://files.pythonhosted.org/packages/70/46/4a7c8db42d8250221cdffc412ad31341e81eaf519b86d90500320078c5a7/model-wrapper-0.3.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-19 03:58:38",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "model-wrapper"
}
        
Elapsed time: 0.42924s