Changed typing accordingly

This commit is contained in:
tkgowtham 2024-10-02 20:03:34 +05:30 committed by GitHub
parent 7c76e5c992
commit d49fea0cc6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,7 +6,7 @@ LinkedIn : https://www.linkedin.com/in/gowtham-kamalasekar/
""" """
import math import math
from typing import dict, list from typing import Dict, List
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
import pandas as pd import pandas as pd
@ -39,20 +39,7 @@ class DbScan:
self, self,
minpts: int, minpts: int,
radius: int, radius: int,
file: str = ( file: str = "None",
{"x": 3, "y": 7},
{"x": 4, "y": 6},
{"x": 5, "y": 5},
{"x": 6, "y": 4},
{"x": 7, "y": 3},
{"x": 6, "y": 2},
{"x": 7, "y": 2},
{"x": 8, "y": 4},
{"x": 3, "y": 3},
{"x": 2, "y": 6},
{"x": 3, "y": 5},
{"x": 2, "y": 4},
),
) -> None: ) -> None:
""" """
Constructor Constructor
@ -85,10 +72,27 @@ class DbScan:
""" """
self.minpts = minpts self.minpts = minpts
self.radius = radius self.radius = radius
self.file = file self.file = (
file
if file != "None"
else (
{"x": 3, "y": 7},
{"x": 4, "y": 6},
{"x": 5, "y": 5},
{"x": 6, "y": 4},
{"x": 7, "y": 3},
{"x": 6, "y": 2},
{"x": 7, "y": 2},
{"x": 8, "y": 4},
{"x": 3, "y": 3},
{"x": 2, "y": 6},
{"x": 3, "y": 5},
{"x": 2, "y": 4},
)
)
self.dict1 = self.perform_dbscan() self.dict1 = self.perform_dbscan()
def perform_dbscan(self) -> dict[int, list[int]]: def perform_dbscan(self) -> Dict[int, List[int]]:
""" """
Args: Args:
----------- -----------