Spaces:
Sleeping
Sleeping
cyberosa commited on
Commit ·
17301f4
1
Parent(s): b7f11f9
Adjusting graph configurations
Browse files- app.py +4 -4
- tabs/dist_gap.py +4 -4
app.py
CHANGED
|
@@ -86,12 +86,12 @@ with demo:
|
|
| 86 |
with gr.Row():
|
| 87 |
gr.Markdown(f"Market id = {best_market_id}")
|
| 88 |
with gr.Row():
|
| 89 |
-
with gr.Column(
|
| 90 |
gr.Markdown("# Evolution of outcomes probability based on tokens")
|
| 91 |
best_market_tokens_dist = get_based_tokens_distribution(
|
| 92 |
best_market_id, markets_data
|
| 93 |
)
|
| 94 |
-
with gr.Column(
|
| 95 |
gr.Markdown("# Evolution of outcomes probability based on votes")
|
| 96 |
best_market_votes_dist = get_based_votes_distribution(
|
| 97 |
best_market_id, markets_data
|
|
@@ -103,12 +103,12 @@ with demo:
|
|
| 103 |
gr.Markdown(f"Market id = {worst_market_id}")
|
| 104 |
|
| 105 |
with gr.Row():
|
| 106 |
-
with gr.Column(
|
| 107 |
# gr.Markdown("# Evolution of outcomes probability based on tokens")
|
| 108 |
worst_market_tokens_dist = get_based_tokens_distribution(
|
| 109 |
worst_market_id, markets_data
|
| 110 |
)
|
| 111 |
-
with gr.Column(
|
| 112 |
worst_market_votes_dist = get_based_votes_distribution(
|
| 113 |
worst_market_id, markets_data
|
| 114 |
)
|
|
|
|
| 86 |
with gr.Row():
|
| 87 |
gr.Markdown(f"Market id = {best_market_id}")
|
| 88 |
with gr.Row():
|
| 89 |
+
with gr.Column(min_width=350):
|
| 90 |
gr.Markdown("# Evolution of outcomes probability based on tokens")
|
| 91 |
best_market_tokens_dist = get_based_tokens_distribution(
|
| 92 |
best_market_id, markets_data
|
| 93 |
)
|
| 94 |
+
with gr.Column(min_width=350):
|
| 95 |
gr.Markdown("# Evolution of outcomes probability based on votes")
|
| 96 |
best_market_votes_dist = get_based_votes_distribution(
|
| 97 |
best_market_id, markets_data
|
|
|
|
| 103 |
gr.Markdown(f"Market id = {worst_market_id}")
|
| 104 |
|
| 105 |
with gr.Row():
|
| 106 |
+
with gr.Column(min_width=350):
|
| 107 |
# gr.Markdown("# Evolution of outcomes probability based on tokens")
|
| 108 |
worst_market_tokens_dist = get_based_tokens_distribution(
|
| 109 |
worst_market_id, markets_data
|
| 110 |
)
|
| 111 |
+
with gr.Column(min_width=350):
|
| 112 |
worst_market_votes_dist = get_based_votes_distribution(
|
| 113 |
worst_market_id, markets_data
|
| 114 |
)
|
tabs/dist_gap.py
CHANGED
|
@@ -21,7 +21,7 @@ def get_distribution_plot(markets_data: pd.DataFrame):
|
|
| 21 |
# observations in a dataset, analogous to a histogram. KDE represents the data using a
|
| 22 |
# continuous probability density curve in one or more dimensions.
|
| 23 |
sns.set_theme(palette="viridis")
|
| 24 |
-
plt.figure(figsize=(
|
| 25 |
|
| 26 |
plot = sns.kdeplot(markets_data, x="dist_gap_perc", fill=True)
|
| 27 |
# TODO Add title and labels
|
|
@@ -31,8 +31,8 @@ def get_distribution_plot(markets_data: pd.DataFrame):
|
|
| 31 |
|
| 32 |
def get_kde_with_trades(markets_data: pd.DataFrame):
|
| 33 |
"""Function to paint the density plot of the metric in terms of the number of trades"""
|
| 34 |
-
|
| 35 |
-
|
| 36 |
return gr.Plot(value=plot.get_figure())
|
| 37 |
|
| 38 |
|
|
@@ -46,7 +46,7 @@ def get_correlation_map(markets_data: pd.DataFrame):
|
|
| 46 |
correlation_matrix = data.corr()
|
| 47 |
|
| 48 |
# Create a figure and axis
|
| 49 |
-
plt.figure(figsize=(10, 8))
|
| 50 |
|
| 51 |
# Create the heatmap
|
| 52 |
heatmap = sns.heatmap(
|
|
|
|
| 21 |
# observations in a dataset, analogous to a histogram. KDE represents the data using a
|
| 22 |
# continuous probability density curve in one or more dimensions.
|
| 23 |
sns.set_theme(palette="viridis")
|
| 24 |
+
plt.figure(figsize=(10, 5))
|
| 25 |
|
| 26 |
plot = sns.kdeplot(markets_data, x="dist_gap_perc", fill=True)
|
| 27 |
# TODO Add title and labels
|
|
|
|
| 31 |
|
| 32 |
def get_kde_with_trades(markets_data: pd.DataFrame):
|
| 33 |
"""Function to paint the density plot of the metric in terms of the number of trades"""
|
| 34 |
+
plt = sns.kdeplot(markets_data, x="dist_gap_perc", y="total_trades", fill=True)
|
| 35 |
+
plt.ylabel("Total number of trades per market")
|
| 36 |
return gr.Plot(value=plot.get_figure())
|
| 37 |
|
| 38 |
|
|
|
|
| 46 |
correlation_matrix = data.corr()
|
| 47 |
|
| 48 |
# Create a figure and axis
|
| 49 |
+
# plt.figure(figsize=(10, 8))
|
| 50 |
|
| 51 |
# Create the heatmap
|
| 52 |
heatmap = sns.heatmap(
|