randomclassifier 0.1.2__tar.gz → 0.1.4__tar.gz

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.

Potentially problematic release.


This version of randomclassifier might be problematic. Click here for more details.

Files changed (43) hide show
  1. randomclassifier-0.1.4/MANIFEST.in +2 -0
  2. randomclassifier-0.1.4/PKG-INFO +45 -0
  3. randomclassifier-0.1.4/README.md +32 -0
  4. {randomclassifier-0.1.2 → randomclassifier-0.1.4}/pyproject.toml +5 -2
  5. randomclassifier-0.1.4/src/dl_lab/__init__.py +17 -0
  6. randomclassifier-0.1.4/src/dl_lab/data.py +3 -0
  7. randomclassifier-0.1.4/src/dl_lab/datasets/autoencoder_demo.npz +0 -0
  8. randomclassifier-0.1.4/src/dl_lab/datasets/fraud_demo.csv +41 -0
  9. randomclassifier-0.1.4/src/dl_lab/datasets/freesound_community-speech-female_hpsmodel-85388.mp3 +0 -0
  10. randomclassifier-0.1.4/src/dl_lab/datasets/freesound_community-speech-female_hpsmodel-85388.wav +0 -0
  11. randomclassifier-0.1.4/src/dl_lab/datasets/images.jpg +0 -0
  12. randomclassifier-0.1.4/src/dl_lab/datasets/sample_image.jpg +0 -0
  13. randomclassifier-0.1.4/src/dl_lab/datasets/share_data.csv +101 -0
  14. randomclassifier-0.1.4/src/dl_lab/datasets/traffic_sample.jpg +0 -0
  15. randomclassifier-0.1.4/src/dl_lab/datasets/transactions.csv +101 -0
  16. randomclassifier-0.1.4/src/dl_lab/datasets/xor.csv +5 -0
  17. {randomclassifier-0.1.2 → randomclassifier-0.1.4}/src/dl_lab/programs.py +40 -16
  18. randomclassifier-0.1.4/src/randomclassifier/__init__.py +46 -0
  19. randomclassifier-0.1.4/src/randomclassifier/data.py +141 -0
  20. randomclassifier-0.1.4/src/randomclassifier/datasets/autoencoder_demo.npz +0 -0
  21. randomclassifier-0.1.4/src/randomclassifier/datasets/fraud_demo.csv +41 -0
  22. randomclassifier-0.1.4/src/randomclassifier/datasets/freesound_community-speech-female_hpsmodel-85388.mp3 +0 -0
  23. randomclassifier-0.1.4/src/randomclassifier/datasets/freesound_community-speech-female_hpsmodel-85388.wav +0 -0
  24. randomclassifier-0.1.4/src/randomclassifier/datasets/images.jpg +0 -0
  25. randomclassifier-0.1.4/src/randomclassifier/datasets/sample_image.jpg +0 -0
  26. randomclassifier-0.1.4/src/randomclassifier/datasets/share_data.csv +101 -0
  27. randomclassifier-0.1.4/src/randomclassifier/datasets/traffic_sample.jpg +0 -0
  28. randomclassifier-0.1.4/src/randomclassifier/datasets/transactions.csv +101 -0
  29. randomclassifier-0.1.4/src/randomclassifier/datasets/xor.csv +5 -0
  30. randomclassifier-0.1.4/src/randomclassifier.egg-info/PKG-INFO +45 -0
  31. randomclassifier-0.1.4/src/randomclassifier.egg-info/SOURCES.txt +34 -0
  32. randomclassifier-0.1.2/PKG-INFO +0 -27
  33. randomclassifier-0.1.2/README.md +0 -14
  34. randomclassifier-0.1.2/src/dl_lab/__init__.py +0 -7
  35. randomclassifier-0.1.2/src/dl_lab/data.py +0 -9
  36. randomclassifier-0.1.2/src/randomclassifier/__init__.py +0 -26
  37. randomclassifier-0.1.2/src/randomclassifier.egg-info/PKG-INFO +0 -27
  38. randomclassifier-0.1.2/src/randomclassifier.egg-info/SOURCES.txt +0 -12
  39. {randomclassifier-0.1.2 → randomclassifier-0.1.4}/setup.cfg +0 -0
  40. {randomclassifier-0.1.2 → randomclassifier-0.1.4}/src/randomclassifier/programs.py +0 -0
  41. {randomclassifier-0.1.2 → randomclassifier-0.1.4}/src/randomclassifier.egg-info/dependency_links.txt +0 -0
  42. {randomclassifier-0.1.2 → randomclassifier-0.1.4}/src/randomclassifier.egg-info/requires.txt +0 -0
  43. {randomclassifier-0.1.2 → randomclassifier-0.1.4}/src/randomclassifier.egg-info/top_level.txt +0 -0
@@ -0,0 +1,2 @@
1
+ recursive-include src/randomclassifier/datasets *
2
+ recursive-include src/dl_lab/datasets *
@@ -0,0 +1,45 @@
1
+ Metadata-Version: 2.4
2
+ Name: randomclassifier
3
+ Version: 0.1.4
4
+ Summary: Deep learning laboratory programs, datasets, and reusable classifiers
5
+ Requires-Python: >=3.10
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: numpy>=1.24
8
+ Requires-Dist: pandas>=2.0
9
+ Requires-Dist: scikit-learn>=1.3
10
+ Requires-Dist: tensorflow>=2.13
11
+ Requires-Dist: jupyter>=1.0
12
+ Requires-Dist: matplotlib>=3.7
13
+
14
+ # Deep Learning Laboratory Classifier & Datasets (`randomclassifier`)
15
+
16
+ This package provides instant access to Deep Learning Lab programs, source codes, and associated datasets.
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ pip install --upgrade randomclassifier
22
+ ```
23
+
24
+ ## Quick Start
25
+
26
+ ```python
27
+ from randomclassifier import models, model, datasets, dataset
28
+
29
+ # 1. View all program titles (1 to 9)
30
+ models()
31
+
32
+ # 2. View exact code for any program (1 to 9)
33
+ # Note: If the program has a dataset, it will be automatically saved to ./datasets/
34
+ model(1) # XOR MLP
35
+ model(4) # Speech Recognition (Audio File) -> saves wav audio to ./datasets/
36
+ model(9) # Live Speech Recognition (Microphone)
37
+
38
+ # 3. View dataset availability for all 9 programs
39
+ datasets()
40
+
41
+ # 4. View or preview dataset for a specific program
42
+ dataset(1) # Shows XOR dataset
43
+ dataset(4) # Shows speech audio file info and saves to ./datasets/
44
+ dataset(9) # Shows 'Not available' (uses live microphone input)
45
+ ```
@@ -0,0 +1,32 @@
1
+ # Deep Learning Laboratory Classifier & Datasets (`randomclassifier`)
2
+
3
+ This package provides instant access to Deep Learning Lab programs, source codes, and associated datasets.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install --upgrade randomclassifier
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```python
14
+ from randomclassifier import models, model, datasets, dataset
15
+
16
+ # 1. View all program titles (1 to 9)
17
+ models()
18
+
19
+ # 2. View exact code for any program (1 to 9)
20
+ # Note: If the program has a dataset, it will be automatically saved to ./datasets/
21
+ model(1) # XOR MLP
22
+ model(4) # Speech Recognition (Audio File) -> saves wav audio to ./datasets/
23
+ model(9) # Live Speech Recognition (Microphone)
24
+
25
+ # 3. View dataset availability for all 9 programs
26
+ datasets()
27
+
28
+ # 4. View or preview dataset for a specific program
29
+ dataset(1) # Shows XOR dataset
30
+ dataset(4) # Shows speech audio file info and saves to ./datasets/
31
+ dataset(9) # Shows 'Not available' (uses live microphone input)
32
+ ```
@@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "randomclassifier"
7
- version = "0.1.2"
8
- description = "Deep learning laboratory programs and reusable classifiers"
7
+ version = "0.1.4"
8
+ description = "Deep learning laboratory programs, datasets, and reusable classifiers"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
11
11
  dependencies = [
@@ -17,5 +17,8 @@ dependencies = [
17
17
  "matplotlib>=3.7"
18
18
  ]
19
19
 
20
+ [tool.setuptools]
21
+ package-data = { "randomclassifier" = ["datasets/*"], "dl_lab" = ["datasets/*"] }
22
+
20
23
  [tool.setuptools.packages.find]
21
24
  where = ["src"]
@@ -0,0 +1,17 @@
1
+ """Reusable helpers for the Deep Learning Lab notebooks."""
2
+
3
+ __version__ = "0.1.4"
4
+
5
+ from .programs import PROGRAM_TITLES, list_programs, program_menu, run_program, show_program
6
+ from randomclassifier.data import datasets, dataset, save_dataset_for_program
7
+
8
+ __all__ = [
9
+ "PROGRAM_TITLES",
10
+ "list_programs",
11
+ "program_menu",
12
+ "run_program",
13
+ "show_program",
14
+ "datasets",
15
+ "dataset",
16
+ "save_dataset_for_program",
17
+ ]
@@ -0,0 +1,3 @@
1
+ from randomclassifier.data import DATASETS_DIR, PROGRAM_DATASETS, datasets, dataset, get_dataset_path
2
+
3
+ __all__ = ["DATASETS_DIR", "PROGRAM_DATASETS", "datasets", "dataset", "get_dataset_path"]
@@ -0,0 +1,41 @@
1
+ timestamp,amount,price_change,volume,is_fraud
2
+ 0,100,0.01,1000,0
3
+ 1,110,0.01,1100,0
4
+ 2,120,0.01,1200,0
5
+ 3,130,0.01,1300,0
6
+ 4,140,0.01,1400,0
7
+ 5,150,0.01,1500,0
8
+ 6,160,0.01,1600,0
9
+ 7,470,-0.02,6000,1
10
+ 8,180,0.01,1800,0
11
+ 9,190,0.01,1900,0
12
+ 10,200,0.01,2000,0
13
+ 11,210,0.01,2100,0
14
+ 12,220,0.01,2200,0
15
+ 13,230,0.01,2300,0
16
+ 14,240,0.01,2400,0
17
+ 15,250,0.01,2500,0
18
+ 16,260,0.01,2600,0
19
+ 17,270,0.01,2700,0
20
+ 18,280,0.01,2800,0
21
+ 19,590,-0.02,6000,1
22
+ 20,300,0.01,3000,0
23
+ 21,310,0.01,3100,0
24
+ 22,320,0.01,3200,0
25
+ 23,330,0.01,3300,0
26
+ 24,340,0.01,3400,0
27
+ 25,350,0.01,3500,0
28
+ 26,360,0.01,3600,0
29
+ 27,370,0.01,3700,0
30
+ 28,380,0.01,3800,0
31
+ 29,390,0.01,3900,0
32
+ 30,400,0.01,4000,0
33
+ 31,710,-0.02,6000,1
34
+ 32,420,0.01,4200,0
35
+ 33,430,0.01,4300,0
36
+ 34,440,0.01,4400,0
37
+ 35,450,0.01,4500,0
38
+ 36,460,0.01,4600,0
39
+ 37,770,-0.02,6000,1
40
+ 38,480,0.01,4800,0
41
+ 39,490,0.01,4900,0
@@ -0,0 +1,101 @@
1
+ price,volume,return
2
+ 100,1000,0.4
3
+ 101,1005,0.01
4
+ 102,1010,0.01
5
+ 103,1015,0.01
6
+ 104,1020,0.01
7
+ 105,1025,0.01
8
+ 106,1030,0.01
9
+ 107,1035,0.01
10
+ 108,1040,0.01
11
+ 109,1045,0.01
12
+ 110,1050,0.4
13
+ 111,1055,0.01
14
+ 112,1060,0.01
15
+ 113,1065,0.01
16
+ 114,1070,0.01
17
+ 115,1075,0.01
18
+ 116,1080,0.01
19
+ 117,1085,0.01
20
+ 118,1090,0.01
21
+ 119,1095,0.01
22
+ 120,1100,0.4
23
+ 121,1105,0.01
24
+ 122,1110,0.01
25
+ 123,1115,0.01
26
+ 124,1120,0.01
27
+ 125,1125,0.01
28
+ 126,1130,0.01
29
+ 127,1135,0.01
30
+ 128,1140,0.01
31
+ 129,1145,0.01
32
+ 130,1150,0.4
33
+ 131,1155,0.01
34
+ 132,1160,0.01
35
+ 133,1165,0.01
36
+ 134,1170,0.01
37
+ 135,1175,0.01
38
+ 136,1180,0.01
39
+ 137,1185,0.01
40
+ 138,1190,0.01
41
+ 139,1195,0.01
42
+ 140,1200,0.4
43
+ 141,1205,0.01
44
+ 142,1210,0.01
45
+ 143,1215,0.01
46
+ 144,1220,0.01
47
+ 145,1225,0.01
48
+ 146,1230,0.01
49
+ 147,1235,0.01
50
+ 148,1240,0.01
51
+ 149,1245,0.01
52
+ 150,1250,0.4
53
+ 151,1255,0.01
54
+ 152,1260,0.01
55
+ 153,1265,0.01
56
+ 154,1270,0.01
57
+ 155,1275,0.01
58
+ 156,1280,0.01
59
+ 157,1285,0.01
60
+ 158,1290,0.01
61
+ 159,1295,0.01
62
+ 160,1300,0.4
63
+ 161,1305,0.01
64
+ 162,1310,0.01
65
+ 163,1315,0.01
66
+ 164,1320,0.01
67
+ 165,1325,0.01
68
+ 166,1330,0.01
69
+ 167,1335,0.01
70
+ 168,1340,0.01
71
+ 169,1345,0.01
72
+ 170,1350,0.4
73
+ 171,1355,0.01
74
+ 172,1360,0.01
75
+ 173,1365,0.01
76
+ 174,1370,0.01
77
+ 175,1375,0.01
78
+ 176,1380,0.01
79
+ 177,1385,0.01
80
+ 178,1390,0.01
81
+ 179,1395,0.01
82
+ 180,1400,0.4
83
+ 181,1405,0.01
84
+ 182,1410,0.01
85
+ 183,1415,0.01
86
+ 184,1420,0.01
87
+ 185,1425,0.01
88
+ 186,1430,0.01
89
+ 187,1435,0.01
90
+ 188,1440,0.01
91
+ 189,1445,0.01
92
+ 190,1450,0.4
93
+ 191,1455,0.01
94
+ 192,1460,0.01
95
+ 193,1465,0.01
96
+ 194,1470,0.01
97
+ 195,1475,0.01
98
+ 196,1480,0.01
99
+ 197,1485,0.01
100
+ 198,1490,0.01
101
+ 199,1495,0.01
@@ -0,0 +1,101 @@
1
+ amount,price_change,volume
2
+ 100,0.4,1000
3
+ 101,0.01,1005
4
+ 102,0.01,1010
5
+ 103,0.01,1015
6
+ 104,0.01,1020
7
+ 105,0.01,1025
8
+ 106,0.01,1030
9
+ 107,0.01,1035
10
+ 108,0.01,1040
11
+ 109,0.01,1045
12
+ 110,0.4,1050
13
+ 111,0.01,1055
14
+ 112,0.01,1060
15
+ 113,0.01,1065
16
+ 114,0.01,1070
17
+ 115,0.01,1075
18
+ 116,0.01,1080
19
+ 117,0.01,1085
20
+ 118,0.01,1090
21
+ 119,0.01,1095
22
+ 120,0.4,1100
23
+ 121,0.01,1105
24
+ 122,0.01,1110
25
+ 123,0.01,1115
26
+ 124,0.01,1120
27
+ 125,0.01,1125
28
+ 126,0.01,1130
29
+ 127,0.01,1135
30
+ 128,0.01,1140
31
+ 129,0.01,1145
32
+ 130,0.4,1150
33
+ 131,0.01,1155
34
+ 132,0.01,1160
35
+ 133,0.01,1165
36
+ 134,0.01,1170
37
+ 135,0.01,1175
38
+ 136,0.01,1180
39
+ 137,0.01,1185
40
+ 138,0.01,1190
41
+ 139,0.01,1195
42
+ 140,0.4,1200
43
+ 141,0.01,1205
44
+ 142,0.01,1210
45
+ 143,0.01,1215
46
+ 144,0.01,1220
47
+ 145,0.01,1225
48
+ 146,0.01,1230
49
+ 147,0.01,1235
50
+ 148,0.01,1240
51
+ 149,0.01,1245
52
+ 150,0.4,1250
53
+ 151,0.01,1255
54
+ 152,0.01,1260
55
+ 153,0.01,1265
56
+ 154,0.01,1270
57
+ 155,0.01,1275
58
+ 156,0.01,1280
59
+ 157,0.01,1285
60
+ 158,0.01,1290
61
+ 159,0.01,1295
62
+ 160,0.4,1300
63
+ 161,0.01,1305
64
+ 162,0.01,1310
65
+ 163,0.01,1315
66
+ 164,0.01,1320
67
+ 165,0.01,1325
68
+ 166,0.01,1330
69
+ 167,0.01,1335
70
+ 168,0.01,1340
71
+ 169,0.01,1345
72
+ 170,0.4,1350
73
+ 171,0.01,1355
74
+ 172,0.01,1360
75
+ 173,0.01,1365
76
+ 174,0.01,1370
77
+ 175,0.01,1375
78
+ 176,0.01,1380
79
+ 177,0.01,1385
80
+ 178,0.01,1390
81
+ 179,0.01,1395
82
+ 180,0.4,1400
83
+ 181,0.01,1405
84
+ 182,0.01,1410
85
+ 183,0.01,1415
86
+ 184,0.01,1420
87
+ 185,0.01,1425
88
+ 186,0.01,1430
89
+ 187,0.01,1435
90
+ 188,0.01,1440
91
+ 189,0.01,1445
92
+ 190,0.4,1450
93
+ 191,0.01,1455
94
+ 192,0.01,1460
95
+ 193,0.01,1465
96
+ 194,0.01,1470
97
+ 195,0.01,1475
98
+ 196,0.01,1480
99
+ 197,0.01,1485
100
+ 198,0.01,1490
101
+ 199,0.01,1495
@@ -0,0 +1,5 @@
1
+ x1,x2,label
2
+ 0,0,0
3
+ 0,1,1
4
+ 1,0,1
5
+ 1,1,0
@@ -4,11 +4,12 @@ PROGRAM_TITLES = {
4
4
  1: "XOR using Multilayer Perceptron",
5
5
  2: "Character and Digit Recognition using ANN",
6
6
  3: "X-ray Image Analysis using Autoencoder",
7
- 4: "Speech Recognition using NLP",
7
+ 4: "Speech Recognition using NLP (Audio File)",
8
8
  5: "Traffic Object Detection and Classification using CNN",
9
9
  6: "Share-market Fraud Detection using Data Analytics",
10
10
  7: "Image Augmentation using Deep RBM",
11
11
  8: "Sentiment Analysis using LSTM",
12
+ 9: "Live Speech Recognition using Microphone",
12
13
  }
13
14
 
14
15
  PROGRAMS_CODE = {
@@ -75,25 +76,26 @@ plt.axis("off")
75
76
  plt.tight_layout()
76
77
  plt.show()''',
77
78
 
78
- 4: '''import speech_recognition as sr
79
+ 4: '''# Speech recognition from an audio file
80
+ # Install once if needed: %pip install SpeechRecognition pydub
81
+ import speech_recognition as sr
79
82
 
83
+ audio_file = input("Enter the full path of a WAV/AIFF/FLAC audio file: ").strip().strip("\"")
80
84
  recognizer = sr.Recognizer()
81
85
  try:
82
- with sr.Microphone() as source:
83
- print("Adjusting for background noise...")
84
- recognizer.adjust_for_ambient_noise(source, duration=1)
85
- print("Speak now...")
86
- audio = recognizer.listen(source, timeout=5, phrase_time_limit=8)
87
86
  print("Recognizing speech...")
88
- print("You said:", recognizer.recognize_google(audio))
89
- except sr.WaitTimeoutError:
90
- print("No speech detected.")
87
+ with sr.AudioFile(audio_file) as source:
88
+ audio = recognizer.record(source)
89
+ text = recognizer.recognize_google(audio)
90
+ print("You said:", text)
91
+ except FileNotFoundError:
92
+ print("Audio file not found. Check the path.")
91
93
  except sr.UnknownValueError:
92
94
  print("Could not understand the speech.")
93
95
  except sr.RequestError as e:
94
96
  print("Internet or speech service error:", e)
95
- except OSError as e:
96
- print("Microphone error. Check that a microphone is connected:", e)''',
97
+ except Exception as e:
98
+ print("Error:", e)''',
97
99
 
98
100
  5: '''# Traffic object detection with YOLO
99
101
  # Install once if needed: %pip install ultralytics opencv-python pandas matplotlib
@@ -263,19 +265,41 @@ def predict(text):
263
265
 
264
266
  print("Training completed!")
265
267
  predict("good movie")
266
- predict("bad movie")'''
268
+ predict("bad movie")''',
269
+
270
+ 9: '''# Live speech recognition from the microphone
271
+ # Install once if needed: %pip install SpeechRecognition PyAudio
272
+ import speech_recognition as sr
273
+
274
+ recognizer = sr.Recognizer()
275
+ try:
276
+ with sr.Microphone() as source:
277
+ print("Adjusting for background noise...")
278
+ recognizer.adjust_for_ambient_noise(source, duration=1)
279
+ print("Speak now...")
280
+ audio = recognizer.listen(source, timeout=5, phrase_time_limit=8)
281
+ print("Recognizing speech...")
282
+ print("You said:", recognizer.recognize_google(audio))
283
+ except sr.WaitTimeoutError:
284
+ print("No speech detected.")
285
+ except sr.UnknownValueError:
286
+ print("Could not understand the speech.")
287
+ except sr.RequestError as e:
288
+ print("Internet or speech service error:", e)
289
+ except OSError as e:
290
+ print("Microphone error. Check that a microphone is connected:", e)'''
267
291
  }
268
292
 
269
293
 
270
294
  def list_programs() -> dict[int, str]:
271
- """Return the numbered first-eight program titles."""
295
+ """Return the numbered program titles."""
272
296
  return PROGRAM_TITLES.copy()
273
297
 
274
298
 
275
299
  def show_program(number: int) -> str:
276
300
  """Return the exact source code for a selected program."""
277
301
  if number not in PROGRAMS_CODE:
278
- raise ValueError(f"Program number must be between 1 and 8: {number}")
302
+ raise ValueError(f"Program number must be between 1 and 9: {number}")
279
303
  return PROGRAMS_CODE[number]
280
304
 
281
305
 
@@ -291,7 +315,7 @@ def program_menu(number: int | None = None) -> str:
291
315
  """List all titles, accept a number, and print that program's source."""
292
316
  for key, title in PROGRAM_TITLES.items():
293
317
  print(f"{key}. {title}")
294
- selected = number if number is not None else int(input("\nEnter program number: "))
318
+ selected = number if number is not None else int(input("\nEnter program number (1-9): "))
295
319
  source = show_program(selected)
296
320
  print(source)
297
321
  return source
@@ -0,0 +1,46 @@
1
+ from dl_lab.programs import PROGRAM_TITLES, show_program
2
+ from randomclassifier.data import (
3
+ datasets,
4
+ dataset,
5
+ save_dataset_for_program,
6
+ PROGRAM_FILES,
7
+ )
8
+
9
+ __version__ = "0.1.4"
10
+
11
+
12
+ def models():
13
+ """List all available programs with their numbers and titles."""
14
+ for number, title in PROGRAM_TITLES.items():
15
+ print(f"{number}. {title}")
16
+
17
+
18
+ def model(number: int | None = None):
19
+ """Print the exact source code for the requested program number (1-9)
20
+
21
+ and automatically save its dataset to ./datasets/ if available.
22
+ """
23
+ if number is None:
24
+ models()
25
+ try:
26
+ val = input("\nEnter program number (1-9): ").strip()
27
+ number = int(val)
28
+ except (ValueError, EOFError):
29
+ print("Please provide a valid number between 1 and 9.")
30
+ return
31
+
32
+ if number not in range(1, 10):
33
+ print("Please choose a program number between 1 and 9.")
34
+ return
35
+
36
+ # Automatically save dataset into current path ./datasets/ if available
37
+ saved = save_dataset_for_program(number)
38
+ if saved:
39
+ file_names = ", ".join(f.name for f in saved)
40
+ print(f"[Dataset saved to ./datasets/{file_names}]\n")
41
+
42
+ source = show_program(number)
43
+ print(source)
44
+
45
+
46
+ __all__ = ["models", "model", "datasets", "dataset", "save_dataset_for_program"]
@@ -0,0 +1,141 @@
1
+ from __future__ import annotations
2
+
3
+ import shutil
4
+ from pathlib import Path
5
+
6
+ DATASETS_DIR = Path(__file__).resolve().parent / "datasets"
7
+
8
+ PROGRAM_FILES: dict[int, list[str]] = {
9
+ 1: ["xor.csv"],
10
+ 2: [],
11
+ 3: ["sample_image.jpg", "autoencoder_demo.npz"],
12
+ 4: ["freesound_community-speech-female_hpsmodel-85388.wav"],
13
+ 5: ["traffic_sample.jpg"],
14
+ 6: ["transactions.csv", "fraud_demo.csv", "share_data.csv"],
15
+ 7: [],
16
+ 8: [],
17
+ 9: [],
18
+ }
19
+
20
+ PROGRAM_DATASETS = {
21
+ 1: {
22
+ "title": "XOR using Multilayer Perceptron",
23
+ "description": "XOR truth table dataset",
24
+ "type": "csv",
25
+ },
26
+ 2: {
27
+ "title": "Character and Digit Recognition using ANN",
28
+ "description": "Uses built-in MNIST dataset (tf.keras.datasets.mnist)",
29
+ },
30
+ 3: {
31
+ "title": "X-ray Image Analysis using Autoencoder",
32
+ "description": "Sample medical X-ray image for autoencoder",
33
+ "type": "image",
34
+ },
35
+ 4: {
36
+ "title": "Speech Recognition using NLP (Audio File)",
37
+ "description": "Speech audio sample (WAV)",
38
+ "type": "audio",
39
+ },
40
+ 5: {
41
+ "title": "Traffic Object Detection and Classification using CNN",
42
+ "description": "Traffic camera sample image with vehicles",
43
+ "type": "image",
44
+ },
45
+ 6: {
46
+ "title": "Share-market Fraud Detection using Data Analytics",
47
+ "description": "Financial transactions fraud detection dataset",
48
+ "type": "csv",
49
+ },
50
+ 7: {
51
+ "title": "Image Augmentation using Deep RBM",
52
+ "description": "Uses built-in digits dataset (sklearn.datasets.load_digits)",
53
+ },
54
+ 8: {
55
+ "title": "Sentiment Analysis using LSTM",
56
+ "description": "Uses in-memory sample review dataset",
57
+ },
58
+ 9: {
59
+ "title": "Live Speech Recognition using Microphone",
60
+ "description": "Uses live microphone input",
61
+ },
62
+ }
63
+
64
+
65
+ def save_dataset_for_program(number: int, target_dir: str | Path = "datasets") -> list[Path]:
66
+ """Save/copy dataset files for the given program into the local datasets folder."""
67
+ files = PROGRAM_FILES.get(number, [])
68
+ if not files:
69
+ return []
70
+
71
+ dst_dir = Path.cwd() / target_dir
72
+ dst_dir.mkdir(parents=True, exist_ok=True)
73
+
74
+ saved: list[Path] = []
75
+ for fn in files:
76
+ src = DATASETS_DIR / fn
77
+ if src.exists():
78
+ dst = dst_dir / fn
79
+ if not dst.exists() or dst.stat().st_size == 0:
80
+ shutil.copy2(src, dst)
81
+ saved.append(dst)
82
+ return saved
83
+
84
+
85
+ def datasets():
86
+ """List datasets for all 9 programs and whether they are available."""
87
+ print("=== Program Datasets (1-9) ===")
88
+ for num in range(1, 10):
89
+ title = PROGRAM_DATASETS[num]["title"]
90
+ files = PROGRAM_FILES.get(num, [])
91
+ if files:
92
+ print(f"{num}. {title} -> {', '.join(files)}")
93
+ else:
94
+ print(f"{num}. {title} -> Not available")
95
+
96
+
97
+ def dataset(number: int | None = None):
98
+ """Display the dataset for the given program number (1-9). If not available, shows 'Not available'."""
99
+ if number is None:
100
+ datasets()
101
+ try:
102
+ val = input("\nEnter program number (1-9): ").strip()
103
+ number = int(val)
104
+ except (ValueError, EOFError):
105
+ print("Please provide a valid number between 1 and 9.")
106
+ return
107
+
108
+ if number not in range(1, 10):
109
+ print("Please choose a program number between 1 and 9.")
110
+ return
111
+
112
+ files = PROGRAM_FILES.get(number, [])
113
+ if not files:
114
+ print("Not available")
115
+ return
116
+
117
+ saved = save_dataset_for_program(number)
118
+ primary_fn = files[0]
119
+ primary_path = Path("datasets") / primary_fn
120
+ info = PROGRAM_DATASETS[number]
121
+ file_type = info.get("type", "file")
122
+
123
+ print(f"=== Program {number}: {info['title']} ===")
124
+ print(f"Dataset File : {', '.join(files)}")
125
+ print(f"Description : {info.get('description', '')}")
126
+ print(f"Saved to : {primary_path.resolve()}")
127
+
128
+ if file_type == "csv":
129
+ print("\n--- Content ---")
130
+ try:
131
+ with open(primary_path, "r", encoding="utf-8") as f:
132
+ lines = f.readlines()
133
+ preview = "".join(lines[:25])
134
+ print(preview.rstrip())
135
+ if len(lines) > 25:
136
+ print(f"\n... ({len(lines) - 25} more rows in {primary_fn})")
137
+ except Exception as e:
138
+ print(f"Could not read text content: {e}")
139
+ else:
140
+ size_kb = round(primary_path.stat().st_size / 1024, 2)
141
+ print(f"File Size : {size_kb} KB ({file_type})")
@@ -0,0 +1,41 @@
1
+ timestamp,amount,price_change,volume,is_fraud
2
+ 0,100,0.01,1000,0
3
+ 1,110,0.01,1100,0
4
+ 2,120,0.01,1200,0
5
+ 3,130,0.01,1300,0
6
+ 4,140,0.01,1400,0
7
+ 5,150,0.01,1500,0
8
+ 6,160,0.01,1600,0
9
+ 7,470,-0.02,6000,1
10
+ 8,180,0.01,1800,0
11
+ 9,190,0.01,1900,0
12
+ 10,200,0.01,2000,0
13
+ 11,210,0.01,2100,0
14
+ 12,220,0.01,2200,0
15
+ 13,230,0.01,2300,0
16
+ 14,240,0.01,2400,0
17
+ 15,250,0.01,2500,0
18
+ 16,260,0.01,2600,0
19
+ 17,270,0.01,2700,0
20
+ 18,280,0.01,2800,0
21
+ 19,590,-0.02,6000,1
22
+ 20,300,0.01,3000,0
23
+ 21,310,0.01,3100,0
24
+ 22,320,0.01,3200,0
25
+ 23,330,0.01,3300,0
26
+ 24,340,0.01,3400,0
27
+ 25,350,0.01,3500,0
28
+ 26,360,0.01,3600,0
29
+ 27,370,0.01,3700,0
30
+ 28,380,0.01,3800,0
31
+ 29,390,0.01,3900,0
32
+ 30,400,0.01,4000,0
33
+ 31,710,-0.02,6000,1
34
+ 32,420,0.01,4200,0
35
+ 33,430,0.01,4300,0
36
+ 34,440,0.01,4400,0
37
+ 35,450,0.01,4500,0
38
+ 36,460,0.01,4600,0
39
+ 37,770,-0.02,6000,1
40
+ 38,480,0.01,4800,0
41
+ 39,490,0.01,4900,0
@@ -0,0 +1,101 @@
1
+ price,volume,return
2
+ 100,1000,0.4
3
+ 101,1005,0.01
4
+ 102,1010,0.01
5
+ 103,1015,0.01
6
+ 104,1020,0.01
7
+ 105,1025,0.01
8
+ 106,1030,0.01
9
+ 107,1035,0.01
10
+ 108,1040,0.01
11
+ 109,1045,0.01
12
+ 110,1050,0.4
13
+ 111,1055,0.01
14
+ 112,1060,0.01
15
+ 113,1065,0.01
16
+ 114,1070,0.01
17
+ 115,1075,0.01
18
+ 116,1080,0.01
19
+ 117,1085,0.01
20
+ 118,1090,0.01
21
+ 119,1095,0.01
22
+ 120,1100,0.4
23
+ 121,1105,0.01
24
+ 122,1110,0.01
25
+ 123,1115,0.01
26
+ 124,1120,0.01
27
+ 125,1125,0.01
28
+ 126,1130,0.01
29
+ 127,1135,0.01
30
+ 128,1140,0.01
31
+ 129,1145,0.01
32
+ 130,1150,0.4
33
+ 131,1155,0.01
34
+ 132,1160,0.01
35
+ 133,1165,0.01
36
+ 134,1170,0.01
37
+ 135,1175,0.01
38
+ 136,1180,0.01
39
+ 137,1185,0.01
40
+ 138,1190,0.01
41
+ 139,1195,0.01
42
+ 140,1200,0.4
43
+ 141,1205,0.01
44
+ 142,1210,0.01
45
+ 143,1215,0.01
46
+ 144,1220,0.01
47
+ 145,1225,0.01
48
+ 146,1230,0.01
49
+ 147,1235,0.01
50
+ 148,1240,0.01
51
+ 149,1245,0.01
52
+ 150,1250,0.4
53
+ 151,1255,0.01
54
+ 152,1260,0.01
55
+ 153,1265,0.01
56
+ 154,1270,0.01
57
+ 155,1275,0.01
58
+ 156,1280,0.01
59
+ 157,1285,0.01
60
+ 158,1290,0.01
61
+ 159,1295,0.01
62
+ 160,1300,0.4
63
+ 161,1305,0.01
64
+ 162,1310,0.01
65
+ 163,1315,0.01
66
+ 164,1320,0.01
67
+ 165,1325,0.01
68
+ 166,1330,0.01
69
+ 167,1335,0.01
70
+ 168,1340,0.01
71
+ 169,1345,0.01
72
+ 170,1350,0.4
73
+ 171,1355,0.01
74
+ 172,1360,0.01
75
+ 173,1365,0.01
76
+ 174,1370,0.01
77
+ 175,1375,0.01
78
+ 176,1380,0.01
79
+ 177,1385,0.01
80
+ 178,1390,0.01
81
+ 179,1395,0.01
82
+ 180,1400,0.4
83
+ 181,1405,0.01
84
+ 182,1410,0.01
85
+ 183,1415,0.01
86
+ 184,1420,0.01
87
+ 185,1425,0.01
88
+ 186,1430,0.01
89
+ 187,1435,0.01
90
+ 188,1440,0.01
91
+ 189,1445,0.01
92
+ 190,1450,0.4
93
+ 191,1455,0.01
94
+ 192,1460,0.01
95
+ 193,1465,0.01
96
+ 194,1470,0.01
97
+ 195,1475,0.01
98
+ 196,1480,0.01
99
+ 197,1485,0.01
100
+ 198,1490,0.01
101
+ 199,1495,0.01
@@ -0,0 +1,101 @@
1
+ amount,price_change,volume
2
+ 100,0.4,1000
3
+ 101,0.01,1005
4
+ 102,0.01,1010
5
+ 103,0.01,1015
6
+ 104,0.01,1020
7
+ 105,0.01,1025
8
+ 106,0.01,1030
9
+ 107,0.01,1035
10
+ 108,0.01,1040
11
+ 109,0.01,1045
12
+ 110,0.4,1050
13
+ 111,0.01,1055
14
+ 112,0.01,1060
15
+ 113,0.01,1065
16
+ 114,0.01,1070
17
+ 115,0.01,1075
18
+ 116,0.01,1080
19
+ 117,0.01,1085
20
+ 118,0.01,1090
21
+ 119,0.01,1095
22
+ 120,0.4,1100
23
+ 121,0.01,1105
24
+ 122,0.01,1110
25
+ 123,0.01,1115
26
+ 124,0.01,1120
27
+ 125,0.01,1125
28
+ 126,0.01,1130
29
+ 127,0.01,1135
30
+ 128,0.01,1140
31
+ 129,0.01,1145
32
+ 130,0.4,1150
33
+ 131,0.01,1155
34
+ 132,0.01,1160
35
+ 133,0.01,1165
36
+ 134,0.01,1170
37
+ 135,0.01,1175
38
+ 136,0.01,1180
39
+ 137,0.01,1185
40
+ 138,0.01,1190
41
+ 139,0.01,1195
42
+ 140,0.4,1200
43
+ 141,0.01,1205
44
+ 142,0.01,1210
45
+ 143,0.01,1215
46
+ 144,0.01,1220
47
+ 145,0.01,1225
48
+ 146,0.01,1230
49
+ 147,0.01,1235
50
+ 148,0.01,1240
51
+ 149,0.01,1245
52
+ 150,0.4,1250
53
+ 151,0.01,1255
54
+ 152,0.01,1260
55
+ 153,0.01,1265
56
+ 154,0.01,1270
57
+ 155,0.01,1275
58
+ 156,0.01,1280
59
+ 157,0.01,1285
60
+ 158,0.01,1290
61
+ 159,0.01,1295
62
+ 160,0.4,1300
63
+ 161,0.01,1305
64
+ 162,0.01,1310
65
+ 163,0.01,1315
66
+ 164,0.01,1320
67
+ 165,0.01,1325
68
+ 166,0.01,1330
69
+ 167,0.01,1335
70
+ 168,0.01,1340
71
+ 169,0.01,1345
72
+ 170,0.4,1350
73
+ 171,0.01,1355
74
+ 172,0.01,1360
75
+ 173,0.01,1365
76
+ 174,0.01,1370
77
+ 175,0.01,1375
78
+ 176,0.01,1380
79
+ 177,0.01,1385
80
+ 178,0.01,1390
81
+ 179,0.01,1395
82
+ 180,0.4,1400
83
+ 181,0.01,1405
84
+ 182,0.01,1410
85
+ 183,0.01,1415
86
+ 184,0.01,1420
87
+ 185,0.01,1425
88
+ 186,0.01,1430
89
+ 187,0.01,1435
90
+ 188,0.01,1440
91
+ 189,0.01,1445
92
+ 190,0.4,1450
93
+ 191,0.01,1455
94
+ 192,0.01,1460
95
+ 193,0.01,1465
96
+ 194,0.01,1470
97
+ 195,0.01,1475
98
+ 196,0.01,1480
99
+ 197,0.01,1485
100
+ 198,0.01,1490
101
+ 199,0.01,1495
@@ -0,0 +1,5 @@
1
+ x1,x2,label
2
+ 0,0,0
3
+ 0,1,1
4
+ 1,0,1
5
+ 1,1,0
@@ -0,0 +1,45 @@
1
+ Metadata-Version: 2.4
2
+ Name: randomclassifier
3
+ Version: 0.1.4
4
+ Summary: Deep learning laboratory programs, datasets, and reusable classifiers
5
+ Requires-Python: >=3.10
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: numpy>=1.24
8
+ Requires-Dist: pandas>=2.0
9
+ Requires-Dist: scikit-learn>=1.3
10
+ Requires-Dist: tensorflow>=2.13
11
+ Requires-Dist: jupyter>=1.0
12
+ Requires-Dist: matplotlib>=3.7
13
+
14
+ # Deep Learning Laboratory Classifier & Datasets (`randomclassifier`)
15
+
16
+ This package provides instant access to Deep Learning Lab programs, source codes, and associated datasets.
17
+
18
+ ## Installation
19
+
20
+ ```bash
21
+ pip install --upgrade randomclassifier
22
+ ```
23
+
24
+ ## Quick Start
25
+
26
+ ```python
27
+ from randomclassifier import models, model, datasets, dataset
28
+
29
+ # 1. View all program titles (1 to 9)
30
+ models()
31
+
32
+ # 2. View exact code for any program (1 to 9)
33
+ # Note: If the program has a dataset, it will be automatically saved to ./datasets/
34
+ model(1) # XOR MLP
35
+ model(4) # Speech Recognition (Audio File) -> saves wav audio to ./datasets/
36
+ model(9) # Live Speech Recognition (Microphone)
37
+
38
+ # 3. View dataset availability for all 9 programs
39
+ datasets()
40
+
41
+ # 4. View or preview dataset for a specific program
42
+ dataset(1) # Shows XOR dataset
43
+ dataset(4) # Shows speech audio file info and saves to ./datasets/
44
+ dataset(9) # Shows 'Not available' (uses live microphone input)
45
+ ```
@@ -0,0 +1,34 @@
1
+ MANIFEST.in
2
+ README.md
3
+ pyproject.toml
4
+ src/dl_lab/__init__.py
5
+ src/dl_lab/data.py
6
+ src/dl_lab/programs.py
7
+ src/dl_lab/datasets/autoencoder_demo.npz
8
+ src/dl_lab/datasets/fraud_demo.csv
9
+ src/dl_lab/datasets/freesound_community-speech-female_hpsmodel-85388.mp3
10
+ src/dl_lab/datasets/freesound_community-speech-female_hpsmodel-85388.wav
11
+ src/dl_lab/datasets/images.jpg
12
+ src/dl_lab/datasets/sample_image.jpg
13
+ src/dl_lab/datasets/share_data.csv
14
+ src/dl_lab/datasets/traffic_sample.jpg
15
+ src/dl_lab/datasets/transactions.csv
16
+ src/dl_lab/datasets/xor.csv
17
+ src/randomclassifier/__init__.py
18
+ src/randomclassifier/data.py
19
+ src/randomclassifier/programs.py
20
+ src/randomclassifier.egg-info/PKG-INFO
21
+ src/randomclassifier.egg-info/SOURCES.txt
22
+ src/randomclassifier.egg-info/dependency_links.txt
23
+ src/randomclassifier.egg-info/requires.txt
24
+ src/randomclassifier.egg-info/top_level.txt
25
+ src/randomclassifier/datasets/autoencoder_demo.npz
26
+ src/randomclassifier/datasets/fraud_demo.csv
27
+ src/randomclassifier/datasets/freesound_community-speech-female_hpsmodel-85388.mp3
28
+ src/randomclassifier/datasets/freesound_community-speech-female_hpsmodel-85388.wav
29
+ src/randomclassifier/datasets/images.jpg
30
+ src/randomclassifier/datasets/sample_image.jpg
31
+ src/randomclassifier/datasets/share_data.csv
32
+ src/randomclassifier/datasets/traffic_sample.jpg
33
+ src/randomclassifier/datasets/transactions.csv
34
+ src/randomclassifier/datasets/xor.csv
@@ -1,27 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: randomclassifier
3
- Version: 0.1.2
4
- Summary: Deep learning laboratory programs and reusable classifiers
5
- Requires-Python: >=3.10
6
- Description-Content-Type: text/markdown
7
- Requires-Dist: numpy>=1.24
8
- Requires-Dist: pandas>=2.0
9
- Requires-Dist: scikit-learn>=1.3
10
- Requires-Dist: tensorflow>=2.13
11
- Requires-Dist: jupyter>=1.0
12
- Requires-Dist: matplotlib>=3.7
13
-
14
- # DL Lab PIP Project
15
-
16
- This folder contains the installable Python project for the Deep Learning Lab notebooks.
17
-
18
- The package is named `randomclassifier` and exposes exactly two public functions:
19
-
20
- ```python
21
- from randomclassifier import models, model
22
-
23
- models()
24
- model(1)
25
- ```
26
-
27
- Notebook files and datasets remain in the parent `DL_LAB` folder.
@@ -1,14 +0,0 @@
1
- # DL Lab PIP Project
2
-
3
- This folder contains the installable Python project for the Deep Learning Lab notebooks.
4
-
5
- The package is named `randomclassifier` and exposes exactly two public functions:
6
-
7
- ```python
8
- from randomclassifier import models, model
9
-
10
- models()
11
- model(1)
12
- ```
13
-
14
- Notebook files and datasets remain in the parent `DL_LAB` folder.
@@ -1,7 +0,0 @@
1
- """Reusable helpers for the Deep Learning Lab notebooks."""
2
-
3
- __version__ = "0.1.2"
4
-
5
- from .programs import PROGRAM_TITLES, list_programs, program_menu, run_program, show_program
6
-
7
- __all__ = ["PROGRAM_TITLES", "list_programs", "program_menu", "run_program", "show_program"]
@@ -1,9 +0,0 @@
1
- from pathlib import Path
2
-
3
-
4
- def project_root() -> Path:
5
- return Path(__file__).resolve().parents[2]
6
-
7
-
8
- def dataset_path(name: str) -> Path:
9
- return project_root() / "datasets" / name
@@ -1,26 +0,0 @@
1
- from dl_lab.programs import PROGRAM_TITLES, show_program
2
-
3
- __version__ = "0.1.2"
4
-
5
-
6
- def models():
7
- """List all available programs with their numbers and titles."""
8
- for number, title in PROGRAM_TITLES.items():
9
- print(f"{number}. {title}")
10
-
11
-
12
- def model(number: int | None = None):
13
- """Print the exact source code for the requested program number (1-8)."""
14
- if number is None:
15
- models()
16
- try:
17
- val = input("\nEnter program number (1-8): ").strip()
18
- number = int(val)
19
- except (ValueError, EOFError):
20
- print("Please provide a valid number between 1 and 8.")
21
- return
22
- source = show_program(number)
23
- print(source)
24
-
25
-
26
- __all__ = ["models", "model"]
@@ -1,27 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: randomclassifier
3
- Version: 0.1.2
4
- Summary: Deep learning laboratory programs and reusable classifiers
5
- Requires-Python: >=3.10
6
- Description-Content-Type: text/markdown
7
- Requires-Dist: numpy>=1.24
8
- Requires-Dist: pandas>=2.0
9
- Requires-Dist: scikit-learn>=1.3
10
- Requires-Dist: tensorflow>=2.13
11
- Requires-Dist: jupyter>=1.0
12
- Requires-Dist: matplotlib>=3.7
13
-
14
- # DL Lab PIP Project
15
-
16
- This folder contains the installable Python project for the Deep Learning Lab notebooks.
17
-
18
- The package is named `randomclassifier` and exposes exactly two public functions:
19
-
20
- ```python
21
- from randomclassifier import models, model
22
-
23
- models()
24
- model(1)
25
- ```
26
-
27
- Notebook files and datasets remain in the parent `DL_LAB` folder.
@@ -1,12 +0,0 @@
1
- README.md
2
- pyproject.toml
3
- src/dl_lab/__init__.py
4
- src/dl_lab/data.py
5
- src/dl_lab/programs.py
6
- src/randomclassifier/__init__.py
7
- src/randomclassifier/programs.py
8
- src/randomclassifier.egg-info/PKG-INFO
9
- src/randomclassifier.egg-info/SOURCES.txt
10
- src/randomclassifier.egg-info/dependency_links.txt
11
- src/randomclassifier.egg-info/requires.txt
12
- src/randomclassifier.egg-info/top_level.txt