def generate_correlation_report(df: pd.DataFrame, output_path: str = None) -> dict:
"""
Generates a correlation metrics report:
1. Strong correlations (>|0.80|)
2. Very weak correlations (< 0.01)
Optionally saves the report as JSON.
Parameters
----------
df : pd.DataFrame
Input dataframe.
output_path : str, optional
File path to save JSON report.
Returns
-------
dict
Correlation summary report.
"""
import json
import os
from typing import Any, Dict
from datetime import datetime
class SaveJsonException(Exception):
"""Custom exception for JSON saving errors."""
pass
def save_json(data: Dict[str, Any], file_path: str) -> None:
"""
Save dictionary data to a JSON file with full reliability.
Key Capabilities:
-----------------
• Creates directories automatically
• Supports UTF-8 encoding
• Atomic write operation (prevents corruptiW3SCHOOLS
https://www.w3schools.com/bootstrap5/index.php
• Grids
https://www.w3schools.com/bootstrap5/bootstrap_grid_basic.php• https://github.com/jqueryscript/Bootstrap-5-Design-ResourcesSome of the best free options
• Lightbox for Bootstrap 5 (a.k.a. bs5-lightbox): This is a pure JavaScript lightbox gallery plugin specifically designed for Bootstrap 5. It leverages Bootstrap's Modal and Carousel components, ensuring a consistent look and feel with your existing Bootstrap 5 project. Listed in Bootstrap 5 Design Resources (see below).
• Chocolat: A free, lightweight, and responsive lightbox plugin that offers flexibility in how images are displayed (fullscreen or within a contain/**
* @param {number[]} nums
* @return {number}
*/
var minimumOperations = function(nums) {
// Initialize a counter to keep track of total operations
let operations = 0;
// Loop through each number in the array
for (let num of nums) {
// Find the remainder when divided by 3
let remainder = num % 3;
// If remainder is 1, subtract 1 -> costs 1 operation
// If remainder is 2, add 1 -> costs 1 operation
// If remainder is 0, no operation nimport torch
import torch.nn as nn
import torch.nn.functional as F
# --------------------------------------------------------------------
# 1. Syntactic Mapping Layer
# --------------------------------------------------------------------
class SyntacticMapping(nn.Module):
"""
Implements:
- syntactic relation matrix S (eq.4)
- adjacency g(i,j) (eq.5)
- syntactic similarity (eq.6)
- word-level syntactic embedding (eq.7)
"""
def __init__(self, eimport torch
import torch.nn as nn
import torch.nn.functional as F
# ---------------------------------------------------------
# Basic Modules: MLP, Attention, Transformer blocks
# ---------------------------------------------------------
class MLP(nn.Module):
def __init__(self, dim, hidden):
super().__init__()
self.fc1 = nn.Linear(dim, hidden)
self.fc2 = nn.Linear(hidden, dim)
self.act = nn.GELU()
def forward(self, x):
return # curl コマンド一覧
## curlとは
curlは、コマンドラインからHTTPリクエストを送信するツール。Webブラウザが行うHTTPリクエストを、ターミナル上で実行できる。
### 基本動作
- HTTPプロトコルでサーバーにリクエストを送信
- サーバーからのレスポンスを標準出力に表示
- GET、POST、PUT、DELETE等のHTTPメソッドに対応
- JSON、XML、HTML等の任意のデータ形式を送受信可能
### 用途
- API動作確認
- Webサーバーの状態チェック
- ファイルダウンロード
- 自動化スクリプトでのHTTP通信
- パフォーマンス測定
### インストール
macOS: 標準でインストール済み
Windows 10/11: 標準でインストール済み
Linux: `apt install curl` 等でインストール
### 基本構文
```bash
curl [オプション] URL
```
### 最も基本的な使用例
```bash
# GETリクエスト(最もシンプル)
curl https://jsonplaceimport torch
import torch.nn as nn
import torch.nn.functional as F
# ==========================================================
# Basic building blocks
# ==========================================================
class ConvBNReLU(nn.Module):
"""Basic conv → BN → ReLU"""
def __init__(self, in_ch, out_ch, k=3, s=1, p=1):
super().__init__()
self.conv = nn.Conv2d(in_ch, out_ch, k, s, p, bias=False)
self.bn = nn.BatchNorm2d(out_ch)
self.act = from __future__ import annotations
from dataclasses import dataclass
from typing import Optional, Dict, Any, Tuple
import torch
from torch import nn
from torch.nn import functional as F
# ---------------------------------------------------------------------------
# Utility modules
# ---------------------------------------------------------------------------
class MLP(nn.Module):
"""Simple multi-layer perceptron with optional dropout and activation."""
def __init_import torch
import torch.nn as nn
import torch.nn.functional as F
# =====================================================
# Utility Layers
# =====================================================
class FeedForward(nn.Module):
def __init__(self, dim, hidden=256):
super().__init__()
self.fc1 = nn.Linear(dim, hidden)
self.fc2 = nn.Linear(hidden, dim)
self.act = nn.GELU()
def forward(self, x):
return self.fc2(self.act(self.fc1(x)))from __future__ import annotations
from dataclasses import dataclass
from typing import Dict, List, Optional, Tuple
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
# ---------------------------------------------------------------------------
# Helper: simple multi-layer perceptron
# ---------------------------------------------------------------------------
class MLP(nn.Module):
"""Simple MLP with configurable depth and dropout."""
from __future__ import annotations
from dataclasses import dataclass
from typing import Dict, List, Optional, Tuple
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
# ---------------------------------------------------------------------------
# Utility: simple MLP
# ---------------------------------------------------------------------------
class MLP(nn.Module):
"""Simple multi-layer perceptron."""
def __init__(
self,
from __future__ import annotations
from dataclasses import dataclass
from typing import Dict, Optional, Tuple
import torch
import torch.nn as nn
import torch.nn.functional as F
# ---------------------------------------------------------------------------
# Utility functions
# ---------------------------------------------------------------------------
def compute_residualized_features(
s: torch.Tensor,
x: torch.Tensor,
eps: float = 1e-6,
) -> Tuple[torch.Tensofrom typing import Optional, Tuple, Dict
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
# ---------------------------------------------------------------------------
# Utility modules
# ---------------------------------------------------------------------------
class MLP(nn.Module):
"""Simple feed-forward network with configurable depth."""
def __init__(
self,
in_dim: int,
out_dim: int,
hidden_dim: