junshan-kit 2.2.8__py2.py3-none-any.whl → 2.2.9__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
@@ -11,7 +11,7 @@ import junshan_kit.DataProcessor
11
11
  import junshan_kit.kit
12
12
  from sklearn.preprocessing import StandardScaler
13
13
 
14
-
14
+ #----------------------------------------------------------
15
15
  def download_data(data_name):
16
16
  from junshan_kit.kit import JianguoyunDownloaderFirefox, JianguoyunDownloaderChrome
17
17
 
@@ -36,14 +36,7 @@ def download_data(data_name):
36
36
  else:
37
37
  print("❌ Invalid choice. Please enter 1 or 2.\n")
38
38
 
39
-
40
- def credit_card_fraud_detection(data_name = "Credit Card Fraud Detection", print_info = False):
41
-
42
- csv_path = f'./exp_data/{data_name}/creditcard.csv'
43
- drop_cols = []
44
- label_col = 'Class'
45
- label_map = {0: -1, 1: 1}
46
-
39
+ def run(csv_path, data_name, drop_cols, label_col, label_map, print_info):
47
40
  if not os.path.exists(csv_path):
48
41
  print('\n' + '*'*60)
49
42
  print(f"Please download the data.")
@@ -55,8 +48,72 @@ def credit_card_fraud_detection(data_name = "Credit Card Fraud Detection", print
55
48
  df = cleaner.preprocess_dataset(csv_path, drop_cols, label_col, label_map, print_info=print_info)
56
49
 
57
50
  return df
58
-
59
-
51
+
52
+ """
53
+ ----------------------------------------------------------------------
54
+ Datasets
55
+ ----------------------------------------------------------------------
56
+ """
57
+
58
+ def credit_card_fraud_detection(data_name = "Credit Card Fraud Detection", print_info = False):
59
+
60
+ csv_path = f'./exp_data/{data_name}/creditcard.csv'
61
+ drop_cols = []
62
+ label_col = 'diagnosed_diabetes'
63
+ label_map = {0: -1, 1: 1}
64
+
65
+ df = run(csv_path, data_name, drop_cols, label_col, label_map, print_info)
66
+
67
+ return df
68
+
69
+
70
+ def diabetes_health_indicators_dataset(data_name = "Diabetes Health Indicators Dataset", print_info = False):
71
+ csv_path = f'./exp_data/{data_name}/diabetes_dataset.csv'
72
+ drop_cols = []
73
+ label_col = 'Class'
74
+ label_map = {0: -1, 1: 1}
75
+
76
+ df = run(csv_path, data_name, drop_cols, label_col, label_map, print_info)
77
+
78
+ return df
79
+
80
+
81
+ def electric_vehicle_population_data(data_name = "Electric Vehicle Population Data", print_info = False):
82
+ csv_path = f'./exp_data/{data_name}/Electric_Vehicle_Population_Data.csv'
83
+ drop_cols = ['VIN (1-10)', 'DOL Vehicle ID', 'Vehicle Location']
84
+ label_col = 'Electric Vehicle Type'
85
+ label_map = {
86
+ 'Battery Electric Vehicle (BEV)': 1,
87
+ 'Plug-in Hybrid Electric Vehicle (PHEV)': -1
88
+ }
89
+
90
+ df = run(csv_path, data_name, drop_cols, label_col, label_map, print_info)
91
+
92
+ return df
93
+
94
+ def global_house_purchase_dataset(data_name = "Global House Purchase Dataset", print_info = False):
95
+ csv_path = f'./exp_data/{data_name}/global_house_purchase_dataset.csv'
96
+ drop_cols = ['property_id']
97
+ label_col = 'Electric Vehicle Type'
98
+ label_map = {0: -1, 1: 1}
99
+
100
+ df = run(csv_path, data_name, drop_cols, label_col, label_map, print_info)
101
+
102
+ return df
103
+
104
+
105
+ def health_lifestyle_dataset(data_name = "Health_lifestyle_dataset", print_info = False):
106
+ csv_path = f'./exp_data/{data_name}/health_lifestyle_dataset.csv'
107
+ drop_cols = ['id']
108
+ label_col = 'decision'
109
+ label_map = {0: -1, 1: 1}
110
+
111
+ df = run(csv_path, data_name, drop_cols, label_col, label_map, print_info)
112
+
113
+ return df
114
+
115
+
116
+
60
117
 
61
118
 
62
119
  def wine_and_food_pairing_dataset():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: junshan_kit
3
- Version: 2.2.8
3
+ Version: 2.2.9
4
4
  Summary: This is an optimization tool.
5
5
  Author-email: Junshan Yin <junshanyin@163.com>
6
6
  Requires-Dist: kaggle==1.7.4.5
@@ -0,0 +1,7 @@
1
+ junshan_kit/DataProcessor.py,sha256=eryVmS5BFZj8wjDN2QWVHqkbFgFuWU0HXV9s6TGf9QM,4442
2
+ junshan_kit/DataSets.py,sha256=BNlXUbsautITelxp35uHSYSq2bTbIbqLyQnmqapaeDc,3963
3
+ junshan_kit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ junshan_kit/kit.py,sha256=tB1TpW9hW1EweK1RQwHOdUo7uG1QU4vSeyR0fdaSydo,9569
5
+ junshan_kit-2.2.9.dist-info/METADATA,sha256=oIytayt1Z9OpFOJl8_7cYMl3li3KsphQfZDRqsqat8g,329
6
+ junshan_kit-2.2.9.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
7
+ junshan_kit-2.2.9.dist-info/RECORD,,
@@ -1,7 +0,0 @@
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.8.dist-info/METADATA,sha256=OUza_0O7PhWjTxldDhfSkJtdPn6eIgfFs1dJ9M7mg5I,329
6
- junshan_kit-2.2.8.dist-info/WHEEL,sha256=tkmg4JIqwd9H8mL30xA7crRmoStyCtGp0VWshokd1Jc,105
7
- junshan_kit-2.2.8.dist-info/RECORD,,