Skip to main content

growable fish classifier, KNN

Project description

fishKNN

물고기의 길이와 무게를 입력하면 해당 물고기가 도미인지 빙어인지 예측하는 프로그램입니다. 예측 후에는 해당 예측이 맞았는지 확인하며, 해당 데이터를 csv로 저장하고 다시 학습을 진행하는 진화형 KNN 프로그램입니다.

Versions

  • 0.5.x : project init publish. predict & get-pkl.
  • 1.2.x : help msg added.
  • 2.0.x : scatter plot added.
  • 3.0.x : common.py added (remove duplicated code)

Installation

$ pip install growKNN4fish

Usage

$ fish-help      # 사용가능한 CLI Command를 출력합니다.
    ╭──────────────────────── 사용할  있는 CLI Command ───────────────────────╮
                                                                                    $ fish-predict    # 길이와 무게를 입력받아 물고기의 종류를 예측합니다.    │
     $ show-data       # 저장된 csv파일을 DataFrame형식으로 출력합니다.        │
     $ get-pkl         # 저장된 pkl파일을 원하는 위치로 복사합니다.            │
     $ draw-plot       # 저장된 csv파일을 scatter plot으로 출력합니다.         │
                                                                                   ╰───────────────────────────────────────────────────────────────────────────╯

$ fish-predict   # 길이와 무게를 입력하면 물고기의 종류를 예측합니다.
🆕 물고기의 길이를 입력하세요(cm) :
🆕 물고기의 무게를 입력하세요(kg) :
🆕 도미가 맞나요? (y/n) y 또는 n으로 답해주세요.    # y, n(대소문자 구분X) 외의 값을 입력할 경우 발생. 올바른 값을 입력할 때까지 반복.

🆕 훈련을 시작합니다.
#### scatter plot 출력 (>=v2.0.0)
     ┌─────────────────────────────────────────────────────┐
 2.02┤                                                    *│
                                                                                                                     1.56┤                                                                                                                                                                                                                         *          1.10┤                                          *                                                                                                                               0.63┤                                                                                                                                                                          0.17┤                                                            *                                                                                                                                                                      │
-0.29┤                                                                                                                                                                         │
-0.75┤* *                                                       └┬────────────┬────────────┬────────────┬────────────┬┘
    -0.74        -0.10        0.54         1.18        1.82
Weight                       Length
⛔ 충분한 데이터가 없습니다.    # csv에 저장된 데이터가 1개인 경우
🆕 훈련을 종료합니다. (훈련시간 : 0초)

$ get-pkl   # model.pkl 파일을 원하는 위치에 저장합니다. 추후 테스트를 위해 pkl파일을 가져오기 위한 프로그램입니다.
🆕 pkl파일을 저장할 경로를 입력해주세요(현재 경로기준 상대경로)
 >>> /home/root2/hw/fishKNN/

⛔ 훈련된 pkl파일이 없습니다.       # 저장된 pkl파일이 없는 경우 발생. 모델 훈련  다시 확인해주세요.
$ show-data # 지금까지 저장된 csv를 DataFrame형태로 출력
   Length  Weight Label
0    35.0   700.0    도미
1    31.5   500.0    도미

⛔ 저장된 데이터가 없습니다.    # 저장된 csv가 없는 경우

$ draw-plot # 지금까지 저장된 csv를 scatter plot으로 출력
     ┌─────────────────────────────────────────────────────┐
 2.02┤                                                    *│
                                                                                                                     1.56┤                                                                                                                                                                                                                         *          1.10┤                                          *                                                                                                                               0.63┤                                                                                                                                                                          0.17┤                                                            *                                                                                                                                                                      │
-0.29┤                                                                                                                                                                         │
-0.75┤* *                                                       └┬────────────┬────────────┬────────────┬────────────┬┘
    -0.74        -0.10        0.54         1.18        1.82
Weight                       Length

Dependency

pandas>=2.2.2

scikit-learn>=1.5.1

plotext>=5.2.8

License

  • MIT

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

growknn4fish-3.1.1.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

growKNN4fish-3.1.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file growknn4fish-3.1.1.tar.gz.

File metadata

  • Download URL: growknn4fish-3.1.1.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.18.1 CPython/3.11.9 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for growknn4fish-3.1.1.tar.gz
Algorithm Hash digest
SHA256 112938464690d08cd71cc837f91232815b7c9bcd033892ef33db0fb439fc17dc
MD5 081d9538490d9eda620b49484cbb72dd
BLAKE2b-256 d5082248d08d674f3b63d7a69cedf0f56054662671c4c3adffb3a53a16ca4e4c

See more details on using hashes here.

File details

Details for the file growKNN4fish-3.1.1-py3-none-any.whl.

File metadata

  • Download URL: growKNN4fish-3.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.18.1 CPython/3.11.9 Linux/5.15.153.1-microsoft-standard-WSL2

File hashes

Hashes for growKNN4fish-3.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 abbd8b1e6f826ce6d4e891c68464e6f013f488f2d1425a2e48d336a0d455e039
MD5 05b4989fea9734b39e00b5b1199b149b
BLAKE2b-256 fd1731bbe64152d05df158e072dcd3810a051bdd898962473ce327b7f138b7f3

See more details on using hashes here.

Supported by

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