-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
84 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,78 @@ | ||
# full searh, GA, QDの実験結果の可視化 | ||
# 既存モデルの全探索, ランダムサーチ, GA, QDの実験結果の可視化 | ||
|
||
## 概要 | ||
|
||
以下の3種類の図を作成する。 | ||
- 棒グラフ | ||
- レーダーチャート | ||
以下の5種類の図と2種類の表を作成する。 | ||
|
||
図を生成するスクリプトは`/graphs`にある。 | ||
- 箱ひげ図 | ||
- `box.py` | ||
- full-search,random-search,GA,QD | ||
- Fig.3(A), Fig.5(A) | ||
- タイムライン | ||
- `timeline.py` | ||
- GA,QD | ||
- Fig.3(B), Fig.5(B) | ||
- レーダーチャート | ||
- `radar_chart.py` | ||
- full-search,GA,QD | ||
- Fig.4, Fig.6 | ||
- ネットワークのベクトルが作るマップ | ||
- `map.py` | ||
- GA,QDの実データ | ||
- Fig.7 | ||
- 棒グラフ | ||
- `bar_graph.py` | ||
- full-search,random-search,GA,QD | ||
|
||
表を生成するスクリプトは`/tables`にある。 | ||
- 最良個体の距離の平均と分散を示す表 | ||
- `print_best.py` | ||
- full-search,random-search,GA,QD | ||
- Table1, Table2 | ||
- 最良の遺伝子5つを示すlatex形式の表 | ||
- `latex_table.py` | ||
- QD | ||
- Table3 | ||
|
||
|
||
## 実行方法 | ||
|
||
### 前処理 | ||
GA,QDで見つけた最良のrho,nu,recentness,frequencyの組で壺モデルを10回走らせます。 | ||
GA,QD,ランダムサーチで見つけた最良のrho,nu,recentness,frequencyの組で壺モデルを10回走らせます。(既存モデルの全探索では初めから10回走らせているため、ここでは行いません) | ||
```bash | ||
$ pwd # => /path/to/visualize | ||
$ python preprocessing.py <target_type> | ||
``` | ||
この結果は`./results/fitted`に保存され、棒グラフ・レーダーチャートの生成に用いられます。 | ||
この結果は`./results/fitted`に保存され、棒グラフ・レーダーチャート,最良個体の距離の表の生成に用いられます。 | ||
|
||
|
||
GA,QDの最終的な全個体のに対して、壺モデルを回してネットワークを生成します。そのネットワークをgraph2vecしたベクトルを保存しておきます。 | ||
```bash | ||
$ python make_vec.py <target_type> | ||
``` | ||
この結果は`./results/vec`に保存され、ネットワークのベクトルが作るマップに用いられます。 | ||
|
||
|
||
|
||
### 可視化のスクリプト | ||
図を出力する場合 | ||
```bash | ||
$ pwd # => /path/to/visualize | ||
$ python main.py <graph_type> <target_type> | ||
``` | ||
|
||
各引数の詳細などは `python main.py -h` あるいは `python main.py --help` で確認できます。 | ||
実行を行うと,`./results` 以下にグラフの種類ごとに分けられて結果が保存されます。 | ||
|
||
|
||
最良個体の距離の平均と分散を示す表を出力する場合 | ||
```bash | ||
$ python tables/print_best.py <target_type> | ||
``` | ||
また、latex形式で遺伝子の表を出力するには、以下のコマンドを実行してください。 | ||
```bash | ||
$ pwd # => /path/to/visualize | ||
$ python graphs/latex_table.py | ||
``` | ||
`MPS-TOM-urnmodel/`で用意されているpoetry環境では、このスクリプトだけpandasのversionの依存関係が合わないため、動きません。 | ||
`MPS-TOM-urnmodel/`で用意されているpoetry環境では、`latex_table.py`だけpandasのversionの依存関係が合わないため、動きません。 | ||
`pandas>=1.5.3`, `Jinja2>=3.0.0`, `matplotlib`, `numpy`のある環境で実行してください。 |