tipsJupyter Notebook のデザインカスタマイズ (参考|Jupyter Notebook テーマのカスタマイズ) 1. jupyterthemesのインストール # use conda conda install -c conda-forge jupyterthemes # use p... 2022.02.06tips
tipsエクセル表のMarkdown形式への変換(python) ライブラリ pandas、pytablewriterを使用する。 モジュールのインスール # conda conda install -c conda-forge pytablewriter # pip pip install pytab... 2022.02.06tips
tipsXGBoost, lightGBM, Catboost をGoogle ColaboratoryのGPUで実行する方法 Boosting系モデル(XGBoost, lightGBM, CatBoost)の計算をGoogle ColaboratoryのGPUで実行する方法 準備 準備 Google Colabでipynbファイルを開き以下の操作を行なっておく。... 2021.10.02tips
tipsショートカットファイルのリンク先ファイルを一括取得するpythonコード(windows) フォルダ内のショートカットファイル(.lnk)を全て、参照元のファイルと置き換えるpythonコード import win32com.client import os import shutil import glob #処理するフォルダ... 2021.08.09tips
tipsMatplotlibで3次元の散布図を描画する コード from matplotlib import pyplot as plt import numpy as np from mpl_toolkits.mplot3d.axes3d import Axes3D #グラフをポップアップで... 2021.07.03tips
tipsクロスバリデーションでの分割数の目安 1000 サンプル以上 : 2-fold クロスバリデーション 1000 から 100 くらいまで : 5-fold クロスバリデーション 100 から 30 くらいまで : 10-fold クロスバリデーション 30 以下 : leav... 2021.07.03tips
tipspickle形式でのオブジェクトの保存と読み込み(python) データや学習済みモデルなどのオブジェクトを pickle形式で保存することができる。 こうすることで、プログラムを実行し終えた後もオブジェクトの呼び出しが可能。 import pickle #オブジェクトの保存(sample_object... 2021.07.03tips
tipspystanの計算がmacで実行できない時の対処法 以下のコードを追記する import multiprocessing multiprocessing.set_start_method("fork") 以上 参考 PyStan throws error when r... 2021.07.03tips
tipspandasでxlsxファイルが読めない時の対処法(xlrderror) xlrdの新バージョンでは、xlsxのサポートがなくなったらしい。 openpyxlをインストールして、pandasでのread_excelの際に、openpyxlを指定する。 pip install openpyxl df = pd.re... 2021.07.03tips
tipsmatplotlibを日本語表示対応にする方法 1.japanize matplotlib をインストールする pip install japanize-matplotlib 2.japanize_matplotlibをmatplotlibと共にインポートする import matplo... 2021.07.03tips