<?xml version="1.0" encoding="UTF-8" ?>
<rdf:RDF
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns="http://purl.org/rss/1.0/"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:content="http://purl.org/rss/1.0/modules/content/">

  <channel rdf:about="https://stochaotic.blog.shinobi.jp/RSS/100/">
    <title>揺動経路の記録</title>
    <link>https://stochaotic.blog.shinobi.jp/</link>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="https://stochaotic.blog.shinobi.jp/RSS/" />
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" />
    <description></description>
    <dc:language>ja</dc:language>
    <dc:date>2024-06-17T11:43:15+09:00</dc:date>
    <items>
    <rdf:Seq>
      <rdf:li rdf:resource="https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/test" />
      <rdf:li rdf:resource="https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/jsae" />
      <rdf:li rdf:resource="https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/test_58" />
      <rdf:li rdf:resource="https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/%E3%83%86%E3%82%B9%E3%83%88" />
      <rdf:li rdf:resource="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" />
      <rdf:li rdf:resource="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" />
      <rdf:li rdf:resource="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" />
      <rdf:li rdf:resource="https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/webcrawing%20scripts" />
      <rdf:li rdf:resource="https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/next---" />
      <rdf:li rdf:resource="https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/next--" />
    </rdf:Seq>
    </items>
  </channel>

  <item rdf:about="https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/test">
    <link>https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/test</link>
    <title>test</title>
    <description> ダウンロード </description>
    <content:encoded><![CDATA[<a href="//stochaotic.blog.shinobi.jp/File/work_20240615_cpy.zip" target="_blank">ダウンロード</a>]]></content:encoded>
    <dc:subject>未選択</dc:subject>
    <dc:date>2024-06-17T11:43:15+09:00</dc:date>
    <dc:creator>stochaotic</dc:creator>
    <dc:publisher>NINJA BLOG</dc:publisher>
    <dc:rights>stochaotic</dc:rights>
  </item>
  <item rdf:about="https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/jsae">
    <link>https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/jsae</link>
    <title>jsae</title>
    <description> ダウンロード </description>
    <content:encoded><![CDATA[<a href="//stochaotic.blog.shinobi.jp/File/jsae_2021sp.zip" target="_blank">ダウンロード</a>]]></content:encoded>
    <dc:subject>未選択</dc:subject>
    <dc:date>2021-05-31T22:01:21+09:00</dc:date>
    <dc:creator>stochaotic</dc:creator>
    <dc:publisher>NINJA BLOG</dc:publisher>
    <dc:rights>stochaotic</dc:rights>
  </item>
  <item rdf:about="https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/test_58">
    <link>https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/test_58</link>
    <title>test</title>
    <description> ダウンロード </description>
    <content:encoded><![CDATA[<a href="//stochaotic.blog.shinobi.jp/File/f2550268.zip" target="_blank">ダウンロード</a>]]></content:encoded>
    <dc:subject>未選択</dc:subject>
    <dc:date>2020-11-09T00:36:16+09:00</dc:date>
    <dc:creator>stochaotic</dc:creator>
    <dc:publisher>NINJA BLOG</dc:publisher>
    <dc:rights>stochaotic</dc:rights>
  </item>
  <item rdf:about="https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/%E3%83%86%E3%82%B9%E3%83%88">
    <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>
    <title>テスト</title>
    <description>https://stochaotic.blog.shinobi.jp/File/scan-2003232002
https://stochaotic.blog.shinobi.jp/File/scan-2003232004...</description>
    <content:encoded><![CDATA[https://stochaotic.blog.shinobi.jp/File/scan-2003232002<br />
https://stochaotic.blog.shinobi.jp/File/scan-2003232004]]></content:encoded>
    <dc:subject>未選択</dc:subject>
    <dc:date>2020-03-23T20:49:34+09:00</dc:date>
    <dc:creator>stochaotic</dc:creator>
    <dc:publisher>NINJA BLOG</dc:publisher>
    <dc:rights>stochaotic</dc:rights>
  </item>
  <item rdf:about="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>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>
    <title>小ネタ</title>
    <description>一日を15分刻みにした1次元配列で取り扱う

------------------------------------------------------------------------------
import datetimeimport pandas as pd
timestamp_ind...</description>
    <content:encoded><![CDATA[<div>一日を15分刻みにした1次元配列で取り扱う<br />
<br />
------------------------------------------------------------------------------<br />
import datetime</div><div>import pandas as pd<br />
<div>timestamp_index = []</div><div>timestamp_list = [0]*24*4</div><div>for val1 in range(0, 24,1):</div><div>&nbsp; &nbsp; for val2 in [0,15,30, 45]:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; timestamp_index.append('{0:02d}:{1:02d}'.format(val1, val2))</div><div>df = pd.DataFrame(timestamp_list, index=time_stamp_index, columns=['counts'])<br />
<div>timestamp = datetime.datetime.strptime('2020/1/1 11:43:00', '%Y/%m/%d %H:%M:%S' )</div><div>idx = timestamp.hour*4 + int(timestamp.minute / 15)<br />
<div>df.iloc[idx] += 1</div><div>df.iloc[idx]</div></div></div></div>]]></content:encoded>
    <dc:subject>プログラミング</dc:subject>
    <dc:date>2020-02-11T22:40:08+09:00</dc:date>
    <dc:creator>stochaotic</dc:creator>
    <dc:publisher>NINJA BLOG</dc:publisher>
    <dc:rights>stochaotic</dc:rights>
  </item>
  <item rdf:about="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>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>
    <title>ModuleNotFoundError問題</title>
    <description>機会学習モデルをpklで保存したあとに、クラスオブジェクト情報などを一緒に格納しようとしたときに生じうるエラー

保存するときの構成が引き継がれてしまう。実際にpklのバイナリを確認してみるとディレクトリ構成の情報が入っていることがわかる

解決策？

https://stackoverflow.c...</description>
    <content:encoded><![CDATA[機会学習モデルをpklで保存したあとに、クラスオブジェクト情報などを一緒に格納しようとしたときに生じうるエラー<br />
<br />
保存するときの構成が引き継がれてしまう。実際にpklのバイナリを確認してみるとディレクトリ構成の情報が入っていることがわかる<br />
<br />
解決策？<br />
<br />
https://stackoverflow.com/questions/2121874/python-pickling-after-changing-a-modules-directory<br />
<br />
<br />
<pre class="lang-py prettyprint prettyprinted"><code><span class="kwd">import</span><span class="pln"> sys<br />
</span><span class="kwd">from</span><span class="pln"> whyteboard </span><span class="kwd">import</span><span class="pln"> tools<br />
<br />
sys</span><span class="pun">.</span><span class="pln">modules</span><span class="pun">[</span><span class="str">'tools'</span><span class="pun">]</span><span class="pln"> </span><span class="pun">=</span><span class="pln"> tools</span></code></pre>]]></content:encoded>
    <dc:subject>プログラミング</dc:subject>
    <dc:date>2019-02-27T20:39:16+09:00</dc:date>
    <dc:creator>stochaotic</dc:creator>
    <dc:publisher>NINJA BLOG</dc:publisher>
    <dc:rights>stochaotic</dc:rights>
  </item>
  <item rdf:about="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>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>
    <title>GBDTを利用した特徴量変換スクリプト</title>
    <description>サンプルコード
import numpy as np

from sklearn.ensemble import GradientBoostingClassifier
from sklearn.model_selection import GridSearchCV
from sklearn.data...</description>
    <content:encoded><![CDATA[サンプルコード<br />
<pre style="background-color: #2b2b2b; color: #a9b7c6; font-family: 'ＭＳ ゴシック'; font-size: 9.0pt;"><span style="color: #cc7832;">import </span>numpy <span style="color: #cc7832;">as </span>np<br />
<br />
<span style="color: #cc7832;">from </span>sklearn.ensemble <span style="color: #cc7832;">import </span>GradientBoostingClassifier<br />
<span style="color: #cc7832;">from </span>sklearn.model_selection <span style="color: #cc7832;">import </span>GridSearchCV<br />
<span style="color: #cc7832;">from </span>sklearn.datasets <span style="color: #cc7832;">import </span>load_iris<br />
<br />
<span style="color: #cc7832;">def </span><span style="color: #ffc66d;">feature_transformation</span>(gscv<span style="color: #cc7832;">, </span>x):<br />
  ret = [gscv.best_estimator_.estimators_[i<span style="color: #cc7832;">, </span><span style="color: #6897bb;">0</span>].tree_.apply(x.astype(np.float32)) <span style="color: #cc7832;">for </span>i <span style="color: #cc7832;">in<br />
</span><span style="color: #cc7832;">     </span><span style="color: #8888c6;">range</span>(gscv.best_estimator_.n_estimators)]<br />
  <span style="color: #cc7832;">return </span>np.array(ret)<br />
<br />
<span style="color: #cc7832;">def </span><span style="color: #ffc66d;">ft_gbdt</span>():<br />
  data = load_iris()<br />
<br />
  x = data[<span style="color: #6a8759;">'data'</span>]<br />
  y = data[<span style="color: #6a8759;">'target'</span>]<br />
  x_train = x[<span style="color: #6897bb;">0</span>:<span style="color: #6897bb;">130</span>]<br />
  x_test = x[<span style="color: #6897bb;">130</span>:<span style="color: #6897bb;">150</span>]<br />
  y_train = y[<span style="color: #6897bb;">0</span>:<span style="color: #6897bb;">130</span>]<br />
  y_test = y[<span style="color: #6897bb;">130</span>:<span style="color: #6897bb;">150</span>]<br />
<br />
  <span style="color: #8888c6;">print</span>(<span style="color: #6a8759;">"x:{}"</span>.format(np.array(x).shape))<br />
  <span style="color: #8888c6;">print</span>(<span style="color: #6a8759;">"y:{}"</span>.format(np.array(y).shape))<br />
<br />
  <span style="color: #808080;"># tune hyper parameters first<br />
</span><span style="color: #808080;">    </span>model = GradientBoostingClassifier(<span style="color: #aa4926;">n_estimators</span>=<span style="color: #6897bb;">1000</span>)<br />
  parameters = {<span style="color: #6a8759;">'learning_rate' </span>: [<span style="color: #6897bb;">0.1</span>]<span style="color: #cc7832;">,<br />
</span><span style="color: #cc7832;">                  </span><span style="color: #6a8759;">'max_depth'</span>: [<span style="color: #6897bb;">4</span><span style="color: #cc7832;">, </span><span style="color: #6897bb;">6</span>]<span style="color: #cc7832;">,<br />
</span><span style="color: #cc7832;">                  </span><span style="color: #6a8759;">'min_samples_leaf'</span>: [<span style="color: #6897bb;">3</span><span style="color: #cc7832;">, </span><span style="color: #6897bb;">5</span>]<span style="color: #cc7832;">,<br />
</span><span style="color: #cc7832;">                  </span><span style="color: #6a8759;">'max_features'</span>: [<span style="color: #6897bb;">1.0</span>]}<br />
<br />
  gscv = GridSearchCV(model<span style="color: #cc7832;">, </span>parameters<span style="color: #cc7832;">, </span><span style="color: #aa4926;">verbose</span>=<span style="color: #6897bb;">10</span><span style="color: #cc7832;">, </span><span style="color: #aa4926;">n_jobs</span>=-<span style="color: #6897bb;">1</span><span style="color: #cc7832;">, </span><span style="color: #aa4926;">cv</span>=<span style="color: #6897bb;">4</span>)<br />
  gscv.fit(x_train<span style="color: #cc7832;">, </span>y_train)<br />
  <span style="color: #8888c6;">print</span>(<span style="color: #6a8759;">"score:{}"</span>.format(gscv.score(x_test<span style="color: #cc7832;">, </span>y_test)))<br />
<br />
  # ------------------------------------------------<br />
  ret = feature_transformation(gscv<span style="color: #cc7832;">, </span>x_test)<br />
<br />
  <span style="color: #8888c6;">print</span>(<span style="color: #6a8759;">"ret:{}"</span>.format(ret))</pre>]]></content:encoded>
    <dc:subject>未選択</dc:subject>
    <dc:date>2018-07-10T00:57:23+09:00</dc:date>
    <dc:creator>stochaotic</dc:creator>
    <dc:publisher>NINJA BLOG</dc:publisher>
    <dc:rights>stochaotic</dc:rights>
  </item>
  <item rdf:about="https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/webcrawing%20scripts">
    <link>https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/webcrawing%20scripts</link>
    <title>webcrawing scripts</title>
    <description> ダウンロード </description>
    <content:encoded><![CDATA[<a href="//stochaotic.blog.shinobi.jp/File/webcrawling.zip" target="_blank">ダウンロード</a>]]></content:encoded>
    <dc:subject>未選択</dc:subject>
    <dc:date>2018-04-01T21:47:38+09:00</dc:date>
    <dc:creator>stochaotic</dc:creator>
    <dc:publisher>NINJA BLOG</dc:publisher>
    <dc:rights>stochaotic</dc:rights>
  </item>
  <item rdf:about="https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/next---">
    <link>https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/next---</link>
    <title>next+++</title>
    <description> ダウンロード </description>
    <content:encoded><![CDATA[<a href="//stochaotic.blog.shinobi.jp/File/NEXT.ZIP" target="_blank">ダウンロード</a>]]></content:encoded>
    <dc:subject>未選択</dc:subject>
    <dc:date>2018-03-29T00:25:01+09:00</dc:date>
    <dc:creator>stochaotic</dc:creator>
    <dc:publisher>NINJA BLOG</dc:publisher>
    <dc:rights>stochaotic</dc:rights>
  </item>
  <item rdf:about="https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/next--">
    <link>https://stochaotic.blog.shinobi.jp/%E6%9C%AA%E9%81%B8%E6%8A%9E/next--</link>
    <title>next++</title>
    <description> ダウンロード </description>
    <content:encoded><![CDATA[<a href="//stochaotic.blog.shinobi.jp/File/NEXT.ZIP" target="_blank">ダウンロード</a>]]></content:encoded>
    <dc:subject>未選択</dc:subject>
    <dc:date>2018-03-28T01:56:18+09:00</dc:date>
    <dc:creator>stochaotic</dc:creator>
    <dc:publisher>NINJA BLOG</dc:publisher>
    <dc:rights>stochaotic</dc:rights>
  </item>
</rdf:RDF>
