m7mdal7aj commited on
Commit
bd62fcd
1 Parent(s): f1aed30

Update my_model/tabs/results.py

Browse files
Files changed (1) hide show
  1. my_model/tabs/results.py +54 -3
my_model/tabs/results.py CHANGED
@@ -9,6 +9,57 @@ from my_model.results.evaluation import KBVQAEvaluator
9
 
10
  class ResultDemonstrator(KBVQAEvaluator):
11
 
12
- def __init__(self):
13
- pass
14
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
10
  class ResultDemonstrator(KBVQAEvaluator):
11
 
12
+
13
+
14
+ def run(self):
15
+
16
+ import pandas as pd
17
+ import altair as alt
18
+
19
+ # Sample data
20
+ data = pd.DataFrame({
21
+ 'x': range(10),
22
+ 'y': [2, 1, 4, 3, 5, 6, 9, 7, 10, 8]
23
+ })
24
+
25
+ # Create a scatter plot
26
+ chart = alt.Chart(data).mark_point().encode(
27
+ x='x',
28
+ y='y'
29
+ )
30
+
31
+ # Display the chart in Streamlit
32
+ st.altair_chart(chart, use_container_width=True)
33
+ # Display the chart in Streamlit
34
+ st.altair_chart(chart, use_container_width=True)
35
+
36
+ import matplotlib.pyplot as plt
37
+ import numpy as np
38
+
39
+ # Data
40
+ x = np.random.randn(100)
41
+ y = np.random.randn(100)
42
+
43
+ # Create a scatter plot
44
+ fig, ax = plt.subplots()
45
+ ax.scatter(x, y)
46
+
47
+ # Display the plot in Streamlit
48
+ st.pyplot(fig)
49
+
50
+ import plotly.express as px
51
+
52
+
53
+ # Data
54
+ df = pd.DataFrame({
55
+ "x": range(10),
56
+ "y": [2, 1, 4, 3, 5, 6, 9, 7, 10, 8],
57
+ "color": ["red"] * 5 + ["blue"] * 5
58
+ })
59
+
60
+ # Create an interactive scatter plot
61
+ fig = px.scatter(df, x='x', y='y', color='color')
62
+
63
+ # Display the plot in Streamlit
64
+ st.plotly_chart(fig)
65
+