junshan-kit 2.2.6__py2.py3-none-any.whl → 2.2.7__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
junshan_kit/DataSets.py
CHANGED
@@ -12,7 +12,7 @@ import junshan_kit.kit
|
|
12
12
|
from sklearn.preprocessing import StandardScaler
|
13
13
|
|
14
14
|
|
15
|
-
def download_data():
|
15
|
+
def download_data(data_name):
|
16
16
|
from junshan_kit.kit import JianguoyunDownloaderFirefox, JianguoyunDownloaderChrome
|
17
17
|
|
18
18
|
# User selects download method
|
@@ -26,20 +26,20 @@ def download_data():
|
|
26
26
|
choice = input("Enter the number of your choice (1 or 2): ").strip()
|
27
27
|
|
28
28
|
if choice == "1":
|
29
|
-
JianguoyunDownloaderFirefox(url
|
29
|
+
JianguoyunDownloaderFirefox(url, f"./exp_data/{data_name}").run()
|
30
30
|
print("✅ Download completed using Firefox")
|
31
31
|
break
|
32
32
|
elif choice == "2":
|
33
|
-
JianguoyunDownloaderChrome(url
|
33
|
+
JianguoyunDownloaderChrome(url, f"./exp_data/{data_name}").run()
|
34
34
|
print("✅ Download completed using Chrome")
|
35
35
|
break
|
36
36
|
else:
|
37
37
|
print("❌ Invalid choice. Please enter 1 or 2.\n")
|
38
38
|
|
39
39
|
|
40
|
-
def credit_card_fraud_detection(data_name = "Credit Card Fraud Detection"):
|
40
|
+
def credit_card_fraud_detection(data_name = "Credit Card Fraud Detection", print_info = False):
|
41
41
|
|
42
|
-
csv_path = f'./exp_data/{data_name}
|
42
|
+
csv_path = f'./exp_data/{data_name}/creditcard.csv'
|
43
43
|
drop_cols = []
|
44
44
|
label_col = 'Class'
|
45
45
|
label_map = {0: -1, 1: 1}
|
@@ -48,28 +48,15 @@ def credit_card_fraud_detection(data_name = "Credit Card Fraud Detection"):
|
|
48
48
|
print('\n' + '*'*60)
|
49
49
|
print(f"Please download the data.")
|
50
50
|
print(csv_path)
|
51
|
-
download_data()
|
51
|
+
download_data(data_name)
|
52
52
|
junshan_kit.kit.unzip_file(f'./exp_data/{data_name}/{data_name}.zip', f'./exp_data/{data_name}')
|
53
53
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
54
|
cleaner = junshan_kit.DataProcessor.CSV_TO_Pandas()
|
62
|
-
cleaner.preprocess_dataset(csv_path, drop_cols, label_col, label_map)
|
63
|
-
|
55
|
+
df = cleaner.preprocess_dataset(csv_path, drop_cols, label_col, label_map, print_info=print_info)
|
64
56
|
|
65
|
-
|
57
|
+
return df
|
58
|
+
|
66
59
|
|
67
|
-
dataloader = junshan_kit.DataProcessor.CSV_TO_Pandas()
|
68
|
-
dataloader.preprocess_dataset()
|
69
|
-
# Step 0: Load the dataset
|
70
|
-
csv_path = "creditcard.csv"
|
71
|
-
df = pd.read_csv(csv_path)
|
72
|
-
|
73
60
|
|
74
61
|
|
75
62
|
def wine_and_food_pairing_dataset():
|
@@ -0,0 +1,7 @@
|
|
1
|
+
junshan_kit/DataProcessor.py,sha256=eryVmS5BFZj8wjDN2QWVHqkbFgFuWU0HXV9s6TGf9QM,4442
|
2
|
+
junshan_kit/DataSets.py,sha256=QOpHAJkDLWBXP31cG8BStrXZITJEBiTCB1brmAy4TBQ,1985
|
3
|
+
junshan_kit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
+
junshan_kit/kit.py,sha256=tB1TpW9hW1EweK1RQwHOdUo7uG1QU4vSeyR0fdaSydo,9569
|
5
|
+
junshan_kit-2.2.7.dist-info/METADATA,sha256=LNjAHPrUu_tJs4HrYk2fyC-3GSb3UQj1c_4WIVYv7Wo,329
|
6
|
+
junshan_kit-2.2.7.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
|
7
|
+
junshan_kit-2.2.7.dist-info/RECORD,,
|
@@ -1,7 +0,0 @@
|
|
1
|
-
junshan_kit/DataProcessor.py,sha256=eryVmS5BFZj8wjDN2QWVHqkbFgFuWU0HXV9s6TGf9QM,4442
|
2
|
-
junshan_kit/DataSets.py,sha256=jaKB5kh1pOR-o97hab2G2r_YfH69Bs4zR2CkiOfpyss,2085
|
3
|
-
junshan_kit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
-
junshan_kit/kit.py,sha256=tB1TpW9hW1EweK1RQwHOdUo7uG1QU4vSeyR0fdaSydo,9569
|
5
|
-
junshan_kit-2.2.6.dist-info/METADATA,sha256=CqdL1Yui6UbnUt5teWg0EpYP8ofCdviwWK8EkM_MuKw,329
|
6
|
-
junshan_kit-2.2.6.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
|
7
|
-
junshan_kit-2.2.6.dist-info/RECORD,,
|
File without changes
|