Skip to main content

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

Release files for growKNN4fish 3.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for growKNN4fish 3.1.1
File Size Uploaded
growknn4fish-3.1.1.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for growKNN4fish 3.1.1
File Interpreter ABI Platform
growKNN4fish-3.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.4 kB

Release files / growknn4fish-3.1.1.tar.gz

Download URL growknn4fish-3.1.1.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
112938464690d08cd71cc837f91232815b7c9bcd033892ef33db0fb439fc17dc
BLAKE2b-256 checksum
How to use checksums
d5082248d08d674f3b63d7a69cedf0f56054662671c4c3adffb3a53a16ca4e4c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.18.1 CPython/3.11.9 Linux/5.15.153.1-microsoft-standard-WSL2

Release files / growKNN4fish-3.1.1-py3-none-any.whl

Download URL growKNN4fish-3.1.1-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abbd8b1e6f826ce6d4e891c68464e6f013f488f2d1425a2e48d336a0d455e039
BLAKE2b-256 checksum
How to use checksums
fd1731bbe64152d05df158e072dcd3810a051bdd898962473ce327b7f138b7f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.18.1 CPython/3.11.9 Linux/5.15.153.1-microsoft-standard-WSL2

Release history Release notifications | RSS feed

This release

3.1.1 This release

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page