added title
Browse files- app.py +2 -2
- app.py.bak +0 -2
app.py
CHANGED
@@ -29,7 +29,7 @@ def plot_efficient_frontier_and_max_sharpe(mu, S):
|
|
29 |
ef_max_sharpe.max_sharpe(risk_free_rate=0.02)
|
30 |
ret_tangent, std_tangent, _ = ef_max_sharpe.portfolio_performance()
|
31 |
ax.scatter(std_tangent, ret_tangent, marker="*", s=100, c="r", label="Max Sharpe")
|
32 |
-
# Generate random portfolios
|
33 |
n_samples = 1000
|
34 |
w = np.random.dirichlet(np.ones(ef.n_assets), n_samples)
|
35 |
rets = w.dot(ef.expected_returns)
|
@@ -104,7 +104,7 @@ with gr.Blocks() as app:
|
|
104 |
btn = gr.Button("Get Optimized Portfolio")
|
105 |
|
106 |
with gr.Row():
|
107 |
-
gr.
|
108 |
|
109 |
with gr.Row():
|
110 |
expected_annual_return = gr.Text(label="Expected Annual Return")
|
|
|
29 |
ef_max_sharpe.max_sharpe(risk_free_rate=0.02)
|
30 |
ret_tangent, std_tangent, _ = ef_max_sharpe.portfolio_performance()
|
31 |
ax.scatter(std_tangent, ret_tangent, marker="*", s=100, c="r", label="Max Sharpe")
|
32 |
+
# Generate random portfolios with random weights
|
33 |
n_samples = 1000
|
34 |
w = np.random.dirichlet(np.ones(ef.n_assets), n_samples)
|
35 |
rets = w.dot(ef.expected_returns)
|
|
|
104 |
btn = gr.Button("Get Optimized Portfolio")
|
105 |
|
106 |
with gr.Row():
|
107 |
+
gr.HTML("<h3>Optimizied Portfolio Metrics</h3>")
|
108 |
|
109 |
with gr.Row():
|
110 |
expected_annual_return = gr.Text(label="Expected Annual Return")
|
app.py.bak
CHANGED
@@ -10,9 +10,7 @@ import numpy as np
|
|
10 |
import pandas as pd
|
11 |
import plotly.express as px
|
12 |
import matplotlib.pyplot as plt
|
13 |
-
import seaborn as sns
|
14 |
from datetime import datetime
|
15 |
-
from io import BytesIO
|
16 |
import datetime
|
17 |
|
18 |
def plot_cum_returns(data, title):
|
|
|
10 |
import pandas as pd
|
11 |
import plotly.express as px
|
12 |
import matplotlib.pyplot as plt
|
|
|
13 |
from datetime import datetime
|
|
|
14 |
import datetime
|
15 |
|
16 |
def plot_cum_returns(data, title):
|