GithubHelp home page GithubHelp logo

saham_ml's Introduction

Deployment Model Regresi Linier

Deskripsi singkat

Repository ini berisi semua file yang dibutuhkan untuk melakukan deployment model Machine Learning Regresi Linier. Adapun model yang digunakan merupakan model untuk memprediksi biaya asuransi berdasarkan:

  • Age atau usia dengan tipe data integer (bilangan bulat)
  • Sex atau jenis kelamin yakni Male atau Female
  • Smoker atau status perokok yakni Yes atau No

Sekilas mengenai input model

Agar dapat memprediksi biaya asuransi, data input model harus mengikuti format sebagai berikut:
[Age, Sex(Female), Sex(Male), Smoker(No), Smoker(Yes)]

Sebagai contoh:
Age: 20
Sex: Male
Smoker: No

Akan diubah menjadi:
[20, 0, 1, 1, 0]

Folder, file, dan kegunaannya

  • templates/
    • index.html --> Berisi template website
  • app.py --> Berisi konfigurasi route untuk API
  • model.pkl --> Model Regresi Linier yang sudah di-training
  • request.py --> Berisi percobaan pemanggilan API dengan payload data JSON
  • requirements.txt --> Berisi daftar dependency/package Python yang diperlukan untuk menjalankan API dan model Regresi Linier

Cara menjalankan API pada komputer Anda

Menjalankan API

  1. Pastikan Anda sudah menginstall Anaconda
  2. Buka terminal/command prompt/power shell
  3. Buat virtual environment dengan
    conda create -n <nama-environment> python=3.9
  4. Aktifkan virtual environment dengan
    conda activate <nama-environment>
  5. Install semua dependency/package Python dengan
    pip install -r requirements.txt
  6. Jalankan API menggunakan perintah
    python app.py

Akses melalui Website

Setelah API berjalan:

  1. Anda akan diberikan URL untuk membuka website berupa localhost:5000/ atau 127.0.0.1:5000/
  2. Buka URL dengan browser, coba masukkan data yang ingin di prediksi
  3. Anda akan diberikan estimasi biaya asuransi pada sisi kanan halaman website

Mencoba Akses API menggunakan payload JSON

Setelah API berjalan:

  1. Buka terminal/comand prompt/power shell
  2. Jalankan perintah python request.py
  3. Setelah berhasil dieksekusi, Anda akan diberikan data response berupa JSON juga seperti contoh berikut:
    {'Age': 20, 'Insurance Cost': 3146.79, 'Sex': 'Male', 'Smoker': 'No'}
  4. Hasil prediksi biaya asuransi terdapat pada value dari key 'Insurance Cost' yang dapat Anda manfaatkan untuk aplikasi lain.

saham_ml's People

Contributors

anandanug avatar danilmuis avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.