<?xml version="1.0" encoding="UTF-8" ?>
<rss version="0.91">
  <channel>
    <title>揺動経路の記録</title>
    <description></description>
    <link>https://stochaotic.blog.shinobi.jp/</link>
    <language>ja</language>
    <copyright>Copyright (C) NINJATOOLS ALL RIGHTS RESERVED.</copyright>

    <item>
      <title>test</title>
      <description>&lt;a href=&quot;//stochaotic.blog.shinobi.jp/File/work_20240615_cpy.zip&quot; target=&quot;_blank&quot;&gt;ダウンロード&lt;/a&gt;</description> 
      <link>https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/test</link> 
    </item>
    <item>
      <title>jsae</title>
      <description>&lt;a href=&quot;//stochaotic.blog.shinobi.jp/File/jsae_2021sp.zip&quot; target=&quot;_blank&quot;&gt;ダウンロード&lt;/a&gt;</description> 
      <link>https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/jsae</link> 
    </item>
    <item>
      <title>test</title>
      <description>&lt;a href=&quot;//stochaotic.blog.shinobi.jp/File/f2550268.zip&quot; target=&quot;_blank&quot;&gt;ダウンロード&lt;/a&gt;</description> 
      <link>https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/test_58</link> 
    </item>
    <item>
      <title>テスト</title>
      <description>https://stochaotic.blog.shinobi.jp/File/scan-2003232002&lt;br /&gt;
https://stochaotic.blog.shinobi.jp/File/scan-2003232004</description> 
      <link>https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/%E3%83%86%E3%82%B9%E3%83%88</link> 
    </item>
    <item>
      <title>小ネタ</title>
      <description>&lt;div&gt;一日を15分刻みにした1次元配列で取り扱う&lt;br /&gt;
&lt;br /&gt;
------------------------------------------------------------------------------&lt;br /&gt;
import datetime&lt;/div&gt;&lt;div&gt;import pandas as pd&lt;br /&gt;
&lt;div&gt;timestamp_index = []&lt;/div&gt;&lt;div&gt;timestamp_list = [0]*24*4&lt;/div&gt;&lt;div&gt;for val1 in range(0, 24,1):&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; for val2 in [0,15,30, 45]:&lt;/div&gt;&lt;div&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; timestamp_index.append('{0:02d}:{1:02d}'.format(val1, val2))&lt;/div&gt;&lt;div&gt;df = pd.DataFrame(timestamp_list, index=time_stamp_index, columns=['counts'])&lt;br /&gt;
&lt;div&gt;timestamp = datetime.datetime.strptime('2020/1/1 11:43:00', '%Y/%m/%d %H:%M:%S' )&lt;/div&gt;&lt;div&gt;idx = timestamp.hour*4 + int(timestamp.minute / 15)&lt;br /&gt;
&lt;div&gt;df.iloc[idx] += 1&lt;/div&gt;&lt;div&gt;df.iloc[idx]&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</description> 
      <link>https://stochaotic.blog.shinobi.jp/%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0/%E5%B0%8F%E3%83%8D%E3%82%BF</link> 
    </item>
    <item>
      <title>ModuleNotFoundError問題</title>
      <description>機会学習モデルをpklで保存したあとに、クラスオブジェクト情報などを一緒に格納しようとしたときに生じうるエラー&lt;br /&gt;
&lt;br /&gt;
保存するときの構成が引き継がれてしまう。実際にpklのバイナリを確認してみるとディレクトリ構成の情報が入っていることがわかる&lt;br /&gt;
&lt;br /&gt;
解決策？&lt;br /&gt;
&lt;br /&gt;
https://stackoverflow.com/questions/2121874/python-pickling-after-changing-a-modules-directory&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;lang-py prettyprint prettyprinted&quot;&gt;&lt;code&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; sys&lt;br /&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;from&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; whyteboard &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;import&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; tools&lt;br /&gt;
&lt;br /&gt;
sys&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;modules&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;'tools'&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; tools&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;</description> 
      <link>https://stochaotic.blog.shinobi.jp/%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0/modulenotfounderror%E5%95%8F%E9%A1%8C</link> 
    </item>
    <item>
      <title>GBDTを利用した特徴量変換スクリプト</title>
      <description>サンプルコード&lt;br /&gt;
&lt;pre style=&quot;background-color: #2b2b2b; color: #a9b7c6; font-family: 'ＭＳ ゴシック'; font-size: 9.0pt;&quot;&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;import &lt;/span&gt;numpy &lt;span style=&quot;color: #cc7832;&quot;&gt;as &lt;/span&gt;np&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #cc7832;&quot;&gt;from &lt;/span&gt;sklearn.ensemble &lt;span style=&quot;color: #cc7832;&quot;&gt;import &lt;/span&gt;GradientBoostingClassifier&lt;br /&gt;
&lt;span style=&quot;color: #cc7832;&quot;&gt;from &lt;/span&gt;sklearn.model_selection &lt;span style=&quot;color: #cc7832;&quot;&gt;import &lt;/span&gt;GridSearchCV&lt;br /&gt;
&lt;span style=&quot;color: #cc7832;&quot;&gt;from &lt;/span&gt;sklearn.datasets &lt;span style=&quot;color: #cc7832;&quot;&gt;import &lt;/span&gt;load_iris&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #cc7832;&quot;&gt;def &lt;/span&gt;&lt;span style=&quot;color: #ffc66d;&quot;&gt;feature_transformation&lt;/span&gt;(gscv&lt;span style=&quot;color: #cc7832;&quot;&gt;, &lt;/span&gt;x):&lt;br /&gt;
  ret = [gscv.best_estimator_.estimators_[i&lt;span style=&quot;color: #cc7832;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;].tree_.apply(x.astype(np.float32)) &lt;span style=&quot;color: #cc7832;&quot;&gt;for &lt;/span&gt;i &lt;span style=&quot;color: #cc7832;&quot;&gt;in&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;     &lt;/span&gt;&lt;span style=&quot;color: #8888c6;&quot;&gt;range&lt;/span&gt;(gscv.best_estimator_.n_estimators)]&lt;br /&gt;
  &lt;span style=&quot;color: #cc7832;&quot;&gt;return &lt;/span&gt;np.array(ret)&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #cc7832;&quot;&gt;def &lt;/span&gt;&lt;span style=&quot;color: #ffc66d;&quot;&gt;ft_gbdt&lt;/span&gt;():&lt;br /&gt;
  data = load_iris()&lt;br /&gt;
&lt;br /&gt;
  x = data[&lt;span style=&quot;color: #6a8759;&quot;&gt;'data'&lt;/span&gt;]&lt;br /&gt;
  y = data[&lt;span style=&quot;color: #6a8759;&quot;&gt;'target'&lt;/span&gt;]&lt;br /&gt;
  x_train = x[&lt;span style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;:&lt;span style=&quot;color: #6897bb;&quot;&gt;130&lt;/span&gt;]&lt;br /&gt;
  x_test = x[&lt;span style=&quot;color: #6897bb;&quot;&gt;130&lt;/span&gt;:&lt;span style=&quot;color: #6897bb;&quot;&gt;150&lt;/span&gt;]&lt;br /&gt;
  y_train = y[&lt;span style=&quot;color: #6897bb;&quot;&gt;0&lt;/span&gt;:&lt;span style=&quot;color: #6897bb;&quot;&gt;130&lt;/span&gt;]&lt;br /&gt;
  y_test = y[&lt;span style=&quot;color: #6897bb;&quot;&gt;130&lt;/span&gt;:&lt;span style=&quot;color: #6897bb;&quot;&gt;150&lt;/span&gt;]&lt;br /&gt;
&lt;br /&gt;
  &lt;span style=&quot;color: #8888c6;&quot;&gt;print&lt;/span&gt;(&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;x:{}&quot;&lt;/span&gt;.format(np.array(x).shape))&lt;br /&gt;
  &lt;span style=&quot;color: #8888c6;&quot;&gt;print&lt;/span&gt;(&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;y:{}&quot;&lt;/span&gt;.format(np.array(y).shape))&lt;br /&gt;
&lt;br /&gt;
  &lt;span style=&quot;color: #808080;&quot;&gt;# tune hyper parameters first&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #808080;&quot;&gt;    &lt;/span&gt;model = GradientBoostingClassifier(&lt;span style=&quot;color: #aa4926;&quot;&gt;n_estimators&lt;/span&gt;=&lt;span style=&quot;color: #6897bb;&quot;&gt;1000&lt;/span&gt;)&lt;br /&gt;
  parameters = {&lt;span style=&quot;color: #6a8759;&quot;&gt;'learning_rate' &lt;/span&gt;: [&lt;span style=&quot;color: #6897bb;&quot;&gt;0.1&lt;/span&gt;]&lt;span style=&quot;color: #cc7832;&quot;&gt;,&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;'max_depth'&lt;/span&gt;: [&lt;span style=&quot;color: #6897bb;&quot;&gt;4&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #6897bb;&quot;&gt;6&lt;/span&gt;]&lt;span style=&quot;color: #cc7832;&quot;&gt;,&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;'min_samples_leaf'&lt;/span&gt;: [&lt;span style=&quot;color: #6897bb;&quot;&gt;3&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #6897bb;&quot;&gt;5&lt;/span&gt;]&lt;span style=&quot;color: #cc7832;&quot;&gt;,&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;                  &lt;/span&gt;&lt;span style=&quot;color: #6a8759;&quot;&gt;'max_features'&lt;/span&gt;: [&lt;span style=&quot;color: #6897bb;&quot;&gt;1.0&lt;/span&gt;]}&lt;br /&gt;
&lt;br /&gt;
  gscv = GridSearchCV(model&lt;span style=&quot;color: #cc7832;&quot;&gt;, &lt;/span&gt;parameters&lt;span style=&quot;color: #cc7832;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #aa4926;&quot;&gt;verbose&lt;/span&gt;=&lt;span style=&quot;color: #6897bb;&quot;&gt;10&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #aa4926;&quot;&gt;n_jobs&lt;/span&gt;=-&lt;span style=&quot;color: #6897bb;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #cc7832;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #aa4926;&quot;&gt;cv&lt;/span&gt;=&lt;span style=&quot;color: #6897bb;&quot;&gt;4&lt;/span&gt;)&lt;br /&gt;
  gscv.fit(x_train&lt;span style=&quot;color: #cc7832;&quot;&gt;, &lt;/span&gt;y_train)&lt;br /&gt;
  &lt;span style=&quot;color: #8888c6;&quot;&gt;print&lt;/span&gt;(&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;score:{}&quot;&lt;/span&gt;.format(gscv.score(x_test&lt;span style=&quot;color: #cc7832;&quot;&gt;, &lt;/span&gt;y_test)))&lt;br /&gt;
&lt;br /&gt;
  # ------------------------------------------------&lt;br /&gt;
  ret = feature_transformation(gscv&lt;span style=&quot;color: #cc7832;&quot;&gt;, &lt;/span&gt;x_test)&lt;br /&gt;
&lt;br /&gt;
  &lt;span style=&quot;color: #8888c6;&quot;&gt;print&lt;/span&gt;(&lt;span style=&quot;color: #6a8759;&quot;&gt;&quot;ret:{}&quot;&lt;/span&gt;.format(ret))&lt;/pre&gt;</description> 
      <link>https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/gbdt%E3%82%92%E5%88%A9%E7%94%A8%E3%81%97%E3%81%9F%E7%89%B9%E5%BE%B4%E9%87%8F%E5%A4%89%E6%8F%9B%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%97%E3%83%88</link> 
    </item>
    <item>
      <title>webcrawing scripts</title>
      <description>&lt;a href=&quot;http://file.stochaotic.blog.shinobi.jp/webcrawling.zip&quot; target=&quot;_blank&quot;&gt;ダウンロード&lt;/a&gt;</description> 
      <link>https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/webcrawing%20scripts</link> 
    </item>
    <item>
      <title>next+++</title>
      <description>&lt;a href=&quot;http://file.stochaotic.blog.shinobi.jp/NEXT.ZIP&quot; target=&quot;_blank&quot;&gt;ダウンロード&lt;/a&gt;</description> 
      <link>https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/next---</link> 
    </item>
    <item>
      <title>next++</title>
      <description>&lt;a href=&quot;http://file.stochaotic.blog.shinobi.jp/NEXT.ZIP&quot; target=&quot;_blank&quot;&gt;ダウンロード&lt;/a&gt;</description> 
      <link>https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/next--</link> 
    </item>

  </channel>
</rss>