Spaces:
Build error
Build error
Update pages/Measurement_of_disperssion.py
Browse files- pages/Measurement_of_disperssion.py +165 -204
pages/Measurement_of_disperssion.py
CHANGED
|
@@ -1,206 +1,167 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
import
|
| 3 |
-
from functools import reduce
|
| 4 |
import numpy as np
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
''
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
st.
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
st.
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
st.
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
st.
|
| 165 |
-
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
return round(np.std(list1),2)
|
| 170 |
-
st.title("Caluculate Absolute Standard Deviation")
|
| 171 |
-
num_input6=st.text_input("Enter the values separated by commas (e.g., 1,2,3,4)", key="num_input6")
|
| 172 |
-
value=num_input6.split(",")
|
| 173 |
-
list1=[]
|
| 174 |
-
for i in value:
|
| 175 |
-
if i.isdigit():
|
| 176 |
-
list1.append(int(i))
|
| 177 |
-
else:
|
| 178 |
-
pass
|
| 179 |
-
if list1:
|
| 180 |
-
result=absolute_std(list1)
|
| 181 |
-
st.write("Absolute Standard Deviation",result)
|
| 182 |
-
else:
|
| 183 |
-
st.write("Please enter valid numbers.")
|
| 184 |
-
def relative_std(list1):
|
| 185 |
-
mean=round(np.mean(list1),2)
|
| 186 |
-
std_dev=np.std(list1,ddof=1)
|
| 187 |
-
return round((std_dev/mean),2)
|
| 188 |
-
st.title("Caluculate Relative Standard Deviation")
|
| 189 |
-
num_input7=st.text_input("Enter the values separated by commas (e.g., 1,2,3,4)", key="num_input7")
|
| 190 |
-
value=num_input7.split(",")
|
| 191 |
-
list1=[]
|
| 192 |
-
for i in value:
|
| 193 |
-
if i.isdigit():
|
| 194 |
-
list1.append(int(i))
|
| 195 |
-
else:
|
| 196 |
-
pass
|
| 197 |
-
if list1:
|
| 198 |
-
result=relative_std(list1)
|
| 199 |
-
st.write("Relative Standard Deviation",result)
|
| 200 |
-
else:
|
| 201 |
-
st.write("Please enter valid numbers.")
|
| 202 |
-
st.subheader("Distribution",divider=True)
|
| 203 |
-
st.markdown(''':blue[**Distribution**] is a measure will will tell how the shape of data or in which shape the data is spread.It will help in
|
| 204 |
-
analysis.There are few types of distribution \n * Normal Distribution \n * Uniform Distribution \n * Binomial Distribution \n * Poisson Distribution
|
| 205 |
-
\n * Exponential Distribution \n * Chi-Square Distribution \n * T-Distribution
|
| 206 |
-
''')
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
import pandas as pd
|
|
|
|
| 3 |
import numpy as np
|
| 4 |
+
import matplotlib.pyplot as plt
|
| 5 |
+
import random
|
| 6 |
+
|
| 7 |
+
# Custom CSS for styling
|
| 8 |
+
st.markdown("""
|
| 9 |
+
<style>
|
| 10 |
+
/* Set a soft background color */
|
| 11 |
+
body {
|
| 12 |
+
background-color: #eef2f7;
|
| 13 |
+
}
|
| 14 |
+
/* Style for main title */
|
| 15 |
+
h1 {
|
| 16 |
+
color: #00FFFF;
|
| 17 |
+
font-family: 'Roboto', sans-serif;
|
| 18 |
+
font-weight: 700;
|
| 19 |
+
text-align: center;
|
| 20 |
+
margin-bottom: 25px;
|
| 21 |
+
}
|
| 22 |
+
/* Style for headers */
|
| 23 |
+
h2 {
|
| 24 |
+
color: #FFFACD;
|
| 25 |
+
font-family: 'Roboto', sans-serif;
|
| 26 |
+
font-weight: 600;
|
| 27 |
+
margin-top: 30px;
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
/* Style for subheaders */
|
| 31 |
+
h3 {
|
| 32 |
+
color: #ba95b0;
|
| 33 |
+
font-family: 'Roboto', sans-serif;
|
| 34 |
+
font-weight: 500;
|
| 35 |
+
margin-top: 20px;
|
| 36 |
+
}
|
| 37 |
+
.custom-subheader {
|
| 38 |
+
color: #00FFFF;
|
| 39 |
+
font-family: 'Roboto', sans-serif;
|
| 40 |
+
font-weight: 600;
|
| 41 |
+
margin-bottom: 15px;
|
| 42 |
+
}
|
| 43 |
+
/* Paragraph styling */
|
| 44 |
+
p {
|
| 45 |
+
font-family: 'Georgia', serif;
|
| 46 |
+
line-height: 1.8;
|
| 47 |
+
color: #FFFFFF; /* Darker text color for better visibility */
|
| 48 |
+
margin-bottom: 20px;
|
| 49 |
+
}
|
| 50 |
+
/* List styling with checkmark bullets */
|
| 51 |
+
.icon-bullet {
|
| 52 |
+
list-style-type: none;
|
| 53 |
+
padding-left: 20px;
|
| 54 |
+
}
|
| 55 |
+
.icon-bullet li {
|
| 56 |
+
font-family: 'Georgia', serif;
|
| 57 |
+
font-size: 1.1em;
|
| 58 |
+
margin-bottom: 10px;
|
| 59 |
+
color: #FFFFF0; /* Darker text color for better visibility */
|
| 60 |
+
}
|
| 61 |
+
.icon-bullet li::before {
|
| 62 |
+
content: "βοΈ";
|
| 63 |
+
padding-right: 10px;
|
| 64 |
+
color: #b3b3ff;
|
| 65 |
+
}
|
| 66 |
+
/* Sidebar styling */
|
| 67 |
+
.sidebar .sidebar-content {
|
| 68 |
+
background-color: #ffffff;
|
| 69 |
+
border-radius: 10px;
|
| 70 |
+
padding: 15px;
|
| 71 |
+
}
|
| 72 |
+
.sidebar h2 {
|
| 73 |
+
color: #495057;
|
| 74 |
+
}
|
| 75 |
+
</style>
|
| 76 |
+
""", unsafe_allow_html=True)
|
| 77 |
+
|
| 78 |
+
# Introduction section
|
| 79 |
+
st.markdown("""Before jumping into the context, let's understand some important words..! π""", unsafe_allow_html=True)
|
| 80 |
+
|
| 81 |
+
st.header("Natural Intelligence π§ ")
|
| 82 |
+
st.markdown("""**Natural Intelligence** is the ability of living beings, like humans and animals, to think, learn, and solve problems using their brains or minds. πΎ""", unsafe_allow_html=True)
|
| 83 |
+
|
| 84 |
+
st.header("Artificial Intelligence π€")
|
| 85 |
+
st.markdown("""
|
| 86 |
+
The term 'Artificial' refers to **man-made**, and 'Intelligence' is the ability to learn, understand, and apply knowledge to solve problems. This can be simplified as **man-made intelligence**.
|
| 87 |
+
In this, machines try to **mimic/copy** natural intelligence. π§ β‘οΈ π€
|
| 88 |
+
""", unsafe_allow_html=True)
|
| 89 |
+
|
| 90 |
+
# Interactive section for choosing AI tools
|
| 91 |
+
st.markdown("""
|
| 92 |
+
To mimic/copy natural intelligence, we have 3 powerful tools:
|
| 93 |
+
<ul class="icon-bullet">
|
| 94 |
+
<li>π₯οΈ Machine Learning</li>
|
| 95 |
+
<li>π€Ώ Deep Learning</li>
|
| 96 |
+
<li>π¨ Generative AI</li>
|
| 97 |
+
</ul>
|
| 98 |
+
""", unsafe_allow_html=True)
|
| 99 |
+
|
| 100 |
+
# Let the user choose an AI tool to learn more about
|
| 101 |
+
tool = st.selectbox("Which AI tool would you like to learn more about?",
|
| 102 |
+
["Machine Learning", "Deep Learning", "Generative AI"])
|
| 103 |
+
|
| 104 |
+
if tool == "Machine Learning":
|
| 105 |
+
st.subheader("Machine Learning π₯οΈ")
|
| 106 |
+
st.markdown("""
|
| 107 |
+
Machine Learning is a tool that helps us mimic/copy natural intelligence π§ to create artificial intelligence π€.
|
| 108 |
+
It's like teaching machines how to learn from data and make decisions! π
|
| 109 |
+
""")
|
| 110 |
+
# Interactive chart for machine learning
|
| 111 |
+
data = np.random.randn(100)
|
| 112 |
+
st.line_chart(data)
|
| 113 |
+
st.markdown("Here is a simple data visualization related to Machine Learning. π")
|
| 114 |
+
|
| 115 |
+
elif tool == "Deep Learning":
|
| 116 |
+
st.subheader("Deep Learning π€Ώ")
|
| 117 |
+
st.markdown("""
|
| 118 |
+
Deep Learning is a powerful tool that mimics/copies natural intelligence π§ to create artificial intelligence π€.
|
| 119 |
+
It goes deeper by using neural networks to solve complex problems! π
|
| 120 |
+
""")
|
| 121 |
+
# Interactive slider to simulate Deep Learning training
|
| 122 |
+
epochs = st.slider("Select the number of epochs (training cycles):", min_value=1, max_value=20, value=5)
|
| 123 |
+
st.markdown(f"Training for {epochs} epochs...")
|
| 124 |
+
# Simulate a training graph
|
| 125 |
+
training_data = np.linspace(0, epochs, epochs)
|
| 126 |
+
accuracy = np.random.rand(epochs)
|
| 127 |
+
st.line_chart(accuracy)
|
| 128 |
+
st.markdown("This is a simulated training accuracy plot.")
|
| 129 |
+
|
| 130 |
+
elif tool == "Generative AI":
|
| 131 |
+
st.subheader("Generative AI π¨")
|
| 132 |
+
st.markdown("""
|
| 133 |
+
Generative AI refers to the ability of machines to create new, never-before-seen data.
|
| 134 |
+
It mimics the generative process of natural intelligence, but in a digital form! π¨
|
| 135 |
+
""")
|
| 136 |
+
# Interactive input for generating text or art
|
| 137 |
+
user_input = st.text_input("Enter a prompt for Generative AI to create text:")
|
| 138 |
+
if user_input:
|
| 139 |
+
st.markdown(f"Generative AI is generating text for: {user_input}")
|
| 140 |
+
generated_text = f"This is a generated response to your input: {user_input}"
|
| 141 |
+
st.markdown(generated_text)
|
| 142 |
+
st.markdown("Imagine if this was a generated artwork instead! π¨")
|
| 143 |
+
|
| 144 |
+
# Additional sections about AI and deep learning
|
| 145 |
+
st.subheader("Why ML? Why DL? Why Generative AI? π€")
|
| 146 |
+
st.markdown("""
|
| 147 |
+
Thanks to **natural intelligence**, we have two precious abilities:
|
| 148 |
+
<ul class="icon-bullet">
|
| 149 |
+
<li>π Learn</li>
|
| 150 |
+
<li>β¨ Generate</li>
|
| 151 |
+
</ul>
|
| 152 |
+
""", unsafe_allow_html=True)
|
| 153 |
+
|
| 154 |
+
st.subheader("Whenever machines want to adopt the learning ability π§ ")
|
| 155 |
+
st.markdown("""
|
| 156 |
+
<ul class="icon-bullet">
|
| 157 |
+
<li>π₯οΈ Machine Learning</li>
|
| 158 |
+
<li>π€Ώ Deep Learning</li>
|
| 159 |
+
</ul>
|
| 160 |
+
""", unsafe_allow_html=True)
|
| 161 |
+
|
| 162 |
+
st.subheader("Whenever machines want to adopt the generating ability β¨")
|
| 163 |
+
st.markdown("""
|
| 164 |
+
<ul class="icon-bullet">
|
| 165 |
+
<li>π¨ Generative AI</li>
|
| 166 |
+
</ul>
|
| 167 |
+
""", unsafe_allow_html=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|