Team Ai
Apppublic

kandasani/Machine_learning

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
app.py62 linesDownload Raw Back to root
1 2import streamlit as st3 4# Set the title of the app5st.title("Introduction to Machine Learning")6 7# Add content8st.write("""9Machine learning (ML) is a subset of artificial intelligence (AI) that allows computers to learn and make decisions without being explicitly programmed. 10Machine learning aims to mimic or replicate natural intelligence by using statistical methods. 11ML is a tool that enables machines to learn from data. Machines require two essential components:12""")13 14# List components15st.markdown("""16- **Data**17- **Algorithm**18""")19 20# Section: What does a machine try to learn?21st.subheader("What does a machine try to learn?")22st.write("""23A machine attempts to learn the relationship between input features (xi) and output features (yi) with the help of data and algorithms.""")24st.markdown("<h2 style='text-align: center;'>y = f(x)</h2>", unsafe_allow_html=True)25 26st.write("""However, it is important to note that machines are not able to learn all types of relationships; they can only learn functions. 27While every function can be considered a relation, not every relation qualifies as a function.28""")29 30# Section: When is a relation called a function?31st.subheader("When is a relation consider as a function?")32st.write("""33A relation is considered a function when every input feature corresponds to only one output feature.34 35In machine learning, data should be in a structured(Tabualr) format. Therefore, we need to convert unstructured data into structured data.36""")37 38# Advantages Section39st.header("Advantages of Machine Learning")40advantages = [41    "1. **Automation of Decision-Making**: ML algorithms can analyze data and make decisions without human intervention, leading to faster and more efficient processes.",42    "2. **Improved Accuracy and Predictions**: ML models can enhance their accuracy over time as they are exposed to more data, resulting in better predictions in various applications.",43    "3. **Personalization**: ML enables personalized experiences by analyzing user behaviour and preferences, which is widely used in recommendation systems (e.g., Netflix, Amazon).",44    "4. **Real-Time Analysis**: ML can provide real-time insights and predictions, crucial for applications like fraud detection and monitoring of industrial processes.",45    "5. **Cost Efficiency**: By automating tasks and improving processes, ML can lead to significant cost savings for organizations, reducing the need for manual labor and minimizing errors."46]47 48for advantage in advantages:49    st.markdown(advantage)50 51# Disadvantages Section52st.header("Disadvantages of Machine Learning")53disadvantages = [54    "1. **Data Dependency**: ML models require large amounts of high-quality data to train effectively. Insufficient or poor-quality data can lead to inaccurate predictions and unreliable models.",55    "2. **Complexity and Interpretability**: Many ML algorithms, especially deep learning models, are complex and can act as 'black boxes,' making it difficult to interpret how they arrive at specific decisions or predictions.",56    "3. **Overfitting**: ML models can become too tailored to the training data, capturing noise rather than the underlying pattern. This can result in poor performance on new, unseen data.",57    "4. **High Computational Costs**: Training sophisticated ML models, particularly deep learning models, can require significant computational resources and time, which may not be feasible for all organizations.",58    "5. **Ethical and Bias Concerns**: ML models can inadvertently perpetuate or amplify biases present in the training data, leading to unfair or discriminatory outcomes in applications such as hiring, lending, and law enforcement."59]60 61for disadvantage in disadvantages:62    st.markdown(disadvantage)