raymondEDS commited on
Commit
a7c26a1
Β·
1 Parent(s): 47920c5

demo complete

Browse files
reference/NSDA_Info ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ National Speech & Debate Association 4/20/2016 β€’ www.speechanddebate.org Informative Speaking: Creating a Solid Foundation | 1
2
+ INFORMATIVE SPEAKING: Creating a Solid Foundation
3
+ This guide offers tips for making effective choices in Informative Speaking. This guide will focus on
4
+ the foundational aspects of effective Informative Speaking, to demonstrate what elements make an
5
+ Informative successful. As of this writing, Informative is still in its first year as a competitive event at
6
+ the National Speech & Debate Tournament, meaning there is no precedent to draw upon when thinking
7
+ about a great Informative Speech at NSDA Nationals. This also means that, as a competitor, you have
8
+ the opportunity to shape how people think about Informative in the coming years, a rare opportunity
9
+ in an activity comprised of events with long and storied histories. To help you take advantage of this
10
+ opportunity, this guide will detail structure, visual aids, time, and using ballot to improve your speech.
11
+ Structure in Informative Speaking
12
+ The commonality among most Informative Speaking structures is the presence of an introduction, three main points, and a
13
+ conclusion. Where speeches differ is what the three main points contain. As opposed to Oratory, where you generally have
14
+ some combination of problems, causes, and solutions, Informative has a less concrete direction that each speech can follow.
15
+ Typically, the third main point will be implications, or what your topic means to society as a whole. To begin developing a
16
+ structure, brainstorm what you find interesting about your topic, and write down a list of things you would like to include in
17
+ your speech. From there, go through the list and start separating it into six different categories. Try to make the categories
18
+ broad enough to contain lots of information, but distinct enough to keep them separate from one another. Upon completing
19
+ and categorizing this list, you will have a good idea of how to organize your speech!
20
+ To illustrate this concept in action, pretend that you would like to do an Informative on the Fairphone, a European smartphone
21
+ built with ethically purchased parts and built to last longer than conventional smartphones. You might generate a list like this:
22
+ β€’ The most recent Fairphone, the Fairphone 2, is modular (it can be taken apart and have parts replaced easily).
23
+ β€’ Availability of the phone, cost, etc.
24
+ β€’ The company releases where the minerals needed to create the phone are purchased from, who manufactures the
25
+ phone and how both of these processes (mining and manufacturing) are handled ethically.
26
+ β€’ How could Fairphone affect e-waste?
27
+ β€’ How smartphones are normally made.
28
+ β€’ History of the company.
29
+ β€’ How they differ from other smartphone manufacturers.
30
+ β€’ Barriers to entry.
31
+ β€’ Is Fairphone going to benefit or compromise itself by setting industry standards?
32
+ National Speech & Debate Association 4/20/2016 β€’ www.speechanddebate.org Informative Speaking: Creating a Solid Foundation | 2
33
+ INFORMATIVE SPEAKING: Creating a Solid Foundation
34
+ From there, this uncategorized list can be changed to a list organized by theme:
35
+ 1. What Fairphone is:
36
+ a. History of the company.
37
+ i. How they differ from other smartphone manufacturers.
38
+ b. Availability of the phone, cost, etc.
39
+ 2. What makes Fairphone unique:
40
+ a. The most recent Fairphone, the Fairphone 2, is modular (it can be taken apart and have parts replaced easily).
41
+ b. The company releases where the minerals needed to create the phone are purchased from, who manufactures
42
+ the phone and how both of these processes (mining and manufacturing) are handled ethically.
43
+ 3. Implications
44
+ a. How could Fairphone affect e-waste?
45
+ i. Find information demonstrating that e-waste is an issue.
46
+ ii. Find out what the average life cycle of a smartphone is.
47
+ iii. Does Fairphone effectively combat that?
48
+ b. Is Fairphone going to benefit or compromise itself by setting industry standards?
49
+ i. Introduce Project Ara, Google’s planned modular smartphone.
50
+ ii. Find examples of small companies innovating first, then closing down because a bigger company borrowed
51
+ their ideas on a much bigger scale.
52
+ As you can see, the initial list has transformed into three categories of information, each with a broad enough label to include
53
+ lots of detail, yet distinct from one another. In this case, the structure would likely be using the first two categories as main
54
+ body points, with the information covered within them as subpoints, and the third category would be implications. Going
55
+ through this process will give you a rough outline, detail what you need to research more, and help guide how you think about
56
+ your Informative Speech. Additionally, it can help determine if you want to use VAs! In this particular example, a modular
57
+ smartphone is much easier to understand when you see one than when the concept is explained, so it might be a good idea
58
+ to plan on including a VA.
59
+ Lastly, you may notice that the categorized list is not uniformβ€”meaning, some subpoints have a few pieces of information
60
+ included in them, others do not, etc. This is intentional! Your rough outline is supposed to be messy. There will be items that
61
+ you generate that don’t make the cut into the categorized list. There will be things you never thought of that are added later.
62
+ That’s totally okay! In fact, looking at your categorized list will give you a good idea of what gaps you have in your speech.
63
+ In the example above, 1A has the most information through the first two points, so you would know to expand upon the
64
+ other points when you revise your outline and research. Don’t expect to have a perfect outline the first time you try. It is a
65
+ continually evolving process made easier the more willing you are to put your thoughts to page and begin generating ideas!
66
+ Should I Use Visual Aids?
67
+ There is no single answer to this question; it depends on your topic and speech. Visual Aids, or VAs, are wonderful tools
68
+ to demonstrate and explain concepts that emerge in your speech. For instance, if you are talking about a new water
69
+ purification technology that can decontaminate water in four distinct steps, having a flow chart of those steps will give the
70
+ audience a clear and tangible idea of how the technology works. Being able to explain your topic visually will reduce the
71
+ burden to verbally illustrate complex parts of your topic.
72
+ Conversely, if your topic is more abstract, you are less likely to need a VA. An Informative about an economic ideology, for
73
+ instance, will not benefit as clearly from a VA as the example above. When deciding whether or not to use a VA, consider the
74
+ National Speech & Debate Association 4/20/2016 β€’ www.speechanddebate.org Informative Speaking: Creating a Solid Foundation | 3
75
+ INFORMATIVE SPEAKING: Creating a Solid Foundation
76
+ following: Is there a part of the speech that people are having trouble understanding? Do I have a specific VA in mind? Would I
77
+ need to revise my speech heavily to include a VA? While this list is not exhaustive, it is a good starting point. If your audience
78
+ and judges can easily understand your speech, then you likely don’t need a VA.
79
+ When using VAs, make sure to write with them in mind. Writing to reference a VA is different from the typical
80
+ writing you will have done in speech and debate. The most immediate difference is to use language that refers to your VA
81
+ as a replacement for language you would have used without it. Much like using a PowerPoint in a class presentation, do not
82
+ repeat the information your VA conveys; instead, guide your audience through the relevant information that is presented
83
+ visually. For instance, a speech on the Olympics may highlight the famous image from the 1968 Olympics featuring the gold
84
+ and silver medalists on the podium with their heads bowed and arms raised in protest. Instead of describing the scene, as in
85
+ the sentence prior, write with the knowledge that you can gesture toward a specific part or person in the VA and tailor the
86
+ information to highlight the important aspects of the photograph.
87
+ Keep in mind that VAs are not required! While they can do wonders to enhance and augment your speech, they can
88
+ also distract and clutter your speech when they are not carefully considered. Just like any other part of your speech writing
89
+ process, decide what is best for you when choosing whether or not to use a VA.
90
+ Time
91
+ This section will be brief, but it is the most important consideration in your speech. Be certain that your performance
92
+ is consistently in time. Speech is a subjective endeavor; there is always going to be variance. However, one of the only
93
+ guaranteed ways to ensure that your performance ranks poorly in a round is to be over or under the time limit. Worrying
94
+ about time in your performance is neither fun nor exciting, but that doesn’t mean it isn’t necessary for success.
95
+ Ballot Criticism
96
+ Ballots are the most direct and important feedback you can receive on your performance, and merit much of
97
+ your attention. Here are a few strategies to break them down into actionable plans for improving your performance. Be
98
+ sure to keep all of your ballots throughout the year, and from time to time, look through them and sort the feedback into
99
+ categories, focusing on the type of comment and how many times it comes up. For instance, if you receive a comment on
100
+ 60% of your ballots asking you to slow down, it’s time to slow down and cut from your speech. Paying attention to how often
101
+ you get a certain type of comment is an indispensable way of making your performance accessible for a large audience.
102
+ Next, sometimes you’ll get feedback that points out a problem, but does not offer a clear solution. While this can be
103
+ frustrating, that doesn’t mean it isn’t valuable. Receiving a lot of comments that say your first point is confusing illustrates the
104
+ problem you need to solve. With feedback like this, brainstorm possible solutions and pay attention to how these changes are
105
+ perceived on ballots after they have been made. Once you stop receiving feedback about clarity in your first point, you know
106
+ you have successfully solved the problem!
107
+ Finally, don’t ignore comments if they only appear on one ballot. Good ballot analysis is a balance between quality and
108
+ quantity of feedback. If you read a comment that makes you stop and think about how you’ve constructed your performance,
109
+ then it’s likely a very good piece of feedback even if nobody else has pointed it out. The next time you hit a roadblock
110
+ when thinking about how to improve your performance, look through your old ballots. Often enough, a comment you had
111
+ forgotten about or written off earlier will provide you the inspiration you need to make the necessary changes!
112
+ Learn More!
113
+ The National Speech & Debate Association is the leading provider of competitive and educational resources to aid
114
+ students and coaches as they explore our competitive events. Take advantage of the amazing benefits of being a member by
115
+ using our resources to help you advance yourself in competitive speech and debate activities. Visit www.speechanddebate.org
116
+ for more information concerning the rules and guidelines for participating in National circuit competition.
src/__pycache__/config.cpython-311.pyc CHANGED
Binary files a/src/__pycache__/config.cpython-311.pyc and b/src/__pycache__/config.cpython-311.pyc differ
 
src/modules/__pycache__/intro.cpython-311.pyc CHANGED
Binary files a/src/modules/__pycache__/intro.cpython-311.pyc and b/src/modules/__pycache__/intro.cpython-311.pyc differ
 
src/modules/__pycache__/module1.cpython-311.pyc CHANGED
Binary files a/src/modules/__pycache__/module1.cpython-311.pyc and b/src/modules/__pycache__/module1.cpython-311.pyc differ
 
src/modules/__pycache__/module2.cpython-311.pyc CHANGED
Binary files a/src/modules/__pycache__/module2.cpython-311.pyc and b/src/modules/__pycache__/module2.cpython-311.pyc differ
 
src/modules/__pycache__/module3.cpython-311.pyc CHANGED
Binary files a/src/modules/__pycache__/module3.cpython-311.pyc and b/src/modules/__pycache__/module3.cpython-311.pyc differ
 
src/modules/intro.py CHANGED
@@ -1,69 +1,194 @@
1
  import streamlit as st
2
- from config import PRIMARY_COLOR, SECONDARY_COLOR, ACCENT_COLOR
 
 
3
 
4
  def show():
5
- st.markdown("""
6
- # Welcome to the Course!!! πŸŽ“
7
-
8
- <div class="highlight">This comprehensive course is designed to help you master the subject matter through
9
- a structured learning approach. You'll find everything you need to succeed right here.</div>
10
- """, unsafe_allow_html=True)
11
-
12
- # Course Overview Section
13
- st.markdown("## πŸ“š Course Overview")
14
 
15
- col1, col2 = st.columns(2)
 
 
 
 
 
 
 
 
 
16
 
17
  with col1:
 
18
  st.markdown("""
19
- ### 🎯 Learning Objectives
20
- <div class="stMarkdown">
21
- - Master fundamental concepts
22
- - Develop practical skills
23
- - Apply knowledge to real-world scenarios
24
- - Build a strong foundation for advanced topics
25
- </div>
26
- """, unsafe_allow_html=True)
27
 
28
  with col2:
 
29
  st.markdown("""
30
- ### πŸ“‹ Course Structure
31
- <div class="stMarkdown">
32
- - Interactive modules
33
- - Hands-on exercises
34
- - Practical assignments
35
- - Comprehensive resources
36
- </div>
37
- """, unsafe_allow_html=True)
38
 
39
- # Prerequisites Section
40
- st.markdown("## πŸ”§ Prerequisites")
41
- st.markdown("""
42
- <div class="stMarkdown">
43
- To get the most out of this course, you should have:
44
- - Basic understanding of the subject
45
- - Required software installed
46
- - Dedication to learning
47
- - Regular time commitment
48
- </div>
49
- """, unsafe_allow_html=True)
50
 
51
- # How to Succeed Section
52
- st.markdown("## πŸ’‘ How to Succeed")
53
- st.markdown("""
54
- <div class="stMarkdown">
55
- Follow these tips to make the most of your learning journey:
56
- 1. Complete all modules in sequence
57
- 2. Practice regularly with exercises
58
- 3. Participate in discussions
59
- 4. Submit assignments on time
60
- 5. Review and revise regularly
61
- </div>
62
- """, unsafe_allow_html=True)
63
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
  # Call to Action
65
- st.markdown("""
66
- <div class="highlight">
67
- Ready to begin your learning journey? Select a module from the sidebar to get started!
68
- </div>
69
- """, unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import streamlit as st
2
+ from datetime import datetime, timedelta
3
+ import calendar
4
+ import pandas as pd
5
 
6
  def show():
7
+ # Main Header
8
+ st.title("Your Personalized 12-Week Learning Journey")
 
 
 
 
 
 
 
9
 
10
+ # Introduction
11
+ st.info("""
12
+ Welcome to your personalized learning experience! We've designed a comprehensive 12-week program that combines
13
+ expert instruction, customized content, and dedicated support to ensure your success. Your journey will be
14
+ guided by a team of professionals committed to your learning goals.
15
+ """)
16
+
17
+ # Your Learning Team
18
+ st.subheader("Your Dedicated Learning Team")
19
+ col1, col2, col3 = st.columns(3)
20
 
21
  with col1:
22
+ st.markdown("### πŸ‘¨β€πŸ« Personal Instructor")
23
  st.markdown("""
24
+ - One-on-one guidance
25
+ - Regular check-ins
26
+ - Personalized feedback
27
+ - Progress monitoring
28
+ """)
 
 
 
29
 
30
  with col2:
31
+ st.markdown("### 🎨 Learning Designer")
32
  st.markdown("""
33
+ - Customized curriculum
34
+ - Adaptive content
35
+ - Learning path optimization
36
+ - Resource development
37
+ """)
 
 
 
38
 
39
+ with col3:
40
+ st.markdown("### πŸ’» LMS Support")
41
+ st.markdown("""
42
+ - Technical assistance
43
+ - Platform navigation
44
+ - Resource access
45
+ - Progress tracking
46
+ """)
47
+
48
+ # 12-Week Program Schedule
49
+ st.subheader("12-Week Program Schedule")
50
 
51
+ # Get current date
52
+ today = datetime.now()
53
+ # Find the next Monday
54
+ days_until_monday = (7 - today.weekday()) % 7
55
+ start_date = today + timedelta(days=days_until_monday)
 
 
 
 
 
 
 
56
 
57
+ # Define the program schedule
58
+ program_schedule = [
59
+ {
60
+ "Week": "Week 1",
61
+ "Session": "Initial Assessment & Goal Setting",
62
+ "Instructor": "Dr. Sarah Chen",
63
+ "Content": "Learning style assessment, goal setting, program overview",
64
+ "Deliverables": "Learning style report, personalized goals document",
65
+ "Support": "One-on-one session, LMS orientation"
66
+ },
67
+ {
68
+ "Week": "Week 2",
69
+ "Session": "Foundation Building",
70
+ "Instructor": "Dr. Sarah Chen",
71
+ "Content": "Core concepts, fundamental principles, basic skills",
72
+ "Deliverables": "Concept map, skill assessment",
73
+ "Support": "Weekly check-in, resource access"
74
+ },
75
+ {
76
+ "Week": "Week 3",
77
+ "Session": "Advanced Concepts I",
78
+ "Instructor": "Prof. James Wilson",
79
+ "Content": "Intermediate topics, case studies, practical examples",
80
+ "Deliverables": "Case study analysis, concept application",
81
+ "Support": "Group discussion, peer review"
82
+ },
83
+ {
84
+ "Week": "Week 4",
85
+ "Session": "Advanced Concepts II",
86
+ "Instructor": "Prof. James Wilson",
87
+ "Content": "Advanced techniques, real-world applications",
88
+ "Deliverables": "Technical documentation, application examples",
89
+ "Support": "Technical support, code review"
90
+ },
91
+ {
92
+ "Week": "Week 5",
93
+ "Session": "Practical Workshop I",
94
+ "Instructor": "Dr. Maria Rodriguez",
95
+ "Content": "Hands-on exercises, group activities, peer learning",
96
+ "Deliverables": "Workshop outcomes, peer feedback",
97
+ "Support": "Workshop materials, group collaboration"
98
+ },
99
+ {
100
+ "Week": "Week 6",
101
+ "Session": "Practical Workshop II",
102
+ "Instructor": "Dr. Maria Rodriguez",
103
+ "Content": "Advanced exercises, problem-solving scenarios",
104
+ "Deliverables": "Problem solutions, implementation plan",
105
+ "Support": "Technical guidance, resource access"
106
+ },
107
+ {
108
+ "Week": "Week 7",
109
+ "Session": "Specialized Topics I",
110
+ "Instructor": "Dr. Sarah Chen",
111
+ "Content": "Industry-specific knowledge, current trends",
112
+ "Deliverables": "Industry analysis, trend report",
113
+ "Support": "Industry expert session, research resources"
114
+ },
115
+ {
116
+ "Week": "Week 8",
117
+ "Session": "Specialized Topics II",
118
+ "Instructor": "Prof. James Wilson",
119
+ "Content": "Advanced industry applications, emerging technologies",
120
+ "Deliverables": "Technology assessment, application proposal",
121
+ "Support": "Technical consultation, resource access"
122
+ },
123
+ {
124
+ "Week": "Week 9",
125
+ "Session": "Project Planning",
126
+ "Instructor": "Dr. Maria Rodriguez",
127
+ "Content": "Project scope definition, resource planning",
128
+ "Deliverables": "Project plan, resource allocation",
129
+ "Support": "Planning tools, template access"
130
+ },
131
+ {
132
+ "Week": "Week 10",
133
+ "Session": "Project Development",
134
+ "Instructor": "Dr. Sarah Chen",
135
+ "Content": "Project implementation, progress review",
136
+ "Deliverables": "Project milestones, progress report",
137
+ "Support": "Development resources, technical support"
138
+ },
139
+ {
140
+ "Week": "Week 11",
141
+ "Session": "Project Refinement",
142
+ "Instructor": "Prof. James Wilson",
143
+ "Content": "Project optimization, feedback integration",
144
+ "Deliverables": "Refined project, feedback report",
145
+ "Support": "Review session, optimization tools"
146
+ },
147
+ {
148
+ "Week": "Week 12",
149
+ "Session": "Final Presentation & Review",
150
+ "Instructor": "All Instructors",
151
+ "Content": "Project presentation, program review, future planning",
152
+ "Deliverables": "Final project, presentation, program evaluation",
153
+ "Support": "Presentation tools, feedback session"
154
+ }
155
+ ]
156
+
157
+ # Convert to DataFrame and display
158
+ df = pd.DataFrame(program_schedule)
159
+ st.dataframe(
160
+ df,
161
+ use_container_width=True,
162
+ hide_index=True,
163
+ column_config={
164
+ "Week": st.column_config.TextColumn("Week", width="small"),
165
+ "Session": st.column_config.TextColumn("Session", width="medium"),
166
+ "Instructor": st.column_config.TextColumn("Instructor", width="small"),
167
+ "Content": st.column_config.TextColumn("Content", width="large"),
168
+ "Deliverables": st.column_config.TextColumn("Deliverables", width="medium"),
169
+ "Support": st.column_config.TextColumn("Support", width="medium")
170
+ }
171
+ )
172
+
173
  # Call to Action
174
+ st.info("""
175
+ ### Ready to Begin Your Journey?
176
+ Complete the form below to get started with your personalized learning experience.
177
+ """)
178
+
179
+ # Registration Form
180
+ with st.form("registration_form"):
181
+ st.markdown("### Registration Form")
182
+ name = st.text_input("Full Name")
183
+ email = st.text_input("Email Address")
184
+ phone = st.text_input("Phone Number")
185
+ goals = st.text_area("What are your learning goals?")
186
+ experience = st.selectbox("Current Experience Level",
187
+ ["Beginner", "Intermediate", "Advanced"])
188
+ preferred_time = st.selectbox("Preferred Learning Time",
189
+ ["Morning", "Afternoon", "Evening"])
190
+
191
+ submitted = st.form_submit_button("Start My Learning Journey")
192
+
193
+ if submitted:
194
+ st.success("Thank you for registering! Our team will contact you within 24 hours to begin your personalized learning journey.")
src/modules/module1.py CHANGED
@@ -1,14 +1,404 @@
1
  import streamlit as st
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  def show():
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  st.markdown("""
5
- # Module 1: Getting Started
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
- ## Learning Objectives
8
- - Understand the basics
9
- - Set up your environment
10
- - Complete your first exercise
 
 
 
 
 
 
 
11
 
12
- ## Content
13
- This module will cover the fundamental concepts you need to know.
14
- """)
 
 
 
 
 
 
 
1
  import streamlit as st
2
+ import json
3
+
4
+ def create_pdf(structure):
5
+ pdf = FPDF()
6
+ pdf.add_page()
7
+
8
+ # Title
9
+ pdf.set_font('Arial', 'B', 16)
10
+ pdf.cell(0, 10, 'Informative Speech Structure', ln=True, align='C')
11
+ pdf.ln(10)
12
+
13
+ # Introduction
14
+ pdf.set_font('Arial', 'B', 14)
15
+ pdf.cell(0, 10, 'Introduction', ln=True)
16
+ pdf.set_font('Arial', '', 12)
17
+ intro_points = [
18
+ '- Attention Getter',
19
+ '- Topic Introduction',
20
+ '- Credibility Statement',
21
+ '- Preview of Main Points'
22
+ ]
23
+ for point in intro_points:
24
+ pdf.cell(0, 10, point, ln=True)
25
+ pdf.ln(5)
26
+
27
+ # Main Points
28
+ pdf.set_font('Arial', 'B', 14)
29
+ pdf.cell(0, 10, 'Body', ln=True)
30
+ for i, point in enumerate(structure['main_points'], 1):
31
+ pdf.set_font('Arial', 'B', 12)
32
+ pdf.cell(0, 10, f'Main Point {i}: {point["category"]}', ln=True)
33
+ pdf.set_font('Arial', '', 12)
34
+ for item in point['items']:
35
+ pdf.cell(0, 10, f'- {item}', ln=True)
36
+ pdf.ln(5)
37
+
38
+ # Conclusion
39
+ pdf.set_font('Arial', 'B', 14)
40
+ pdf.cell(0, 10, 'Conclusion', ln=True)
41
+ pdf.set_font('Arial', '', 12)
42
+ conclusion_points = [
43
+ '- Signal the End',
44
+ '- Review Main Points',
45
+ '- Memorable Closing'
46
+ ]
47
+ for point in conclusion_points:
48
+ pdf.cell(0, 10, point, ln=True)
49
+
50
+ return pdf
51
 
52
  def show():
53
+ # Add custom CSS for the download button and new sections
54
+ st.markdown("""
55
+ <style>
56
+ div[data-testid="stDownloadButton"] button {
57
+ background-color: #0066cc;
58
+ color: white;
59
+ font-weight: bold;
60
+ padding: 12px 24px;
61
+ border: none;
62
+ border-radius: 6px;
63
+ cursor: pointer;
64
+ box-shadow: 0 2px 4px rgba(0,0,0,0.2);
65
+ transition: all 0.3s ease;
66
+ }
67
+ div[data-testid="stDownloadButton"] button:hover {
68
+ background-color: #0052a3;
69
+ transform: translateY(-2px);
70
+ box-shadow: 0 4px 8px rgba(0,0,0,0.2);
71
+ }
72
+ div[data-testid="stDownloadButton"] button p {
73
+ color: white !important;
74
+ }
75
+ .main-point-box {
76
+ background-color: #f0f2f6;
77
+ border-radius: 10px;
78
+ padding: 20px;
79
+ margin: 10px 0;
80
+ border-left: 5px solid #0066cc;
81
+ }
82
+ .reference-box {
83
+ background-color: #fff3cd;
84
+ border-radius: 10px;
85
+ padding: 20px;
86
+ margin: 10px 0;
87
+ border-left: 5px solid #ffc107;
88
+ }
89
+ .example-box {
90
+ background-color: #e8f4f8;
91
+ border-radius: 10px;
92
+ padding: 20px;
93
+ margin: 10px 0;
94
+ border-left: 5px solid #2E86C1;
95
+ }
96
+ </style>
97
+ """, unsafe_allow_html=True)
98
+
99
+ st.title("Module 1: Informative Speech Structure")
100
+
101
+ # Introduction
102
+ st.markdown("""
103
+ Welcome to the National Speech & Debate Association's approach to informative speaking.
104
+ This module will guide you through creating an effective informative speech that educates,
105
+ engages, and enlightens your audience.
106
+ """)
107
+
108
+ # Learning Objectives
109
+ st.subheader("Learning Objectives")
110
+ st.markdown("""
111
+ - Master the NSDA's three-point structure for informative speaking
112
+ - Learn how to effectively use references to support your points
113
+ - Create a well-organized speech that builds audience understanding
114
+ - Develop engaging content that educates your audience
115
+ """)
116
+
117
+ # The Three-Point Structure
118
+ st.subheader("The Three-Point Structure")
119
+ st.markdown("""
120
+ The foundation of an effective informative speech lies in its structure.
121
+ Every great informative speech follows a clear three-point structure that helps
122
+ your audience understand and remember your message.
123
+ """)
124
+
125
+ col1, col2, col3 = st.columns(3)
126
+
127
+ with col1:
128
+ st.markdown("""
129
+ <div class="main-point-box">
130
+ <h3>πŸ” Point 1: Foundation</h3>
131
+ <p>Start with the basics:</p>
132
+ <ul>
133
+ <li>What is it?</li>
134
+ <li>How does it work?</li>
135
+ <li>Key features</li>
136
+ </ul>
137
+ <p><em>This builds your audience's understanding</em></p>
138
+ </div>
139
+ """, unsafe_allow_html=True)
140
+
141
+ with col2:
142
+ st.markdown("""
143
+ <div class="main-point-box">
144
+ <h3>πŸ’‘ Point 2: Development</h3>
145
+ <p>Build on the foundation:</p>
146
+ <ul>
147
+ <li>How is it unique?</li>
148
+ <li>What makes it special?</li>
149
+ <li>Key differences</li>
150
+ </ul>
151
+ <p><em>This adds depth to their knowledge</em></p>
152
+ </div>
153
+ """, unsafe_allow_html=True)
154
+
155
+ with col3:
156
+ st.markdown("""
157
+ <div class="main-point-box">
158
+ <h3>🌍 Point 3: Implications</h3>
159
+ <p>Connect to bigger picture:</p>
160
+ <ul>
161
+ <li>Why does it matter?</li>
162
+ <li>Impact on society</li>
163
+ <li>Future significance</li>
164
+ </ul>
165
+ <p><em>This shows why it's important</em></p>
166
+ </div>
167
+ """, unsafe_allow_html=True)
168
+
169
+ # Reference Section
170
+ st.markdown("""
171
+ <div class="reference-box">
172
+ <h3>πŸ“š The Power of References</h3>
173
+ <p>References are crucial in informative speaking because they:</p>
174
+ <ul>
175
+ <li>Build credibility with your audience</li>
176
+ <li>Support your main points with evidence</li>
177
+ <li>Show thorough research and preparation</li>
178
+ <li>Help you avoid plagiarism</li>
179
+ <li>Allow listeners to verify your information</li>
180
+ </ul>
181
+ <p><strong>Remember:</strong> Every key fact, statistic, or quote in your speech should be traceable to a reliable source.</p>
182
+ </div>
183
+ """, unsafe_allow_html=True)
184
+
185
+ # Example Section
186
+ st.markdown("### πŸ“± Real-World Example")
187
+
188
+ # Create three columns for the structure
189
+ col1, col2, col3 = st.columns(3)
190
+
191
+ with col1:
192
+ st.info("""
193
+ **Foundation**
194
+ What is Fairphone?
195
+ - Company history
196
+ - Basic features
197
+ - Availability
198
+ """)
199
+
200
+ with col2:
201
+ st.info("""
202
+ **Development**
203
+ What makes it unique?
204
+ - Modular design
205
+ - Ethical manufacturing
206
+ - Supply chain
207
+ """)
208
+
209
+ with col3:
210
+ st.info("""
211
+ **Implications**
212
+ Why does it matter?
213
+ - E-waste impact
214
+ - Industry standards
215
+ - Future technology
216
+ """)
217
+
218
+ # Add a visual separator
219
+ st.markdown("---")
220
+
221
+ # Add a note about references
222
+ st.markdown("""
223
+ > πŸ’‘ **Pro Tip**: Each point should be supported by at least one credible source.
224
+ For example, when discussing e-waste impact, cite specific statistics or research studies.
225
+ """)
226
+
227
+ # Interactive Outline Builder
228
+ st.subheader("Create Your Speech Structure")
229
+ st.markdown("""
230
+ Now it's your turn! Use the interactive builder below to create your own speech structure.
231
+ Remember to:
232
+ - Start with a strong foundation
233
+ - Build on your first point
234
+ - Connect to bigger implications
235
+ - Include references for each key point
236
+ """)
237
+
238
+ # Outline Creation Process
239
+ st.subheader("Outline Creation Process")
240
+
241
+ # Create Your Outline Structure
242
+ st.markdown("### Create Your Outline Structure")
243
+ st.markdown("""
244
+ Create your final structure with:
245
+ - Introduction
246
+ - Three main points
247
+ - Conclusion
248
+ """)
249
+
250
+ # Interactive Speech Outlining Activity
251
+ st.markdown("### 🎯 Create Your Speech Outline")
252
+
253
+ # Add custom CSS for the blocks
254
  st.markdown("""
255
+ <style>
256
+ .main-point-block {
257
+ background-color: #f0f2f6;
258
+ border-radius: 10px;
259
+ padding: 20px;
260
+ margin: 10px 0;
261
+ border-left: 5px solid #0066cc;
262
+ }
263
+ .supporting-points {
264
+ background-color: #ffffff;
265
+ border-radius: 8px;
266
+ padding: 15px;
267
+ margin: 10px 0;
268
+ border: 1px solid #e0e0e0;
269
+ }
270
+ </style>
271
+ """, unsafe_allow_html=True)
272
+
273
+ # Initialize session state
274
+ if 'speech_outline' not in st.session_state:
275
+ st.session_state.speech_outline = {
276
+ 'foundation': {'main': '', 'points': []},
277
+ 'development': {'main': '', 'points': []},
278
+ 'implications': {'main': '', 'points': []}
279
+ }
280
+
281
+ # Create three columns for the main points
282
+ col1, col2, col3 = st.columns(3)
283
+
284
+ with col1:
285
+ st.markdown("##### πŸ” Foundation")
286
+ st.markdown("What is the basic information your audience needs to know?")
287
+ foundation_main = st.text_input(
288
+ "Main Point:",
289
+ value=st.session_state.speech_outline['foundation']['main'],
290
+ help="The main idea about the basics of your topic"
291
+ )
292
+ if foundation_main:
293
+ st.session_state.speech_outline['foundation']['main'] = foundation_main
294
+ foundation_points = st.text_area(
295
+ "Supporting Points (one per line):",
296
+ value='\n'.join(st.session_state.speech_outline['foundation']['points']),
297
+ help="List the key points that support your foundation"
298
+ )
299
+ if foundation_points:
300
+ st.session_state.speech_outline['foundation']['points'] = [p.strip() for p in foundation_points.split('\n') if p.strip()]
301
+
302
+ with col2:
303
+ st.markdown("##### πŸ’‘ Development")
304
+ st.markdown("What makes your topic unique or special?")
305
+ development_main = st.text_input(
306
+ "Main Point:",
307
+ value=st.session_state.speech_outline['development']['main'],
308
+ help="The main idea about what makes your topic unique"
309
+ )
310
+ if development_main:
311
+ st.session_state.speech_outline['development']['main'] = development_main
312
+ development_points = st.text_area(
313
+ "Supporting Points (one per line):",
314
+ value='\n'.join(st.session_state.speech_outline['development']['points']),
315
+ help="List the key points that support your development"
316
+ )
317
+ if development_points:
318
+ st.session_state.speech_outline['development']['points'] = [p.strip() for p in development_points.split('\n') if p.strip()]
319
+
320
+ with col3:
321
+ st.markdown("##### 🌍 Implications")
322
+ st.markdown("Why does your topic matter to society?")
323
+ implications_main = st.text_input(
324
+ "Main Point:",
325
+ value=st.session_state.speech_outline['implications']['main'],
326
+ help="The main idea about why your topic matters"
327
+ )
328
+ if implications_main:
329
+ st.session_state.speech_outline['implications']['main'] = implications_main
330
+ implications_points = st.text_area(
331
+ "Supporting Points (one per line):",
332
+ value='\n'.join(st.session_state.speech_outline['implications']['points']),
333
+ help="List the key points that support your implications"
334
+ )
335
+ if implications_points:
336
+ st.session_state.speech_outline['implications']['points'] = [p.strip() for p in implications_points.split('\n') if p.strip()]
337
+
338
+ # Generate Outline
339
+ if st.button("πŸ“ Generate Speech Outline"):
340
+ st.markdown("### Your Speech Outline")
341
+
342
+ # Create a single markdown box for the entire outline
343
+ outline_content = f"""
344
+ **Introduction**
345
+ \n - Attention Getter
346
+ \n - Topic Introduction
347
+ \n - Credibility Statement
348
+ \n - Preview of Main Points
349
+
350
+
351
+ **Foundation**
352
+ Main Point: {st.session_state.speech_outline['foundation']['main']}
353
+ Supporting Points:
354
+ {chr(10).join([f"β€’ {point}" for point in st.session_state.speech_outline['foundation']['points']])}
355
+
356
+ **Development**
357
+ Main Point: {st.session_state.speech_outline['development']['main']}
358
+ Supporting Points:
359
+ {chr(10).join([f"β€’ {point}" for point in st.session_state.speech_outline['development']['points']])}
360
+
361
+ **Implications**
362
+ Main Point: {st.session_state.speech_outline['implications']['main']}
363
+ Supporting Points:
364
+ {chr(10).join([f"β€’ {point}" for point in st.session_state.speech_outline['implications']['points']])}
365
+
366
+ \n**Conclusion**
367
+ \n - Signal the End
368
+ \n - Review Main Points
369
+ \n - Memorable Closing
370
+ """
371
+
372
+ # Display the outline in a clean format
373
+ st.markdown(outline_content)
374
+
375
+ # Download Button
376
+ outline_json = json.dumps(st.session_state.speech_outline, indent=2)
377
+ st.download_button(
378
+ label="πŸ“₯ Download Your Outline",
379
+ data=outline_json,
380
+ file_name="speech_outline.json",
381
+ mime="application/json"
382
+ )
383
 
384
+ # NSDA Tips
385
+ st.subheader("NSDA Tips for Success")
386
+ with st.expander("πŸ“š Key Tips"):
387
+ st.markdown("""
388
+ - Don't expect a perfect outline on your first try
389
+ - Your outline will evolve as you research and practice
390
+ - Look for gaps in your information
391
+ - Consider if visual aids would help explain complex concepts
392
+ - Keep track of your time - staying within limits is crucial
393
+ - Save all feedback and use it to improve
394
+ """)
395
 
396
+ # Next Steps
397
+ st.info("""
398
+ ### Next Steps
399
+ After creating your structure:
400
+ 1. Begin researching your main points in detail
401
+ 2. Consider if visual aids would enhance your speech
402
+ 3. Practice your timing
403
+ 4. Move on to Module 2: Developing Your Speech Content
404
+ """)
src/modules/module2.py CHANGED
@@ -1,14 +1,155 @@
1
  import streamlit as st
2
 
3
  def show():
 
 
 
4
  st.markdown("""
5
- # Module 2: Core Concepts
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
- ## Learning Objectives
8
- - Master key concepts
9
- - Apply knowledge in practice
10
- - Work through examples
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
12
- ## Content
13
- Dive deeper into the core concepts of the subject.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  """)
 
1
  import streamlit as st
2
 
3
  def show():
4
+ st.title("Module 2: Learning Your Speech")
5
+
6
+ # Introduction
7
  st.markdown("""
8
+ Welcome to Module 2! In this module, we'll explore effective ways to learn and memorize your speech.
9
+ """)
10
+
11
+ # Embed YouTube Video
12
+ st.video("https://www.youtube.com/watch?v=wTX5v_VhmiY")
13
+
14
+ # Interactive Learning Methods Section
15
+ st.subheader("Interactive Learning Methods")
16
+
17
+ # Create columns for different learning approaches
18
+ col1, col2 = st.columns(2)
19
+
20
+ with col1:
21
+ st.markdown("### 🎯 Practice Methods")
22
+ practice_method = st.radio(
23
+ "Choose a practice method to explore:",
24
+ ["Mirror Practice", "Recording Yourself", "Peer Practice", "Timed Practice"]
25
+ )
26
+
27
+ if practice_method == "Mirror Practice":
28
+ st.info("""
29
+ **Mirror Practice Benefits:**
30
+ - See your facial expressions and body language
31
+ - Build confidence with eye contact
32
+ - Practice gestures naturally
33
+ - Get immediate visual feedback
34
+ """)
35
+ elif practice_method == "Recording Yourself":
36
+ st.info("""
37
+ **Recording Benefits:**
38
+ - Review your delivery objectively
39
+ - Identify areas for improvement
40
+ - Track progress over time
41
+ - Practice timing and pacing
42
+ """)
43
+ elif practice_method == "Peer Practice":
44
+ st.info("""
45
+ **Peer Practice Benefits:**
46
+ - Get constructive feedback
47
+ - Practice with an audience
48
+ - Build confidence
49
+ - Identify unclear points
50
+ """)
51
+ else: # Timed Practice
52
+ st.info("""
53
+ **Timed Practice Benefits:**
54
+ - Ensure you meet time requirements
55
+ - Learn to pace yourself
56
+ - Identify sections that need trimming
57
+ - Build time awareness
58
+ """)
59
 
60
+ with col2:
61
+ st.markdown("### πŸ“ Memory Techniques")
62
+ memory_technique = st.selectbox(
63
+ "Select a memory technique:",
64
+ ["Chunking", "Visualization", "Story Method", "Repetition"]
65
+ )
66
+
67
+ if memory_technique == "Chunking":
68
+ st.info("""
69
+ **Chunking Method:**
70
+ - Break speech into smaller sections
71
+ - Master one section at a time
72
+ - Connect sections with transitions
73
+ - Build confidence gradually
74
+ """)
75
+ elif memory_technique == "Visualization":
76
+ st.info("""
77
+ **Visualization Method:**
78
+ - Create mental images for key points
79
+ - Link images to speech content
80
+ - Use visual cues for transitions
81
+ - Build a mental map of your speech
82
+ """)
83
+ elif memory_technique == "Story Method":
84
+ st.info("""
85
+ **Story Method:**
86
+ - Frame your speech as a narrative
87
+ - Create a beginning, middle, and end
88
+ - Use storytelling techniques
89
+ - Make content more memorable
90
+ """)
91
+ else: # Repetition
92
+ st.info("""
93
+ **Repetition Method:**
94
+ - Practice sections multiple times
95
+ - Vary your practice approach
96
+ - Focus on problem areas
97
+ - Build muscle memory
98
+ """)
99
 
100
+ # Interactive Practice Schedule
101
+ st.subheader("Create Your Practice Schedule")
102
+
103
+ days = st.slider("How many days until your speech?", 1, 14, 7)
104
+
105
+ if days:
106
+ st.markdown(f"### πŸ“… {days}-Day Practice Plan")
107
+
108
+ # Calculate practice sessions
109
+ total_sessions = days * 2 # Two sessions per day
110
+
111
+ # Create a practice schedule
112
+ st.markdown("""
113
+ **Recommended Daily Schedule:**
114
+ - Morning Session (15-20 minutes)
115
+ - Evening Session (15-20 minutes)
116
+ """)
117
+
118
+ # Progress tracking
119
+ st.markdown("### πŸ“Š Track Your Progress")
120
+ progress = st.slider("How confident do you feel with your speech?", 0, 100, 50)
121
+
122
+ if progress < 50:
123
+ st.warning("""
124
+ **Tips to Boost Confidence:**
125
+ - Break down your speech into smaller sections
126
+ - Practice one section at a time
127
+ - Record yourself and review
128
+ - Get feedback from peers
129
+ """)
130
+ elif progress < 80:
131
+ st.info("""
132
+ **You're Making Good Progress!**
133
+ - Focus on refining your delivery
134
+ - Practice with different audiences
135
+ - Work on your timing
136
+ - Polish your transitions
137
+ """)
138
+ else:
139
+ st.success("""
140
+ **You're Almost There!**
141
+ - Fine-tune your delivery
142
+ - Practice in different environments
143
+ - Record a final run-through
144
+ - Get final feedback
145
+ """)
146
+
147
+ # Next Steps
148
+ st.markdown("""
149
+ ### Next Steps
150
+ 1. Choose your preferred practice methods
151
+ 2. Create a practice schedule
152
+ 3. Start with small sections
153
+ 4. Build up to full speech practice
154
+ 5. Get feedback and adjust
155
  """)
src/modules/module3.py CHANGED
@@ -1,14 +1,164 @@
1
  import streamlit as st
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
  def show():
4
- st.markdown("""
5
- # Module 3: Advanced Topics
6
-
7
- ## Learning Objectives
8
- - Explore advanced concepts
9
- - Solve complex problems
10
- - Apply knowledge to real-world scenarios
11
-
12
- ## Content
13
- Take your understanding to the next level with advanced topics.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  """)
 
1
  import streamlit as st
2
+ import numpy as np
3
+ import pandas as pd
4
+ import plotly.express as px
5
+ import plotly.graph_objects as go
6
+ from sklearn.linear_model import LinearRegression, LogisticRegression
7
+ from sklearn.cluster import KMeans
8
+ from sklearn.preprocessing import StandardScaler
9
+ from sklearn.datasets import make_blobs
10
+
11
+ def generate_regression_data(n_samples=100, noise=10):
12
+ """Generate data for linear regression visualization."""
13
+ np.random.seed(42)
14
+ X = np.linspace(0, 10, n_samples)
15
+ y = 2 * X + 1 + np.random.normal(0, noise, n_samples)
16
+ return X.reshape(-1, 1), y
17
+
18
+ def generate_classification_data(n_samples=100):
19
+ """Generate data for logistic regression visualization."""
20
+ np.random.seed(42)
21
+ X = np.random.randn(n_samples, 2)
22
+ y = (X[:, 0] + X[:, 1] > 0).astype(int)
23
+ return X, y
24
+
25
+ def generate_clustering_data(n_samples=300):
26
+ """Generate data for clustering visualization."""
27
+ np.random.seed(42)
28
+ X, _ = make_blobs(n_samples=n_samples, centers=3, cluster_std=1.5)
29
+ return X
30
 
31
  def show():
32
+ st.title("Interactive Machine Learning Visualizations")
33
+
34
+ # Introduction
35
+ st.info("""
36
+ This module provides interactive visualizations of three fundamental machine learning concepts:
37
+ - πŸ“ˆ Linear Regression: Predict continuous values
38
+ - 🎯 Logistic Regression: Classify binary outcomes
39
+ - πŸ” K-Means Clustering: Group similar data points
40
+ """)
41
+
42
+ # Create tabs for different ML concepts
43
+ tab1, tab2, tab3 = st.tabs(["πŸ“ˆ Linear Regression", "🎯 Logistic Regression", "πŸ” Clustering"])
44
+
45
+ with tab1:
46
+ st.subheader("Linear Regression")
47
+
48
+ # Interactive controls
49
+ col1, col2 = st.columns(2)
50
+ with col1:
51
+ n_samples = st.slider("Number of samples", 50, 200, 100)
52
+ with col2:
53
+ noise = st.slider("Noise level", 1, 20, 10)
54
+
55
+ # Generate and plot data
56
+ X, y = generate_regression_data(n_samples, noise)
57
+
58
+ # Create scatter plot
59
+ fig = px.scatter(x=X.flatten(), y=y,
60
+ title="Linear Regression Visualization",
61
+ labels={'x': 'Feature (X)', 'y': 'Target (y)'})
62
+
63
+ # Add regression line
64
+ model = LinearRegression()
65
+ model.fit(X, y)
66
+ y_pred = model.predict(X)
67
+
68
+ fig.add_trace(go.Scatter(x=X.flatten(), y=y_pred,
69
+ mode='lines',
70
+ name='Regression Line',
71
+ line=dict(color='red')))
72
+
73
+ st.plotly_chart(fig, use_container_width=True)
74
+
75
+ # Display model information
76
+ st.success(f"""
77
+ **Model Information**
78
+ - Slope (Coefficient): {model.coef_[0]:.2f}
79
+ - Intercept: {model.intercept_:.2f}
80
+ - RΒ² Score: {model.score(X, y):.2f}
81
+ """)
82
+
83
+ with tab2:
84
+ st.subheader("Logistic Regression")
85
+
86
+ # Generate data
87
+ X, y = generate_classification_data()
88
+
89
+ # Create scatter plot
90
+ fig = px.scatter(x=X[:, 0], y=X[:, 1],
91
+ color=y.astype(str),
92
+ title="Logistic Regression Visualization",
93
+ labels={'x': 'Feature 1', 'y': 'Feature 2'})
94
+
95
+ # Add decision boundary
96
+ model = LogisticRegression()
97
+ model.fit(X, y)
98
+
99
+ # Create mesh grid for decision boundary
100
+ x_min, x_max = X[:, 0].min() - 1, X[:, 0].max() + 1
101
+ y_min, y_max = X[:, 1].min() - 1, X[:, 1].max() + 1
102
+ xx, yy = np.meshgrid(np.arange(x_min, x_max, 0.1),
103
+ np.arange(y_min, y_max, 0.1))
104
+
105
+ Z = model.predict(np.c_[xx.ravel(), yy.ravel()])
106
+ Z = Z.reshape(xx.shape)
107
+
108
+ fig.add_trace(go.Contour(x=xx[0], y=yy[:, 0], z=Z,
109
+ showscale=False,
110
+ opacity=0.3,
111
+ colorscale='RdBu'))
112
+
113
+ st.plotly_chart(fig, use_container_width=True)
114
+
115
+ # Display model information
116
+ st.success(f"""
117
+ **Model Information**
118
+ - Accuracy: {model.score(X, y):.2f}
119
+ - Coefficients: [{model.coef_[0][0]:.2f}, {model.coef_[0][1]:.2f}]
120
+ - Intercept: {model.intercept_[0]:.2f}
121
+ """)
122
+
123
+ with tab3:
124
+ st.subheader("K-Means Clustering")
125
+
126
+ # Interactive controls
127
+ n_clusters = st.slider("Number of clusters", 2, 6, 3)
128
+
129
+ # Generate data
130
+ X = generate_clustering_data()
131
+
132
+ # Perform clustering
133
+ kmeans = KMeans(n_clusters=n_clusters, random_state=42)
134
+ clusters = kmeans.fit_predict(X)
135
+
136
+ # Create scatter plot
137
+ fig = px.scatter(x=X[:, 0], y=X[:, 1],
138
+ color=clusters.astype(str),
139
+ title="K-Means Clustering Visualization",
140
+ labels={'x': 'Feature 1', 'y': 'Feature 2'})
141
+
142
+ # Add cluster centers
143
+ fig.add_trace(go.Scatter(x=kmeans.cluster_centers_[:, 0],
144
+ y=kmeans.cluster_centers_[:, 1],
145
+ mode='markers',
146
+ marker=dict(size=12, symbol='star', color='black'),
147
+ name='Cluster Centers'))
148
+
149
+ st.plotly_chart(fig, use_container_width=True)
150
+
151
+ # Display clustering information
152
+ st.success(f"""
153
+ **Clustering Information**
154
+ - Number of Clusters: {n_clusters}
155
+ - Inertia (Sum of Squared Distances): {kmeans.inertia_:.2f}
156
+ """)
157
+
158
+ # Footer
159
+ st.info("""
160
+ **Key Takeaways**
161
+ - Linear Regression: Fits a line to predict continuous values
162
+ - Logistic Regression: Creates a decision boundary for classification
163
+ - K-Means Clustering: Groups similar data points into clusters
164
  """)
src/streamlit_app.py CHANGED
@@ -21,8 +21,8 @@ if 'current_page' not in st.session_state:
21
  course_sections = {
22
  "Introduction": (intro.show, "intro"),
23
  "Module 1: Getting Started": (module1.show, "module1"),
24
- "Module 2: Core Concepts": (module2.show, "module2"),
25
- "Module 3: Advanced Topics": (module3.show, "module3"),
26
  "Assignments": (assignments.show, "assignments"),
27
  "Resources": (resources.show, "resources")
28
  }
 
21
  course_sections = {
22
  "Introduction": (intro.show, "intro"),
23
  "Module 1: Getting Started": (module1.show, "module1"),
24
+ "Module 2: Learning from Examples": (module2.show, "module2"),
25
+ "Module 3: Machine Learning Demo": (module3.show, "module3"),
26
  "Assignments": (assignments.show, "assignments"),
27
  "Resources": (resources.show, "resources")
28
  }