skelearn 0.1.0__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.
@@ -0,0 +1 @@
1
+ include skelearn/*.ipynb
@@ -0,0 +1,11 @@
1
+ Metadata-Version: 2.4
2
+ Name: skelearn
3
+ Version: 0.1.0
4
+ Summary: practice
5
+ Author: kingmufaz
6
+ Requires-Python: >=3.8
7
+ Description-Content-Type: text/markdown
8
+ Dynamic: author
9
+ Dynamic: description-content-type
10
+ Dynamic: requires-python
11
+ Dynamic: summary
File without changes
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,14 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="skelearn",
5
+ version="0.1.0",
6
+ author="kingmufaz",
7
+ description="practice",
8
+ long_description=open("README.md").read(),
9
+ long_description_content_type="text/markdown",
10
+ packages=find_packages(),
11
+ include_package_data=True,
12
+ package_data={"skelearn": ["*.ipynb"]},
13
+ python_requires=">=3.8",
14
+ )
@@ -0,0 +1,10 @@
1
+ import shutil
2
+ from importlib.resources import files
3
+
4
+ def sklearn():
5
+ shutil.copy(files("skelearn").joinpath("develop.pdf"), "develop.pdf")
6
+
7
+ def iris():
8
+ shutil.copy(files("skelearn").joinpath("prac.py"), "prac.py")
9
+
10
+
@@ -0,0 +1,74 @@
1
+ import matplotlib.pyplot as plt
2
+
3
+ from sklearn.datasets import load_iris
4
+ from sklearn.model_selection import train_test_split
5
+ from sklearn.preprocessing import StandardScaler
6
+ from tensorflow.keras.utils import to_categorical
7
+
8
+ import tensorflow as tf
9
+
10
+ # Load dataset
11
+ iris = load_iris()
12
+ X = iris.data
13
+ Y = iris.target
14
+
15
+ # Split dataset
16
+ x_train, x_test, y_train, y_test = train_test_split(
17
+ X, Y, test_size=0.2, random_state=42
18
+ )
19
+
20
+ # Normalize
21
+ scaler = StandardScaler()
22
+ x_train = scaler.fit_transform(x_train)
23
+ x_test = scaler.transform(x_test)
24
+
25
+ # One-hot encoding
26
+ y_train = to_categorical(y_train, 3)
27
+ y_test = to_categorical(y_test, 3)
28
+
29
+ # Activation functions list
30
+ activations = ['sigmoid', 'relu', 'tanh']
31
+
32
+ # Train separate models
33
+ for act in activations:
34
+ print(f"\n--- Using {act.upper()} Activation ---")
35
+
36
+ model = tf.keras.Sequential([
37
+ tf.keras.layers.Dense(128, activation=act, input_shape=(4,)),
38
+ tf.keras.layers.Dense(64, activation=act),
39
+ tf.keras.layers.Dense(3, activation='softmax')
40
+ ])
41
+
42
+ model.compile(
43
+ optimizer='adam',
44
+ loss='categorical_crossentropy',
45
+ metrics=['accuracy']
46
+ )
47
+
48
+ history = model.fit(
49
+ x_train,
50
+ y_train,
51
+ epochs=50,
52
+ batch_size=8,
53
+ verbose=0
54
+ )
55
+
56
+ loss, accuracy = model.evaluate(
57
+ x_test,
58
+ y_test,
59
+ verbose=0
60
+ )
61
+
62
+ print("Final Loss:", loss)
63
+ print("Final Accuracy:", accuracy)
64
+
65
+ # Plot loss convergence for each activation
66
+ plt.plot(history.history['loss'], label=act)
67
+
68
+ # Final graph
69
+ plt.title("Iris Dataset Loss Convergence Comparison")
70
+ plt.xlabel("Epoch")
71
+ plt.ylabel("Loss")
72
+ plt.legend()
73
+
74
+ plt.show()
@@ -0,0 +1,11 @@
1
+ Metadata-Version: 2.4
2
+ Name: skelearn
3
+ Version: 0.1.0
4
+ Summary: practice
5
+ Author: kingmufaz
6
+ Requires-Python: >=3.8
7
+ Description-Content-Type: text/markdown
8
+ Dynamic: author
9
+ Dynamic: description-content-type
10
+ Dynamic: requires-python
11
+ Dynamic: summary
@@ -0,0 +1,9 @@
1
+ MANIFEST.in
2
+ README.md
3
+ setup.py
4
+ skelearn/__init__.py
5
+ skelearn/prac.py
6
+ skelearn.egg-info/PKG-INFO
7
+ skelearn.egg-info/SOURCES.txt
8
+ skelearn.egg-info/dependency_links.txt
9
+ skelearn.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ skelearn