randomclassifier 0.1.3__tar.gz → 0.1.5__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 (37) hide show
  1. {randomclassifier-0.1.3/src/randomclassifier.egg-info → randomclassifier-0.1.5}/PKG-INFO +10 -8
  2. randomclassifier-0.1.5/README.md +32 -0
  3. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/pyproject.toml +1 -1
  4. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/dl_lab/__init__.py +1 -1
  5. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/dl_lab/programs.py +37 -21
  6. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/randomclassifier/__init__.py +6 -6
  7. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/randomclassifier/data.py +14 -9
  8. {randomclassifier-0.1.3 → randomclassifier-0.1.5/src/randomclassifier.egg-info}/PKG-INFO +10 -8
  9. randomclassifier-0.1.3/README.md +0 -30
  10. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/MANIFEST.in +0 -0
  11. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/setup.cfg +0 -0
  12. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/dl_lab/data.py +0 -0
  13. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/dl_lab/datasets/autoencoder_demo.npz +0 -0
  14. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/dl_lab/datasets/fraud_demo.csv +0 -0
  15. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/dl_lab/datasets/freesound_community-speech-female_hpsmodel-85388.mp3 +0 -0
  16. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/dl_lab/datasets/freesound_community-speech-female_hpsmodel-85388.wav +0 -0
  17. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/dl_lab/datasets/images.jpg +0 -0
  18. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/dl_lab/datasets/sample_image.jpg +0 -0
  19. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/dl_lab/datasets/share_data.csv +0 -0
  20. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/dl_lab/datasets/traffic_sample.jpg +0 -0
  21. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/dl_lab/datasets/transactions.csv +0 -0
  22. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/dl_lab/datasets/xor.csv +0 -0
  23. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/randomclassifier/datasets/autoencoder_demo.npz +0 -0
  24. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/randomclassifier/datasets/fraud_demo.csv +0 -0
  25. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/randomclassifier/datasets/freesound_community-speech-female_hpsmodel-85388.mp3 +0 -0
  26. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/randomclassifier/datasets/freesound_community-speech-female_hpsmodel-85388.wav +0 -0
  27. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/randomclassifier/datasets/images.jpg +0 -0
  28. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/randomclassifier/datasets/sample_image.jpg +0 -0
  29. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/randomclassifier/datasets/share_data.csv +0 -0
  30. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/randomclassifier/datasets/traffic_sample.jpg +0 -0
  31. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/randomclassifier/datasets/transactions.csv +0 -0
  32. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/randomclassifier/datasets/xor.csv +0 -0
  33. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/randomclassifier/programs.py +0 -0
  34. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/randomclassifier.egg-info/SOURCES.txt +0 -0
  35. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/randomclassifier.egg-info/dependency_links.txt +0 -0
  36. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/randomclassifier.egg-info/requires.txt +0 -0
  37. {randomclassifier-0.1.3 → randomclassifier-0.1.5}/src/randomclassifier.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: randomclassifier
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: Deep learning laboratory programs, datasets, and reusable classifiers
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -26,18 +26,20 @@ pip install --upgrade randomclassifier
26
26
  ```python
27
27
  from randomclassifier import models, model, datasets, dataset
28
28
 
29
- # 1. View all program titles
29
+ # 1. View all program titles (1 to 9)
30
30
  models()
31
31
 
32
- # 2. View exact code for any program (1 to 8)
33
- model(1)
34
- model(2)
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)
35
37
 
36
- # 3. View dataset availability for all 8 programs
38
+ # 3. View dataset availability for all 9 programs
37
39
  datasets()
38
40
 
39
41
  # 4. View or preview dataset for a specific program
40
42
  dataset(1) # Shows XOR dataset
41
- dataset(2) # Shows 'Not available' (uses built-in MNIST)
42
- dataset(5) # Shows traffic dataset info and path
43
+ dataset(4) # Shows speech audio file info and saves to ./datasets/
44
+ dataset(9) # Shows 'Not available' (uses live microphone input)
43
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,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "randomclassifier"
7
- version = "0.1.3"
7
+ version = "0.1.5"
8
8
  description = "Deep learning laboratory programs, datasets, and reusable classifiers"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -1,6 +1,6 @@
1
1
  """Reusable helpers for the Deep Learning Lab notebooks."""
2
2
 
3
- __version__ = "0.1.3"
3
+ __version__ = "0.1.5"
4
4
 
5
5
  from .programs import PROGRAM_TITLES, list_programs, program_menu, run_program, show_program
6
6
  from randomclassifier.data import datasets, dataset, save_dataset_for_program
@@ -4,17 +4,17 @@ 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 = {
15
16
  1: '''from sklearn.neural_network import MLPClassifier
16
17
 
17
- # Input data (XOR)
18
18
  X = [[0, 0], [0, 1], [1, 0], [1, 1]]
19
19
  y = [0, 1, 1, 0]
20
20
 
@@ -77,27 +77,24 @@ plt.show()''',
77
77
 
78
78
  4: '''import speech_recognition as sr
79
79
 
80
+ audio_file = input("Enter the full path of a WAV/AIFF/FLAC audio file: ").strip().strip("\"")
80
81
  recognizer = sr.Recognizer()
81
82
  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
83
  print("Recognizing speech...")
88
- print("You said:", recognizer.recognize_google(audio))
89
- except sr.WaitTimeoutError:
90
- print("No speech detected.")
84
+ with sr.AudioFile(audio_file) as source:
85
+ audio = recognizer.record(source)
86
+ text = recognizer.recognize_google(audio)
87
+ print("You said:", text)
88
+ except FileNotFoundError:
89
+ print("Audio file not found. Check the path.")
91
90
  except sr.UnknownValueError:
92
91
  print("Could not understand the speech.")
93
92
  except sr.RequestError as e:
94
93
  print("Internet or speech service error:", e)
95
- except OSError as e:
96
- print("Microphone error. Check that a microphone is connected:", e)''',
94
+ except Exception as e:
95
+ print("Error:", e)''',
97
96
 
98
- 5: '''# Traffic object detection with YOLO
99
- # Install once if needed: %pip install ultralytics opencv-python pandas matplotlib
100
- import cv2
97
+ 5: '''import cv2
101
98
  import pandas as pd
102
99
  import matplotlib.pyplot as plt
103
100
  from pathlib import Path
@@ -183,8 +180,7 @@ print("Highest Risk Company:", highest["company"])
183
180
  print("Fraud Probability:", round(highest["fraud_prob"], 4))
184
181
  print("Status:", "Fraud" if highest["fraud_prob"] > 0.5 else "Legitimate")''',
185
182
 
186
- 7: '''# Install once if needed: %pip install scikit-learn scipy
187
- import numpy as np
183
+ 7: '''import numpy as np
188
184
  import matplotlib.pyplot as plt
189
185
  from scipy.special import expit
190
186
  from sklearn.datasets import load_digits
@@ -263,19 +259,39 @@ def predict(text):
263
259
 
264
260
  print("Training completed!")
265
261
  predict("good movie")
266
- predict("bad movie")'''
262
+ predict("bad movie")''',
263
+
264
+ 9: '''import speech_recognition as sr
265
+
266
+ recognizer = sr.Recognizer()
267
+ try:
268
+ with sr.Microphone() as source:
269
+ print("Adjusting for background noise...")
270
+ recognizer.adjust_for_ambient_noise(source, duration=1)
271
+ print("Speak now...")
272
+ audio = recognizer.listen(source, timeout=5, phrase_time_limit=8)
273
+ print("Recognizing speech...")
274
+ print("You said:", recognizer.recognize_google(audio))
275
+ except sr.WaitTimeoutError:
276
+ print("No speech detected.")
277
+ except sr.UnknownValueError:
278
+ print("Could not understand the speech.")
279
+ except sr.RequestError as e:
280
+ print("Internet or speech service error:", e)
281
+ except OSError as e:
282
+ print("Microphone error. Check that a microphone is connected:", e)'''
267
283
  }
268
284
 
269
285
 
270
286
  def list_programs() -> dict[int, str]:
271
- """Return the numbered first-eight program titles."""
287
+ """Return the numbered program titles."""
272
288
  return PROGRAM_TITLES.copy()
273
289
 
274
290
 
275
291
  def show_program(number: int) -> str:
276
292
  """Return the exact source code for a selected program."""
277
293
  if number not in PROGRAMS_CODE:
278
- raise ValueError(f"Program number must be between 1 and 8: {number}")
294
+ raise ValueError(f"Program number must be between 1 and 9: {number}")
279
295
  return PROGRAMS_CODE[number]
280
296
 
281
297
 
@@ -291,7 +307,7 @@ def program_menu(number: int | None = None) -> str:
291
307
  """List all titles, accept a number, and print that program's source."""
292
308
  for key, title in PROGRAM_TITLES.items():
293
309
  print(f"{key}. {title}")
294
- selected = number if number is not None else int(input("\nEnter program number: "))
310
+ selected = number if number is not None else int(input("\nEnter program number (1-9): "))
295
311
  source = show_program(selected)
296
312
  print(source)
297
313
  return source
@@ -6,7 +6,7 @@ from randomclassifier.data import (
6
6
  PROGRAM_FILES,
7
7
  )
8
8
 
9
- __version__ = "0.1.3"
9
+ __version__ = "0.1.5"
10
10
 
11
11
 
12
12
  def models():
@@ -16,21 +16,21 @@ def models():
16
16
 
17
17
 
18
18
  def model(number: int | None = None):
19
- """Print the exact source code for the requested program number (1-8)
19
+ """Print the exact source code for the requested program number (1-9)
20
20
 
21
21
  and automatically save its dataset to ./datasets/ if available.
22
22
  """
23
23
  if number is None:
24
24
  models()
25
25
  try:
26
- val = input("\nEnter program number (1-8): ").strip()
26
+ val = input("\nEnter program number (1-9): ").strip()
27
27
  number = int(val)
28
28
  except (ValueError, EOFError):
29
- print("Please provide a valid number between 1 and 8.")
29
+ print("Please provide a valid number between 1 and 9.")
30
30
  return
31
31
 
32
- if number not in range(1, 9):
33
- print("Please choose a program number between 1 and 8.")
32
+ if number not in range(1, 10):
33
+ print("Please choose a program number between 1 and 9.")
34
34
  return
35
35
 
36
36
  # Automatically save dataset into current path ./datasets/ if available
@@ -14,6 +14,7 @@ PROGRAM_FILES: dict[int, list[str]] = {
14
14
  6: ["transactions.csv", "fraud_demo.csv", "share_data.csv"],
15
15
  7: [],
16
16
  8: [],
17
+ 9: [],
17
18
  }
18
19
 
19
20
  PROGRAM_DATASETS = {
@@ -32,7 +33,7 @@ PROGRAM_DATASETS = {
32
33
  "type": "image",
33
34
  },
34
35
  4: {
35
- "title": "Speech Recognition using NLP",
36
+ "title": "Speech Recognition using NLP (Audio File)",
36
37
  "description": "Speech audio sample (WAV)",
37
38
  "type": "audio",
38
39
  },
@@ -54,6 +55,10 @@ PROGRAM_DATASETS = {
54
55
  "title": "Sentiment Analysis using LSTM",
55
56
  "description": "Uses in-memory sample review dataset",
56
57
  },
58
+ 9: {
59
+ "title": "Live Speech Recognition using Microphone",
60
+ "description": "Uses live microphone input",
61
+ },
57
62
  }
58
63
 
59
64
 
@@ -78,9 +83,9 @@ def save_dataset_for_program(number: int, target_dir: str | Path = "datasets") -
78
83
 
79
84
 
80
85
  def datasets():
81
- """List datasets for all 8 programs and whether they are available."""
82
- print("=== Program Datasets (1-8) ===")
83
- for num in range(1, 9):
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):
84
89
  title = PROGRAM_DATASETS[num]["title"]
85
90
  files = PROGRAM_FILES.get(num, [])
86
91
  if files:
@@ -90,18 +95,18 @@ def datasets():
90
95
 
91
96
 
92
97
  def dataset(number: int | None = None):
93
- """Display the dataset for the given program number (1-8). If not available, shows 'Not available'."""
98
+ """Display the dataset for the given program number (1-9). If not available, shows 'Not available'."""
94
99
  if number is None:
95
100
  datasets()
96
101
  try:
97
- val = input("\nEnter program number (1-8): ").strip()
102
+ val = input("\nEnter program number (1-9): ").strip()
98
103
  number = int(val)
99
104
  except (ValueError, EOFError):
100
- print("Please provide a valid number between 1 and 8.")
105
+ print("Please provide a valid number between 1 and 9.")
101
106
  return
102
107
 
103
- if number not in range(1, 9):
104
- print("Please choose a program number between 1 and 8.")
108
+ if number not in range(1, 10):
109
+ print("Please choose a program number between 1 and 9.")
105
110
  return
106
111
 
107
112
  files = PROGRAM_FILES.get(number, [])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: randomclassifier
3
- Version: 0.1.3
3
+ Version: 0.1.5
4
4
  Summary: Deep learning laboratory programs, datasets, and reusable classifiers
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -26,18 +26,20 @@ pip install --upgrade randomclassifier
26
26
  ```python
27
27
  from randomclassifier import models, model, datasets, dataset
28
28
 
29
- # 1. View all program titles
29
+ # 1. View all program titles (1 to 9)
30
30
  models()
31
31
 
32
- # 2. View exact code for any program (1 to 8)
33
- model(1)
34
- model(2)
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)
35
37
 
36
- # 3. View dataset availability for all 8 programs
38
+ # 3. View dataset availability for all 9 programs
37
39
  datasets()
38
40
 
39
41
  # 4. View or preview dataset for a specific program
40
42
  dataset(1) # Shows XOR dataset
41
- dataset(2) # Shows 'Not available' (uses built-in MNIST)
42
- dataset(5) # Shows traffic dataset info and path
43
+ dataset(4) # Shows speech audio file info and saves to ./datasets/
44
+ dataset(9) # Shows 'Not available' (uses live microphone input)
43
45
  ```
@@ -1,30 +0,0 @@
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
17
- models()
18
-
19
- # 2. View exact code for any program (1 to 8)
20
- model(1)
21
- model(2)
22
-
23
- # 3. View dataset availability for all 8 programs
24
- datasets()
25
-
26
- # 4. View or preview dataset for a specific program
27
- dataset(1) # Shows XOR dataset
28
- dataset(2) # Shows 'Not available' (uses built-in MNIST)
29
- dataset(5) # Shows traffic dataset info and path
30
- ```