From 77c1160b19be0ab2c92215b7831016f88e0e6fd9 Mon Sep 17 00:00:00 2001 From: TNKduntech <163839971+TNKduntech@users.noreply.github.com> Date: Wed, 23 Apr 2025 21:59:44 +0900 Subject: [PATCH 1/7] Update app.py --- day1/01_streamlit_UI/app.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/day1/01_streamlit_UI/app.py b/day1/01_streamlit_UI/app.py index dcfbe6fec..da261bc61 100644 --- a/day1/01_streamlit_UI/app.py +++ b/day1/01_streamlit_UI/app.py @@ -32,23 +32,23 @@ # テキスト入力 st.subheader("テキスト入力") -name = st.text_input("あなたの名前", "ゲスト") +name = st.text_input("あなたの名前", "テンナコーン ナドゥン") st.write(f"こんにちは、{name}さん!") # ボタン -# st.subheader("ボタン") -# if st.button("クリックしてください"): -# st.success("ボタンがクリックされました!") +st.subheader("ボタン") +if st.button("クリックしてください"): + st.success("ボタンがクリックされました!") # チェックボックス -# st.subheader("チェックボックス") -# if st.checkbox("チェックを入れると追加コンテンツが表示されます"): -# st.info("これは隠れたコンテンツです!") +st.subheader("チェックボックス") +if st.checkbox("チェックを入れると追加コンテンツが表示されます"): + st.info("これは隠れたコンテンツです!") # スライダー -# st.subheader("スライダー") -# age = st.slider("年齢", 0, 100, 25) -# st.write(f"あなたの年齢: {age}") +st.subheader("スライダー") +age = st.slider("年齢", 0, 100, 25) +st.write(f"あなたの年齢: {age}") # セレクトボックス # st.subheader("セレクトボックス") @@ -200,4 +200,4 @@ # コメントを解除した例: if st.button("クリックしてください"): st.success("ボタンがクリックされました!") -""") \ No newline at end of file +""") From 034f37c4f8c3ae9a540778f876d220ac3c761897 Mon Sep 17 00:00:00 2001 From: TNKduntech <163839971+TNKduntech@users.noreply.github.com> Date: Wed, 23 Apr 2025 22:35:54 +0900 Subject: [PATCH 2/7] Update app.py --- day1/01_streamlit_UI/app.py | 66 ++++++++++++++++++------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/day1/01_streamlit_UI/app.py b/day1/01_streamlit_UI/app.py index da261bc61..dc459b525 100644 --- a/day1/01_streamlit_UI/app.py +++ b/day1/01_streamlit_UI/app.py @@ -51,57 +51,57 @@ st.write(f"あなたの年齢: {age}") # セレクトボックス -# st.subheader("セレクトボックス") -# option = st.selectbox( -# "好きなプログラミング言語は?", -# ["Python", "JavaScript", "Java", "C++", "Go", "Rust"] -# ) -# st.write(f"あなたは{option}を選びました") +st.subheader("セレクトボックス") +option = st.selectbox( + "好きなプログラミング言語は?", + ["Python", "JavaScript", "Java", "C++", "Go", "Rust"] +) +st.write(f"あなたは{option}を選びました") # ============================================ # レイアウト # ============================================ -# st.header("レイアウト") +st.header("レイアウト") # カラム -# st.subheader("カラムレイアウト") -# col1, col2 = st.columns(2) -# with col1: -# st.write("これは左カラムです") -# st.number_input("数値を入力", value=10) -# with col2: -# st.write("これは右カラムです") -# st.metric("メトリクス", "42", "2%") +st.subheader("カラムレイアウト") +col1, col2 = st.columns(2) +with col1: + st.write("これは左カラムです") + st.number_input("数値を入力", value=10) +with col2: + st.write("これは右カラムです") + st.metric("メトリクス", "42", "2%") # タブ -# st.subheader("タブ") -# tab1, tab2 = st.tabs(["第1タブ", "第2タブ"]) -# with tab1: -# st.write("これは第1タブの内容です") -# with tab2: -# st.write("これは第2タブの内容です") +st.subheader("タブ") +tab1, tab2 = st.tabs(["第1タブ", "第2タブ"]) +with tab1: + st.write("これは第1タブの内容です") +with tab2: + st.write("これは第2タブの内容です") # エクスパンダー -# st.subheader("エクスパンダー") -# with st.expander("詳細を表示"): -# st.write("これはエクスパンダー内の隠れたコンテンツです") -# st.code("print('Hello, Streamlit!')") +st.subheader("エクスパンダー") +with st.expander("詳細を表示"): + st.write("これはエクスパンダー内の隠れたコンテンツです") + st.code("print('Hello, Streamlit!')") # ============================================ # データ表示 # ============================================ -# st.header("データの表示") +st.header("データの表示") # サンプルデータフレームを作成 -# df = pd.DataFrame({ -# '名前': ['田中', '鈴木', '佐藤', '高橋', '伊藤'], -# '年齢': [25, 30, 22, 28, 33], -# '都市': ['東京', '大阪', '福岡', '札幌', '名古屋'] -# }) +df = pd.DataFrame({ + '名前': ['田中', '鈴木', '佐藤', '高橋', '伊藤'], + '年齢': [25, 30, 22, 28, 33], + '都市': ['東京', '大阪', '福岡', '札幌', '名古屋'] +}) # データフレーム表示 -# st.subheader("データフレーム") -# st.dataframe(df, use_container_width=True) +st.subheader("データフレーム") +st.dataframe(df, use_container_width=True) # テーブル表示 # st.subheader("テーブル") From a7a9dc53514d3b946931cb487a1f463cb6394d25 Mon Sep 17 00:00:00 2001 From: TNKduntech <163839971+TNKduntech@users.noreply.github.com> Date: Wed, 23 Apr 2025 22:39:06 +0900 Subject: [PATCH 3/7] Update app.py --- day1/01_streamlit_UI/app.py | 80 ++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/day1/01_streamlit_UI/app.py b/day1/01_streamlit_UI/app.py index dc459b525..46cdc137a 100644 --- a/day1/01_streamlit_UI/app.py +++ b/day1/01_streamlit_UI/app.py @@ -104,68 +104,68 @@ st.dataframe(df, use_container_width=True) # テーブル表示 -# st.subheader("テーブル") -# st.table(df) +st.subheader("テーブル") +st.table(df) # メトリクス表示 -# st.subheader("メトリクス") -# col1, col2, col3 = st.columns(3) -# col1.metric("温度", "23°C", "1.5°C") -# col2.metric("湿度", "45%", "-5%") -# col3.metric("気圧", "1013hPa", "0.1hPa") +st.subheader("メトリクス") +col1, col2, col3 = st.columns(3) +col1.metric("温度", "23°C", "1.5°C") +col2.metric("湿度", "45%", "-5%") +col3.metric("気圧", "1013hPa", "0.1hPa") # ============================================ # グラフ表示 # ============================================ -# st.header("グラフの表示") +st.header("グラフの表示") # ラインチャート -# st.subheader("ラインチャート") -# chart_data = pd.DataFrame( -# np.random.randn(20, 3), -# columns=['A', 'B', 'C']) -# st.line_chart(chart_data) +st.subheader("ラインチャート") +chart_data = pd.DataFrame( + np.random.randn(20, 3), + columns=['A', 'B', 'C']) +st.line_chart(chart_data) # バーチャート -# st.subheader("バーチャート") -# chart_data = pd.DataFrame({ -# 'カテゴリ': ['A', 'B', 'C', 'D'], -# '値': [10, 25, 15, 30] -# }).set_index('カテゴリ') -# st.bar_chart(chart_data) +st.subheader("バーチャート") +chart_data = pd.DataFrame({ + 'カテゴリ': ['A', 'B', 'C', 'D'], + '値': [10, 25, 15, 30] +}).set_index('カテゴリ') +st.bar_chart(chart_data) # ============================================ # インタラクティブ機能 # ============================================ -# st.header("インタラクティブ機能") +st.header("インタラクティブ機能") # プログレスバー -# st.subheader("プログレスバー") -# progress = st.progress(0) -# if st.button("進捗をシミュレート"): -# for i in range(101): -# time.sleep(0.01) -# progress.progress(i / 100) -# st.balloons() +st.subheader("プログレスバー") +progress = st.progress(0) +if st.button("進捗をシミュレート"): + for i in range(101): + time.sleep(0.01) + progress.progress(i / 100) + st.balloons() # ファイルアップロード -# st.subheader("ファイルアップロード") -# uploaded_file = st.file_uploader("ファイルをアップロード", type=["csv", "txt"]) -# if uploaded_file is not None: -# # ファイルのデータを表示 -# bytes_data = uploaded_file.getvalue() -# st.write(f"ファイルサイズ: {len(bytes_data)} bytes") -# -# # CSVの場合はデータフレームとして読み込む -# if uploaded_file.name.endswith('.csv'): -# df = pd.read_csv(uploaded_file) -# st.write("CSVデータのプレビュー:") -# st.dataframe(df.head()) +st.subheader("ファイルアップロード") +uploaded_file = st.file_uploader("ファイルをアップロード", type=["csv", "txt"]) +if uploaded_file is not None: + # ファイルのデータを表示 + bytes_data = uploaded_file.getvalue() + st.write(f"ファイルサイズ: {len(bytes_data)} bytes") + + # CSVの場合はデータフレームとして読み込む + if uploaded_file.name.endswith('.csv'): + df = pd.read_csv(uploaded_file) + st.write("CSVデータのプレビュー:") + st.dataframe(df.head()) # ============================================ # カスタマイズ # ============================================ -# st.header("スタイルのカスタマイズ") +st.header("スタイルのカスタマイズ") # カスタムCSS # st.markdown(""" From 9d87d3da0c5ed24f6025e23b1279789c505b13f8 Mon Sep 17 00:00:00 2001 From: TNKduntech <163839971+TNKduntech@users.noreply.github.com> Date: Wed, 23 Apr 2025 22:39:50 +0900 Subject: [PATCH 4/7] Update app.py --- day1/01_streamlit_UI/app.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/day1/01_streamlit_UI/app.py b/day1/01_streamlit_UI/app.py index 46cdc137a..45edafecd 100644 --- a/day1/01_streamlit_UI/app.py +++ b/day1/01_streamlit_UI/app.py @@ -168,17 +168,17 @@ st.header("スタイルのカスタマイズ") # カスタムCSS -# st.markdown(""" -# -# """, unsafe_allow_html=True) -# -# st.markdown('

これはカスタムCSSでスタイリングされたテキストです!

', unsafe_allow_html=True) +st.markdown(""" + +""", unsafe_allow_html=True) + +st.markdown('

これはカスタムCSSでスタイリングされたテキストです!

', unsafe_allow_html=True) # ============================================ # デモの使用方法 From c41a829cce7f81ac61ff290e43fcf4cb2bf45b38 Mon Sep 17 00:00:00 2001 From: TNKduntech <163839971+TNKduntech@users.noreply.github.com> Date: Wed, 21 May 2025 17:38:19 +0900 Subject: [PATCH 5/7] Update test.yml --- .github/workflows/test.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b4aad9943..959452c38 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,10 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 # 差分検知やmainブランチ比較に必要 - name: Set up Python uses: actions/setup-python@v4 @@ -39,3 +42,18 @@ jobs: - name: Run model tests run: | pytest day5/演習3/tests/test_model.py -v + + # 最新モデルのテスト(精度・推論時間) + - name: Run model test (accuracy and inference time) + run: | + pytest tests/test_model_metrics.py + + # mainブランチのモデルを取得して比較 + - name: Checkout main branch for regression test + run: | + git fetch origin main:main + git checkout main -- path/to/model.pkl + + - name: Run regression test (compare with main) + run: | + pytest tests/test_model_regression.py From 98af2857d33a73147dc4068d0a3623a7d4386036 Mon Sep 17 00:00:00 2001 From: TNKduntech <163839971+TNKduntech@users.noreply.github.com> Date: Wed, 21 May 2025 17:52:08 +0900 Subject: [PATCH 6/7] Update test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 959452c38..d23997e80 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -4,7 +4,7 @@ on: # push: # branches: [ main, master ] pull_request: - branches: [ main, master ] + branches: [ develop ] jobs: test: From 3c5d5241f5ce94623523babb80397b817f46b555 Mon Sep 17 00:00:00 2001 From: TNKduntech <163839971+TNKduntech@users.noreply.github.com> Date: Wed, 21 May 2025 17:53:16 +0900 Subject: [PATCH 7/7] Update test.yml --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d23997e80..42e69682d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,7 +2,7 @@ name: ML Pipeline CI on: # push: - # branches: [ main, master ] + # branches: [ develop ] pull_request: branches: [ develop ]