Skip to content

Commit

Permalink
Fish and Digit are subclasses of DataPoint
Browse files Browse the repository at this point in the history
  • Loading branch information
davecom committed May 8, 2024
1 parent 1209dfb commit 3b8a75d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
13 changes: 13 additions & 0 deletions KNN/datasets/fish/license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This data is from a data set collected in 1917. It should be in the public domain. The original reference is:
Brofeldt, Pekka: Bidrag till kaennedom on fiskbestondet i vaara sjoear. Laengelmaevesi. T.H.Jaervi: Finlands Fiskeriet Band 4, Meddelanden utgivna av fiskerifoereningen i Finland. Helsingfors 1917

The data was later included in a compilation you can find out more about at:
https://jse.amstat.org/jse_data_archive.htm

It was submitted to the collection by:
Juha Puranen
Departement of statistics
PL33 (Aleksanterinkatu 7)
000014 University of Helsinki
Finland
e-mail: [email protected]
3 changes: 2 additions & 1 deletion KNN/digit.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from dataclasses import dataclass
from KNN.knn import DataPoint
from typing import Self
import numpy as np


@dataclass
class Digit:
class Digit(DataPoint):
kind: str
pixels: np.ndarray

Expand Down
3 changes: 2 additions & 1 deletion KNN/fish.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
from dataclasses import dataclass
from KNN.knn import DataPoint
from typing import Self


@dataclass
class Fish:
class Fish(DataPoint):
kind: str
weight: float
length1: float
Expand Down
2 changes: 1 addition & 1 deletion tests/test_knn.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.
#
# DESCRIPTION
# Tries running multiple different tests to verify the correctness of our emulator.
# Tries running multiple different tests to verify the correctness of our KNN implementation.
import unittest
import os
import csv
Expand Down

0 comments on commit 3b8a75d

Please sign in to comment.