Skip to main content

No project description provided

Project description

DFFML Scratch Models

About

Models created without a machine learning framework.

Install

python3.7 -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 -features def:Years:int:1 -model-predict Salary -sources f=csv -source-filename dataset.csv -source-readonly -log debug
$ dffml accuracy -model scratchslr -features def:Years:int:1 -model-predict Salary -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 -features def:Years:int:1 -model-predict Salary -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
        },
        "src_url": "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.0.2.tar.gz (6.1 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: dffml-model-scratch-0.0.2.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for dffml-model-scratch-0.0.2.tar.gz
Algorithm Hash digest
SHA256 36b9a10a9c6a08dcb4ef7415884ba978f548178c971b6f8cf0779866196c8316
MD5 b8fc09baebfa5e8b28faf62b14e393a3
BLAKE2b-256 18335ef04c3085c0cc0ca1b1309078273a15d4ee5324f00b7c7583852cf4d063

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