Skip to main content

No project description provided

Project description

DFFML Scratch Models

About

Models created without a machine learning framework.

Install

$ python3 -m pip install --user dffml-model-scratch

Usage

If we have a dataset of years of experience in a job and the Salary (in thousands) at that job we can use the Simple Linear Regression model to predict a salary given the years of experience (or the other way around).

First we create the file containing the dataset. Then we train the model, get its accuracy. And using echo pipe a new csv file of data to predict into the model, and it will give us it prediction of the Salary.

$ cat > dataset.csv << EOF
Years,Salary
1,40
2,50
3,60
4,70
5,80
EOF
$ dffml train -model scratchslr -model-features Years:int:1 -model-predict Salary -model-directory tempdir -sources f=csv -source-filename dataset.csv -source-readonly -log debug
$ dffml accuracy -model scratchslr -model-features Years:int:1 -model-predict Salary -model-directory tempdir -sources f=csv -source-filename dataset.csv -source-readonly -log debug
1.0
$ echo -e 'Years,Salary\n6,0\n' | dffml predict all -model scratchslr -model-features Years:int:1 -model-predict Salary -model-directory tempdir -sources f=csv -source-filename /dev/stdin -source-readonly -log debug
[
    {
        "extra": {},
        "features": {
            "Salary": 0,
            "Years": 6
        },
        "last_updated": "2019-07-19T09:46:45Z",
        "prediction": {
            "confidence": 1.0,
            "value": 90.0
        },
        "key": "0"
    }
]

License

Scratch Models are distributed under the terms of the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dffml-model-scratch-0.1.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

dffml_model_scratch-0.1.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file dffml-model-scratch-0.1.0.tar.gz.

File metadata

  • Download URL: dffml-model-scratch-0.1.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.7

File hashes

Hashes for dffml-model-scratch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 cffad1b139bb8b88b71c92210abda5ebbf40233af78a24f47b1794e7d1a6f1ec
MD5 e0b30d95c3da266f7338b4870abd779e
BLAKE2b-256 b08b6f587ebfa32fcc57373f6badee04d39ae4eb9eca7ebfa205458fdd08c09f

See more details on using hashes here.

File details

Details for the file dffml_model_scratch-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dffml_model_scratch-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.8.7

File hashes

Hashes for dffml_model_scratch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1851749b3f94521d99599513f9109261555fb02864b6e4cfc4fcbb4520f183e4
MD5 6fb2dc6212b235e3b318a33ba4dfab42
BLAKE2b-256 b0ebecccc6e7f9383c0aeb9bcd429bdc2c2a5c1d105aa7cd722e615c4a57a6a2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page