본문 바로가기

석박사/최적화는 사기가 아니얏!

Gurobi 로그 파일 시각화 (log file visualization)

반응형

Gurobi 로그 파일을 보면 대강 이렇게 생겼다. 저 노드정보에 있는 Gap 이랑 Time 을 시각화하고 싶었는데 은근 파싱하기가 까다로웠다. 이렇게 어려울리 없어! 하고 찾아낸게 다음 라이브러리. 

https://github.com/Gurobi/gurobi-logtools

 

GitHub - Gurobi/gurobi-logtools: Extract and visualize information from Gurobi log files

Extract and visualize information from Gurobi log files - GitHub - Gurobi/gurobi-logtools: Extract and visualize information from Gurobi log files

github.com

Gurobi-logtools 라는 라이브러리인데 아무래도 공식 라이브러리같다. 관련한 테크톡도 찾을 수 있었다. 

https://www.youtube.com/watch?v=wbg4Zr_A1s8

 

더 자세한 정보는 링크에 나오겠지만, 핵심적인 코드와 기능 몇개만 요약해보겠다. 

glt.plot(node_log, y="Gap", color="Log", type="line", labels={"Time": "Time(sec)", "Gap": "MIP Gap"}, title = "Node progress")

Plotly 에 기반한 interactive chart 로 시작화 할 수 있는 것이 장점이다. 커서 위치에 따라 파란색 박스처럼 데이터의 실제 값을 볼 수 있다.

 

 

\

 

 

 

 

 

 

 

 

 

 

\

 

 

 

 

반응형