Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1b29032
UIを変更
Shohei965 Apr 23, 2025
733b09d
Merge branch 'matsuolab:master' into master
Shohei965 May 20, 2025
b6e1942
演習3: CI 設定を確認
Shohei965 May 21, 2025
c4e0ef5
Day5 宿題
Shohei965 May 21, 2025
42f0138
Day5宿題
Shohei965 May 21, 2025
740a087
Day5宿題
Shohei965 May 21, 2025
9365640
Day5宿題
Shohei965 May 21, 2025
03c26b8
Day5宿題
Shohei965 May 21, 2025
3a691ae
Day5宿題
Shohei965 May 21, 2025
8ec065d
Day5宿題
Shohei965 May 21, 2025
0768d25
Day5宿題
Shohei965 May 21, 2025
f080c03
Day5宿題
Shohei965 May 21, 2025
ec45c87
Merge pull request #1 from Shohei965/develop
Shohei965 May 21, 2025
39737bd
Day5宿題
Shohei965 May 21, 2025
ae52716
Day5宿題
Shohei965 May 21, 2025
ef43f64
Day5宿題
Shohei965 May 21, 2025
5f4e879
Day5宿題
Shohei965 May 21, 2025
847264f
Day5宿題
Shohei965 May 21, 2025
584b427
Day5宿題
Shohei965 May 21, 2025
dddcb27
Day5宿題
Shohei965 May 21, 2025
9de0122
Day5宿題
Shohei965 May 21, 2025
173d837
Day5宿題
Shohei965 May 21, 2025
0711a6d
Day5宿題
Shohei965 May 21, 2025
1b06362
Day5宿題
Shohei965 May 21, 2025
faf1a54
Merge pull request #2 from Shohei965/develop
Shohei965 May 21, 2025
fce8611
Day5宿題
Shohei965 May 21, 2025
3bafc46
Day5宿題
Shohei965 May 21, 2025
f22ecc6
Merge pull request #3 from Shohei965/develop
Shohei965 May 21, 2025
dc856c4
Add Sheets-based summarization
Shohei965 Jun 19, 2025
c695e7a
Merge pull request #4 from Shohei965/codex/質疑応答まとめ機能の作成
Shohei965 Jun 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 41 additions & 31 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,51 @@
name: ML Pipeline CI

on:
# push:
# branches: [ main, master ]
pull_request:
branches: [ main, master ]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest great_expectations pandas scikit-learn flake8 black mypy pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

- name: Lint with flake8
run: |
flake8 day5/演習3 --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 day5/演習3 --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics

- name: Format check with black
run: |
black --check day5/演習3

- name: Run data tests
run: |
pytest day5/演習3/tests/test_data.py -v

- name: Run model tests
run: |
pytest day5/演習3/tests/test_model.py -v
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest great_expectations pandas scikit-learn flake8 black mypy pytest-cov joblib mlflow
# now install all Day5-specific deps (includes kedro)
if [ -f day5/requirements.txt ]; then pip install -r day5/requirements.txt; fi

- name: Generate model for tests
run: |
cd day5/演習1
python main.py # データ準備→学習→モデル保存
python pipeline.py # Kedroパイプライン
cd ../..

- name: Lint with flake8
run: |
flake8 day5/演習3 --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 day5/演習3 --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics

- name: Format check with black
run: |
black --check day5/演習3

- name: Run data tests
run: |
pytest day5/演習3/tests/test_data.py -v

- name: Run model tests
run: |
pytest day5/演習3/tests/test_model.py -v

- name: Run model performance accuracy test
run: |
pytest day5/演習3/tests/test_model_performance.py::test_model_inference_accuracy -v
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# day5 の学習済みモデルを無視
day5/**/models/*.pkl
215 changes: 112 additions & 103 deletions day1/01_streamlit_UI/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,25 @@
# ============================================
# ページ設定
# ============================================
# st.set_page_config(
# page_title="Streamlit デモ",
# layout="wide",
# initial_sidebar_state="expanded"
# )
st.set_page_config(
page_title="Streamlit デモ",
layout="wide",
initial_sidebar_state="expanded"
)

# ============================================
# タイトルと説明
# ============================================
st.title("Streamlit 初心者向けデモ")
st.markdown("### コメントを解除しながらStreamlitの機能を学びましょう")
st.markdown("このデモコードでは、コメントアウトされた部分を順番に解除しながらUIの変化を確認できます。")
st.title("Streamlit デモ")
st.markdown(
"""
### ストリームリットの様々な機能を学ぼう!
このデモコードでは、コメントアウトされた部分を順番に解除しながらUIの変化を確認できます。
"""
)

# ============================================
# サイドバー
# サイドバー
# ============================================
st.sidebar.header("デモのガイド")
st.sidebar.info("コードのコメントを解除して、Streamlitのさまざまな機能を確認しましょう。")
Expand All @@ -36,149 +40,154 @@
st.write(f"こんにちは、{name}さん!")

# ボタン
# st.subheader("ボタン")
# if st.button("クリックしてください"):
# st.success("ボタンがクリックされました!")
st.subheader("ボタン")
if st.button("クリックしてください", help="ボタンをクリックするとメッセージが表示されます。"):
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("セレクトボックス")
# 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("テーブル")
# 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("""
# <style>
# .big-font {
# font-size:20px !important;
# font-weight: bold;
# color: #0066cc;
# }
# </style>
# """, unsafe_allow_html=True)
#
# st.markdown('<p class="big-font">これはカスタムCSSでスタイリングされたテキストです!</p>', unsafe_allow_html=True)
st.markdown("""
<style>
.big-font {
font-size: 20px !important;
font-weight: bold;
color: #0066cc;
text-align: center;
}
.stButton button {
background-color: #ff5f57;
color: white;
}
</style>
""", unsafe_allow_html=True)

st.markdown('<p class="big-font">これはカスタムCSSでスタイリングされたテキストです!</p>', unsafe_allow_html=True)

# ============================================
# デモの使用方法
Expand All @@ -200,4 +209,4 @@
# コメントを解除した例:
if st.button("クリックしてください"):
st.success("ボタンがクリックされました!")
""")
""")
Binary file modified day5/演習1/models/titanic_model.pkl
Binary file not shown.
Binary file modified day5/演習2/models/titanic_model.pkl
Binary file not shown.
Loading