FrontPage

研究会(中島) 

専門ゼミ(中島) 

引き継ぎ(中島) 

メモ(中島) 

中間発表(中島) 

中間発表システムまとめ(中島) 

本論(中島) 

B3 前期授業スケジュール 

月曜日火曜日水曜日木曜日金曜日
1-2研究会
3-4卒論1研究会
5-6卒論1ディジタル信号処理卒論1卒論1
7-8技術者倫理
9-10研究会&size(px){Text you want to change};
11-12

&ref(): File not found: "ダッシュストーム.jpg" at page "中島"; &ref(): File not found: "ダッシュストーム.jpg" at page "中島"; &ref(): File not found: "ダッシュストーム.jpg" at page "中島"; &ref(): File not found: "ダッシュストーム.jpg" at page "中島"; &ref(): File not found: "ダッシュストーム.jpg" at page "中島"; &ref(): File not found: "ダッシュストーム.jpg" at page "中島";

&ref(): File not found: "栗松.jpg" at page "中島"; &ref(): File not found: "栗松.jpg" at page "中島"; &ref(): File not found: "栗松.jpg" at page "中島"; &ref(): File not found: "栗松.jpg" at page "中島"; &ref(): File not found: "栗松.jpg" at page "中島"; &ref(): File not found: "栗松.jpg" at page "中島";

メモ


n problem.solve(solver="OSQP", max_iter=self.max_iter)\n\n if problem.status != "optimal":\n raise ConvergenceWarning(\n f"Solver did not reach optimum (Status: {problem.status})"\n )\n\n beta_sol = np.concatenate([b.value for b in beta_variables], axis=0)\n beta_sol[np.abs(beta_sol) < self.tol] = 0\n\n intercept, coef = beta_sol[0], beta_sol[1:]\n coef = np.maximum(coef, 0) if self.positive else coef\n\n return coef, intercept\n\n\nfrom sklearn.linear_model import ElasticNetCV\nfrom sklearn.model_selection import GridSearchCV\nfrom sklearn.datasets import make_regression\nimport numpy as np\nfrom sklearn.model_selection import train_test_split\nimport pandas as pd\nfrom sklearn.preprocessing import StandardScaler\n\n# CSVファイルのパスを指定してください\nfile_path = "C:/Users/nt011/Desktop/研究/富山取引のほう富山市のみ/変数選択/変数作成後新新.csv"\n\n# CSVファイルの読み込み\ndf = pd.read_csv(file_path, encoding='cp932') # 文字コードが異なる場合は、'utf-8' を他のエンコーディングに変更してください\n\n# 特徴量とターゲットの分割\nX = df.drop(columns=['取引価格(㎡単価)']) # 取引価格(㎡単価)をyとして分離\ny = df['取引価格(㎡単価)'] # ターゲット変数\n\n# 🔥 標準化の実施\nscaler_X = StandardScaler()\nscaler_y = StandardScaler()\n\nX_scaled = scaler_X.fit_transform(X) # Xの標準化\ny_scaled = scaler_y.fit_transform(y.values.reshape(-1, 1)).ravel() # yの標準化\n\n\n# データ分割\nX_train, X_test, y_train, y_test = train_test_split(X_scaled, y_scaled, test_size=0.35, random_state=42)\n\n# 訓練データの一部を使用\nX_sample, _, y_sample, _ = train_test_split(X_train, y_train, test_size=0.8, random_state=42)\n\n# 第一段階: ElasticNetCVを使用した最適パラメータの導出\nenet_cv = ElasticNetCV(\n l1_ratio=np.linspace(0.0001, 1, 25), # l1_ratioの候補\n alphas=np.logspace(-5, 0, 25), # alphaの候補\n cv=5, # 交差検証の分割数\n random_state=42,\n n_jobs=-1\n)\nenet_cv.fit(X_train, y_train)\n\n# 第一段階の最適パラメータと係数を取得\nalpha1_opt = enet_cv.alpha_\nl1_ratio1_opt = enet_cv.l1_ratio_\nenet_coef = enet_cv.coef_\n\nprint(f"第一段階の最適パラメータ: alpha1={alpha1_opt}, l1_ratio1={l1_ratio1_opt}"))



やること






トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS