modelit 0.2.1__tar.gz → 0.2.3__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.
@@ -7,8 +7,9 @@ dist/
7
7
  .mypy_cache/
8
8
  .ruff_cache/
9
9
  .venv/
10
- .venv2/
10
+
11
11
  venv/
12
12
  .DS_Store
13
13
  code1.py
14
14
  screenshots/
15
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modelit
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: Local-first ML starter templates you can print or save
5
5
  Author: Yashsmith
6
6
  License-Expression: MIT
@@ -13,6 +13,7 @@
13
13
  import numpy as np
14
14
  import pandas as pd
15
15
 
16
+ from sklearn.datasets import load_breast_cancer
16
17
  from sklearn.model_selection import train_test_split
17
18
  from sklearn.neural_network import MLPClassifier
18
19
  from sklearn.preprocessing import StandardScaler
@@ -386,28 +387,11 @@ print(w2_xavier)
386
387
  # =========================================================
387
388
 
388
389
  print("\n=================================================")
389
- print("Titanic Dataset using MLPClassifier")
390
+ print("Breast Cancer Dataset using MLPClassifier")
390
391
  print("=================================================")
391
392
 
392
- # Dataset loading
393
- # Install:
394
- # pip install kagglehub
395
-
396
- import kagglehub
397
-
398
- path = kagglehub.dataset_download(
399
- "yasserh/titanic-dataset"
400
- )
401
-
402
- print("\nPath to dataset files:")
403
- print(path)
404
-
405
-
406
- # =========================================================
407
- # LOAD DATASET
408
- # =========================================================
409
-
410
- df = pd.read_csv(f"{path}/Titanic-Dataset.csv")
393
+ dataset = load_breast_cancer(as_frame=True)
394
+ df = dataset.frame
411
395
 
412
396
  print("\nDataset Head:")
413
397
  print(df.head())
@@ -417,48 +401,8 @@ print(df.head())
417
401
  # FEATURES AND LABELS
418
402
  # =========================================================
419
403
 
420
- y_titanic = df["Survived"]
421
-
422
- X_titanic = df.drop(
423
- columns=[
424
- "Survived",
425
- "Name",
426
- "Ticket",
427
- "Cabin"
428
- ]
429
- )
430
-
431
-
432
- # =========================================================
433
- # ENCODE SEX COLUMN
434
- # =========================================================
435
-
436
- X_titanic["Sex"] = X_titanic["Sex"].map(
437
- {
438
- "male": 0,
439
- "female": 1
440
- }
441
- )
442
-
443
-
444
- # =========================================================
445
- # ONE HOT ENCODING
446
- # =========================================================
447
-
448
- X_titanic = pd.get_dummies(
449
- X_titanic,
450
- columns=["Embarked"],
451
- drop_first=True
452
- )
453
-
454
-
455
- # =========================================================
456
- # HANDLE MISSING VALUES
457
- # =========================================================
458
-
459
- X_titanic = X_titanic.fillna(
460
- X_titanic.mean()
461
- )
404
+ X_cancer = df.drop(columns=["target"])
405
+ y_cancer = df["target"]
462
406
 
463
407
 
464
408
  # =========================================================
@@ -466,8 +410,7 @@ X_titanic = X_titanic.fillna(
466
410
  # =========================================================
467
411
 
468
412
  scaler = StandardScaler()
469
-
470
- X_scaled = scaler.fit_transform(X_titanic)
413
+ X_scaled = scaler.fit_transform(X_cancer)
471
414
 
472
415
 
473
416
  # =========================================================
@@ -476,7 +419,7 @@ X_scaled = scaler.fit_transform(X_titanic)
476
419
 
477
420
  X_train, X_test, y_train, y_test = train_test_split(
478
421
  X_scaled,
479
- y_titanic,
422
+ y_cancer,
480
423
  test_size=0.2,
481
424
  random_state=42
482
425
  )
@@ -537,4 +480,4 @@ accuracy = mlp.score(X_test, y_test)
537
480
 
538
481
  print("\n=================================================")
539
482
  print(f"Model Accuracy: {accuracy * 100:.2f}%")
540
- print("=================================================")
483
+ print("=================================================")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: modelit
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary: Local-first ML starter templates you can print or save
5
5
  Author: Yashsmith
6
6
  License-Expression: MIT
@@ -14,5 +14,5 @@ modelit.egg-info/SOURCES.txt
14
14
  modelit.egg-info/dependency_links.txt
15
15
  modelit.egg-info/entry_points.txt
16
16
  modelit.egg-info/top_level.txt
17
- modelit/templates/backpropogation/template.py
17
+ modelit/templates/backpropagation/template.py
18
18
  modelit/templates/perceptron/template.py
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes