mcli-framework 7.1.3__py3-none-any.whl → 7.3.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mcli-framework might be problematic. Click here for more details.
- mcli/__init__.py +160 -0
- mcli/__main__.py +14 -0
- mcli/app/__init__.py +23 -0
- mcli/app/main.py +10 -0
- mcli/app/model/__init__.py +0 -0
- mcli/app/video/__init__.py +5 -0
- mcli/chat/__init__.py +34 -0
- mcli/lib/__init__.py +0 -0
- mcli/lib/api/__init__.py +0 -0
- mcli/lib/auth/__init__.py +1 -0
- mcli/lib/config/__init__.py +1 -0
- mcli/lib/custom_commands.py +424 -0
- mcli/lib/erd/__init__.py +25 -0
- mcli/lib/files/__init__.py +0 -0
- mcli/lib/fs/__init__.py +1 -0
- mcli/lib/logger/__init__.py +3 -0
- mcli/lib/paths.py +12 -0
- mcli/lib/performance/__init__.py +17 -0
- mcli/lib/pickles/__init__.py +1 -0
- mcli/lib/shell/__init__.py +0 -0
- mcli/lib/toml/__init__.py +1 -0
- mcli/lib/watcher/__init__.py +0 -0
- mcli/ml/__init__.py +16 -0
- mcli/ml/api/__init__.py +30 -0
- mcli/ml/api/routers/__init__.py +27 -0
- mcli/ml/api/schemas.py +2 -2
- mcli/ml/auth/__init__.py +45 -0
- mcli/ml/auth/models.py +2 -2
- mcli/ml/backtesting/__init__.py +39 -0
- mcli/ml/cli/__init__.py +5 -0
- mcli/ml/cli/main.py +1 -1
- mcli/ml/config/__init__.py +33 -0
- mcli/ml/configs/__init__.py +16 -0
- mcli/ml/dashboard/__init__.py +12 -0
- mcli/ml/dashboard/app.py +13 -13
- mcli/ml/dashboard/app_integrated.py +1309 -148
- mcli/ml/dashboard/app_supabase.py +46 -21
- mcli/ml/dashboard/app_training.py +14 -14
- mcli/ml/dashboard/components/__init__.py +7 -0
- mcli/ml/dashboard/components/charts.py +258 -0
- mcli/ml/dashboard/components/metrics.py +125 -0
- mcli/ml/dashboard/components/tables.py +228 -0
- mcli/ml/dashboard/pages/__init__.py +6 -0
- mcli/ml/dashboard/pages/cicd.py +382 -0
- mcli/ml/dashboard/pages/predictions_enhanced.py +834 -0
- mcli/ml/dashboard/pages/scrapers_and_logs.py +1060 -0
- mcli/ml/dashboard/pages/test_portfolio.py +373 -0
- mcli/ml/dashboard/pages/trading.py +714 -0
- mcli/ml/dashboard/pages/workflows.py +533 -0
- mcli/ml/dashboard/utils.py +154 -0
- mcli/ml/data_ingestion/__init__.py +39 -0
- mcli/ml/database/__init__.py +47 -0
- mcli/ml/experimentation/__init__.py +29 -0
- mcli/ml/features/__init__.py +39 -0
- mcli/ml/mlops/__init__.py +33 -0
- mcli/ml/models/__init__.py +94 -0
- mcli/ml/monitoring/__init__.py +25 -0
- mcli/ml/optimization/__init__.py +27 -0
- mcli/ml/predictions/__init__.py +5 -0
- mcli/ml/preprocessing/__init__.py +28 -0
- mcli/ml/scripts/__init__.py +1 -0
- mcli/ml/trading/__init__.py +60 -0
- mcli/ml/trading/alpaca_client.py +353 -0
- mcli/ml/trading/migrations.py +164 -0
- mcli/ml/trading/models.py +418 -0
- mcli/ml/trading/paper_trading.py +326 -0
- mcli/ml/trading/risk_management.py +370 -0
- mcli/ml/trading/trading_service.py +480 -0
- mcli/ml/training/__init__.py +10 -0
- mcli/ml/training/train_model.py +569 -0
- mcli/mygroup/__init__.py +3 -0
- mcli/public/__init__.py +1 -0
- mcli/public/commands/__init__.py +2 -0
- mcli/self/__init__.py +3 -0
- mcli/self/self_cmd.py +579 -91
- mcli/workflow/__init__.py +0 -0
- mcli/workflow/daemon/__init__.py +15 -0
- mcli/workflow/daemon/daemon.py +21 -3
- mcli/workflow/dashboard/__init__.py +5 -0
- mcli/workflow/docker/__init__.py +0 -0
- mcli/workflow/file/__init__.py +0 -0
- mcli/workflow/gcloud/__init__.py +1 -0
- mcli/workflow/git_commit/__init__.py +0 -0
- mcli/workflow/interview/__init__.py +0 -0
- mcli/workflow/politician_trading/__init__.py +4 -0
- mcli/workflow/politician_trading/data_sources.py +259 -1
- mcli/workflow/politician_trading/models.py +159 -1
- mcli/workflow/politician_trading/scrapers_corporate_registry.py +846 -0
- mcli/workflow/politician_trading/scrapers_free_sources.py +516 -0
- mcli/workflow/politician_trading/scrapers_third_party.py +391 -0
- mcli/workflow/politician_trading/seed_database.py +539 -0
- mcli/workflow/registry/__init__.py +0 -0
- mcli/workflow/repo/__init__.py +0 -0
- mcli/workflow/scheduler/__init__.py +25 -0
- mcli/workflow/search/__init__.py +0 -0
- mcli/workflow/sync/__init__.py +5 -0
- mcli/workflow/videos/__init__.py +1 -0
- mcli/workflow/wakatime/__init__.py +80 -0
- mcli/workflow/workflow.py +8 -27
- {mcli_framework-7.1.3.dist-info → mcli_framework-7.3.1.dist-info}/METADATA +3 -1
- {mcli_framework-7.1.3.dist-info → mcli_framework-7.3.1.dist-info}/RECORD +105 -29
- mcli/workflow/daemon/api_daemon.py +0 -800
- mcli/workflow/daemon/commands.py +0 -1196
- mcli/workflow/dashboard/dashboard_cmd.py +0 -120
- mcli/workflow/file/file.py +0 -100
- mcli/workflow/git_commit/commands.py +0 -430
- mcli/workflow/politician_trading/commands.py +0 -1939
- mcli/workflow/scheduler/commands.py +0 -493
- mcli/workflow/sync/sync_cmd.py +0 -437
- mcli/workflow/videos/videos.py +0 -242
- {mcli_framework-7.1.3.dist-info → mcli_framework-7.3.1.dist-info}/WHEEL +0 -0
- {mcli_framework-7.1.3.dist-info → mcli_framework-7.3.1.dist-info}/entry_points.txt +0 -0
- {mcli_framework-7.1.3.dist-info → mcli_framework-7.3.1.dist-info}/licenses/LICENSE +0 -0
- {mcli_framework-7.1.3.dist-info → mcli_framework-7.3.1.dist-info}/top_level.txt +0 -0
mcli/lib/erd/__init__.py
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Entity Relationship Diagram (ERD) package.
|
|
3
|
+
|
|
4
|
+
This package provides utilities for generating Entity Relationship Diagrams from MCLI type metadata.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
# Import and export all public functions from erd.py
|
|
8
|
+
from .erd import (
|
|
9
|
+
analyze_graph_for_hierarchical_exports,
|
|
10
|
+
create_merged_erd,
|
|
11
|
+
do_erd,
|
|
12
|
+
find_top_nodes_in_graph,
|
|
13
|
+
generate_erd_for_top_nodes,
|
|
14
|
+
generate_merged_erd_for_types,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
# Define __all__ to control exports
|
|
18
|
+
__all__ = [
|
|
19
|
+
"do_erd",
|
|
20
|
+
"create_merged_erd",
|
|
21
|
+
"generate_merged_erd_for_types",
|
|
22
|
+
"find_top_nodes_in_graph",
|
|
23
|
+
"generate_erd_for_top_nodes",
|
|
24
|
+
"analyze_graph_for_hierarchical_exports",
|
|
25
|
+
]
|
|
File without changes
|
mcli/lib/fs/__init__.py
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .fs import *
|
mcli/lib/paths.py
CHANGED
|
@@ -80,3 +80,15 @@ def get_cache_dir() -> Path:
|
|
|
80
80
|
cache_dir = get_mcli_home() / "cache"
|
|
81
81
|
cache_dir.mkdir(parents=True, exist_ok=True)
|
|
82
82
|
return cache_dir
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def get_custom_commands_dir() -> Path:
|
|
86
|
+
"""
|
|
87
|
+
Get the custom commands directory for mcli.
|
|
88
|
+
|
|
89
|
+
Returns:
|
|
90
|
+
Path to custom commands directory (e.g., ~/.mcli/commands), created if it doesn't exist
|
|
91
|
+
"""
|
|
92
|
+
commands_dir = get_mcli_home() / "commands"
|
|
93
|
+
commands_dir.mkdir(parents=True, exist_ok=True)
|
|
94
|
+
return commands_dir
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Performance optimization utilities for mcli
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from .uvloop_config import (
|
|
6
|
+
configure_event_loop_for_performance,
|
|
7
|
+
get_event_loop_info,
|
|
8
|
+
install_uvloop,
|
|
9
|
+
should_use_uvloop,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"install_uvloop",
|
|
14
|
+
"should_use_uvloop",
|
|
15
|
+
"get_event_loop_info",
|
|
16
|
+
"configure_event_loop_for_performance",
|
|
17
|
+
]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .pickles import ObjectCache
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .toml import read_from_toml
|
|
File without changes
|
mcli/ml/__init__.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""MCLI Machine Learning Module for Stock Recommendation System"""
|
|
2
|
+
|
|
3
|
+
from .configs.dvc_config import get_dvc_config, setup_dvc
|
|
4
|
+
from .configs.mlflow_config import get_mlflow_config, setup_mlflow
|
|
5
|
+
from .configs.mlops_manager import MLOpsManager, get_mlops_manager
|
|
6
|
+
|
|
7
|
+
__version__ = "0.1.0"
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"get_mlops_manager",
|
|
11
|
+
"MLOpsManager",
|
|
12
|
+
"get_mlflow_config",
|
|
13
|
+
"setup_mlflow",
|
|
14
|
+
"get_dvc_config",
|
|
15
|
+
"setup_dvc",
|
|
16
|
+
]
|
mcli/ml/api/__init__.py
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"""API routes and endpoints for ML system"""
|
|
2
|
+
|
|
3
|
+
from .app import create_app, get_application
|
|
4
|
+
from .routers import (
|
|
5
|
+
admin_router,
|
|
6
|
+
auth_router,
|
|
7
|
+
backtest_router,
|
|
8
|
+
data_router,
|
|
9
|
+
model_router,
|
|
10
|
+
monitoring_router,
|
|
11
|
+
portfolio_router,
|
|
12
|
+
prediction_router,
|
|
13
|
+
trade_router,
|
|
14
|
+
websocket_router,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
"auth_router",
|
|
19
|
+
"model_router",
|
|
20
|
+
"prediction_router",
|
|
21
|
+
"portfolio_router",
|
|
22
|
+
"data_router",
|
|
23
|
+
"trade_router",
|
|
24
|
+
"backtest_router",
|
|
25
|
+
"monitoring_router",
|
|
26
|
+
"admin_router",
|
|
27
|
+
"websocket_router",
|
|
28
|
+
"create_app",
|
|
29
|
+
"get_application",
|
|
30
|
+
]
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""API routers"""
|
|
2
|
+
|
|
3
|
+
from . import (
|
|
4
|
+
admin_router,
|
|
5
|
+
auth_router,
|
|
6
|
+
backtest_router,
|
|
7
|
+
data_router,
|
|
8
|
+
model_router,
|
|
9
|
+
monitoring_router,
|
|
10
|
+
portfolio_router,
|
|
11
|
+
prediction_router,
|
|
12
|
+
trade_router,
|
|
13
|
+
websocket_router,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
__all__ = [
|
|
17
|
+
"auth_router",
|
|
18
|
+
"model_router",
|
|
19
|
+
"prediction_router",
|
|
20
|
+
"portfolio_router",
|
|
21
|
+
"data_router",
|
|
22
|
+
"trade_router",
|
|
23
|
+
"backtest_router",
|
|
24
|
+
"monitoring_router",
|
|
25
|
+
"admin_router",
|
|
26
|
+
"websocket_router",
|
|
27
|
+
]
|
mcli/ml/api/schemas.py
CHANGED
|
@@ -32,7 +32,7 @@ class ModelResponse(BaseModel):
|
|
|
32
32
|
updated_at: datetime
|
|
33
33
|
|
|
34
34
|
class Config:
|
|
35
|
-
|
|
35
|
+
from_attributes = True
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
class ModelMetrics(BaseModel):
|
|
@@ -69,4 +69,4 @@ class PredictionResponse(BaseModel):
|
|
|
69
69
|
model_name: str
|
|
70
70
|
|
|
71
71
|
class Config:
|
|
72
|
-
|
|
72
|
+
from_attributes = True
|
mcli/ml/auth/__init__.py
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""Authentication and authorization system"""
|
|
2
|
+
|
|
3
|
+
from .auth_manager import (
|
|
4
|
+
AuthManager,
|
|
5
|
+
create_access_token,
|
|
6
|
+
get_current_active_user,
|
|
7
|
+
get_current_user,
|
|
8
|
+
hash_password,
|
|
9
|
+
require_role,
|
|
10
|
+
verify_access_token,
|
|
11
|
+
verify_password,
|
|
12
|
+
)
|
|
13
|
+
from .models import (
|
|
14
|
+
PasswordChange,
|
|
15
|
+
PasswordReset,
|
|
16
|
+
TokenResponse,
|
|
17
|
+
UserCreate,
|
|
18
|
+
UserLogin,
|
|
19
|
+
UserResponse,
|
|
20
|
+
)
|
|
21
|
+
from .permissions import (
|
|
22
|
+
Permission,
|
|
23
|
+
check_permission,
|
|
24
|
+
has_permission,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
__all__ = [
|
|
28
|
+
"AuthManager",
|
|
29
|
+
"create_access_token",
|
|
30
|
+
"verify_access_token",
|
|
31
|
+
"get_current_user",
|
|
32
|
+
"get_current_active_user",
|
|
33
|
+
"require_role",
|
|
34
|
+
"hash_password",
|
|
35
|
+
"verify_password",
|
|
36
|
+
"UserCreate",
|
|
37
|
+
"UserLogin",
|
|
38
|
+
"UserResponse",
|
|
39
|
+
"TokenResponse",
|
|
40
|
+
"PasswordReset",
|
|
41
|
+
"PasswordChange",
|
|
42
|
+
"Permission",
|
|
43
|
+
"check_permission",
|
|
44
|
+
"has_permission",
|
|
45
|
+
]
|
mcli/ml/auth/models.py
CHANGED
|
@@ -10,7 +10,7 @@ from pydantic import BaseModel, EmailStr, Field, validator
|
|
|
10
10
|
class UserCreate(BaseModel):
|
|
11
11
|
"""User registration model"""
|
|
12
12
|
|
|
13
|
-
username: str = Field(..., min_length=3, max_length=50,
|
|
13
|
+
username: str = Field(..., min_length=3, max_length=50, pattern="^[a-zA-Z0-9_-]+$")
|
|
14
14
|
email: EmailStr
|
|
15
15
|
password: str = Field(..., min_length=8, max_length=100)
|
|
16
16
|
first_name: Optional[str] = Field(None, max_length=50)
|
|
@@ -52,7 +52,7 @@ class UserResponse(BaseModel):
|
|
|
52
52
|
last_login_at: Optional[datetime]
|
|
53
53
|
|
|
54
54
|
class Config:
|
|
55
|
-
|
|
55
|
+
from_attributes = True
|
|
56
56
|
|
|
57
57
|
|
|
58
58
|
class TokenResponse(BaseModel):
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"""Backtesting framework for trading strategies"""
|
|
2
|
+
|
|
3
|
+
from .backtest_engine import (
|
|
4
|
+
BacktestConfig,
|
|
5
|
+
BacktestEngine,
|
|
6
|
+
BacktestResult,
|
|
7
|
+
PositionManager,
|
|
8
|
+
TradingStrategy,
|
|
9
|
+
)
|
|
10
|
+
from .performance_metrics import (
|
|
11
|
+
PerformanceAnalyzer,
|
|
12
|
+
PortfolioMetrics,
|
|
13
|
+
RiskMetrics,
|
|
14
|
+
plot_performance,
|
|
15
|
+
)
|
|
16
|
+
from .trading_simulator import (
|
|
17
|
+
MarketSimulator,
|
|
18
|
+
Order,
|
|
19
|
+
Portfolio,
|
|
20
|
+
Position,
|
|
21
|
+
TradingSimulator,
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
__all__ = [
|
|
25
|
+
"BacktestEngine",
|
|
26
|
+
"BacktestConfig",
|
|
27
|
+
"BacktestResult",
|
|
28
|
+
"TradingStrategy",
|
|
29
|
+
"PositionManager",
|
|
30
|
+
"PerformanceAnalyzer",
|
|
31
|
+
"PortfolioMetrics",
|
|
32
|
+
"RiskMetrics",
|
|
33
|
+
"plot_performance",
|
|
34
|
+
"TradingSimulator",
|
|
35
|
+
"Order",
|
|
36
|
+
"Position",
|
|
37
|
+
"Portfolio",
|
|
38
|
+
"MarketSimulator",
|
|
39
|
+
]
|
mcli/ml/cli/__init__.py
ADDED
mcli/ml/cli/main.py
CHANGED
|
@@ -377,6 +377,7 @@ def config(
|
|
|
377
377
|
debug: Optional[bool] = typer.Option(None, "--debug", help="Set debug mode"),
|
|
378
378
|
):
|
|
379
379
|
"""Manage system configuration"""
|
|
380
|
+
global settings
|
|
380
381
|
|
|
381
382
|
if show:
|
|
382
383
|
console.print(f"[bold blue]Current Configuration[/bold blue]")
|
|
@@ -399,7 +400,6 @@ def config(
|
|
|
399
400
|
raise typer.Exit(1)
|
|
400
401
|
|
|
401
402
|
# Update environment
|
|
402
|
-
global settings
|
|
403
403
|
settings = create_settings(environment)
|
|
404
404
|
console.print(f"[green]✓ Environment set to: {environment}[/green]")
|
|
405
405
|
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""Configuration management for ML system"""
|
|
2
|
+
|
|
3
|
+
from .settings import (
|
|
4
|
+
APISettings,
|
|
5
|
+
DatabaseSettings,
|
|
6
|
+
DataSettings,
|
|
7
|
+
MLflowSettings,
|
|
8
|
+
ModelSettings,
|
|
9
|
+
MonitoringSettings,
|
|
10
|
+
RedisSettings,
|
|
11
|
+
SecuritySettings,
|
|
12
|
+
Settings,
|
|
13
|
+
create_settings,
|
|
14
|
+
get_settings,
|
|
15
|
+
settings,
|
|
16
|
+
update_settings,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
__all__ = [
|
|
20
|
+
"Settings",
|
|
21
|
+
"DatabaseSettings",
|
|
22
|
+
"RedisSettings",
|
|
23
|
+
"MLflowSettings",
|
|
24
|
+
"ModelSettings",
|
|
25
|
+
"DataSettings",
|
|
26
|
+
"APISettings",
|
|
27
|
+
"MonitoringSettings",
|
|
28
|
+
"SecuritySettings",
|
|
29
|
+
"settings",
|
|
30
|
+
"get_settings",
|
|
31
|
+
"update_settings",
|
|
32
|
+
"create_settings",
|
|
33
|
+
]
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""ML Configuration Module"""
|
|
2
|
+
|
|
3
|
+
from .dvc_config import DVCConfig, get_dvc_config, setup_dvc
|
|
4
|
+
from .mlflow_config import MLflowConfig, get_mlflow_config, setup_mlflow
|
|
5
|
+
from .mlops_manager import MLOpsManager, get_mlops_manager
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
"MLflowConfig",
|
|
9
|
+
"get_mlflow_config",
|
|
10
|
+
"setup_mlflow",
|
|
11
|
+
"DVCConfig",
|
|
12
|
+
"get_dvc_config",
|
|
13
|
+
"setup_dvc",
|
|
14
|
+
"MLOpsManager",
|
|
15
|
+
"get_mlops_manager",
|
|
16
|
+
]
|
mcli/ml/dashboard/app.py
CHANGED
|
@@ -283,7 +283,7 @@ def show_overview():
|
|
|
283
283
|
model_data = get_model_performance()
|
|
284
284
|
if not model_data.empty:
|
|
285
285
|
fig = px.bar(model_data, x="name", y="accuracy", title="Model Accuracy Comparison")
|
|
286
|
-
st.plotly_chart(fig,
|
|
286
|
+
st.plotly_chart(fig, width="stretch", config={"responsive": True})
|
|
287
287
|
else:
|
|
288
288
|
st.info("No model performance data available")
|
|
289
289
|
|
|
@@ -295,7 +295,7 @@ def show_overview():
|
|
|
295
295
|
fig = px.histogram(
|
|
296
296
|
pred_data, x="confidence", title="Prediction Confidence Distribution"
|
|
297
297
|
)
|
|
298
|
-
st.plotly_chart(fig,
|
|
298
|
+
st.plotly_chart(fig, width="stretch", config={"responsive": True})
|
|
299
299
|
else:
|
|
300
300
|
st.info("No recent predictions available")
|
|
301
301
|
|
|
@@ -309,13 +309,13 @@ def show_models():
|
|
|
309
309
|
|
|
310
310
|
if not model_data.empty:
|
|
311
311
|
st.subheader("Model Performance")
|
|
312
|
-
st.dataframe(model_data,
|
|
312
|
+
st.dataframe(model_data, width="stretch")
|
|
313
313
|
|
|
314
314
|
# Model accuracy chart
|
|
315
315
|
fig = px.line(
|
|
316
316
|
model_data, x="created_at", y="accuracy", color="name", title="Model Accuracy Over Time"
|
|
317
317
|
)
|
|
318
|
-
st.plotly_chart(fig,
|
|
318
|
+
st.plotly_chart(fig, width="stretch", config={"responsive": True})
|
|
319
319
|
else:
|
|
320
320
|
st.warning("No model data available")
|
|
321
321
|
|
|
@@ -349,7 +349,7 @@ def show_predictions():
|
|
|
349
349
|
|
|
350
350
|
# Display filtered data
|
|
351
351
|
st.subheader("Filtered Predictions")
|
|
352
|
-
st.dataframe(filtered_data,
|
|
352
|
+
st.dataframe(filtered_data, width="stretch")
|
|
353
353
|
|
|
354
354
|
# Charts
|
|
355
355
|
col1, col2 = st.columns(2)
|
|
@@ -362,7 +362,7 @@ def show_predictions():
|
|
|
362
362
|
color="ticker",
|
|
363
363
|
title="Confidence vs Predicted Return",
|
|
364
364
|
)
|
|
365
|
-
st.plotly_chart(fig,
|
|
365
|
+
st.plotly_chart(fig, width="stretch", config={"responsive": True})
|
|
366
366
|
|
|
367
367
|
with col2:
|
|
368
368
|
# Group by ticker and show average return
|
|
@@ -373,7 +373,7 @@ def show_predictions():
|
|
|
373
373
|
y="predicted_return",
|
|
374
374
|
title="Average Predicted Return by Ticker",
|
|
375
375
|
)
|
|
376
|
-
st.plotly_chart(fig,
|
|
376
|
+
st.plotly_chart(fig, width="stretch", config={"responsive": True})
|
|
377
377
|
|
|
378
378
|
else:
|
|
379
379
|
st.warning("No prediction data available")
|
|
@@ -388,7 +388,7 @@ def show_portfolios():
|
|
|
388
388
|
if not portfolio_data.empty:
|
|
389
389
|
# Portfolio metrics
|
|
390
390
|
st.subheader("Portfolio Summary")
|
|
391
|
-
st.dataframe(portfolio_data,
|
|
391
|
+
st.dataframe(portfolio_data, width="stretch")
|
|
392
392
|
|
|
393
393
|
# Performance charts
|
|
394
394
|
col1, col2 = st.columns(2)
|
|
@@ -397,7 +397,7 @@ def show_portfolios():
|
|
|
397
397
|
fig = px.bar(
|
|
398
398
|
portfolio_data, x="name", y="total_return", title="Total Return by Portfolio"
|
|
399
399
|
)
|
|
400
|
-
st.plotly_chart(fig,
|
|
400
|
+
st.plotly_chart(fig, width="stretch", config={"responsive": True})
|
|
401
401
|
|
|
402
402
|
with col2:
|
|
403
403
|
fig = px.scatter(
|
|
@@ -408,7 +408,7 @@ def show_portfolios():
|
|
|
408
408
|
hover_data=["name"],
|
|
409
409
|
title="Risk-Return Analysis",
|
|
410
410
|
)
|
|
411
|
-
st.plotly_chart(fig,
|
|
411
|
+
st.plotly_chart(fig, width="stretch", config={"responsive": True})
|
|
412
412
|
|
|
413
413
|
else:
|
|
414
414
|
st.warning("No portfolio data available")
|
|
@@ -467,7 +467,7 @@ def show_system_health():
|
|
|
467
467
|
)
|
|
468
468
|
|
|
469
469
|
fig.update_layout(height=500, title_text="System Resource Usage (24h)")
|
|
470
|
-
st.plotly_chart(fig,
|
|
470
|
+
st.plotly_chart(fig, width="stretch", config={"responsive": True})
|
|
471
471
|
|
|
472
472
|
|
|
473
473
|
def show_live_monitoring():
|
|
@@ -509,13 +509,13 @@ def show_live_monitoring():
|
|
|
509
509
|
"Time": [datetime.now() - timedelta(seconds=x * 10) for x in range(5)],
|
|
510
510
|
}
|
|
511
511
|
)
|
|
512
|
-
st.dataframe(new_preds,
|
|
512
|
+
st.dataframe(new_preds, width="stretch")
|
|
513
513
|
|
|
514
514
|
# Model status
|
|
515
515
|
with model_placeholder.container():
|
|
516
516
|
model_data = get_model_performance()
|
|
517
517
|
if not model_data.empty:
|
|
518
|
-
st.dataframe(model_data[["name", "accuracy"]],
|
|
518
|
+
st.dataframe(model_data[["name", "accuracy"]], width="stretch")
|
|
519
519
|
|
|
520
520
|
time.sleep(5)
|
|
521
521
|
|