All Posts

Machine Learning
小林 泉 0
機械学習のパラメータをオートチューニングしよう(分類編)!

機械学習で予測モデルを作るとき、課題のひとつにパラメータのチューニングがあります。 パラメータとはどういう設定値や制限値で機械学習の予測モデルを作るのかを示すものです。 料理に例えると、チャーハンを作る過程が機械学習のアルゴリズムだとすると、どういう具材をどのくらいの量入れるのかがパラメータです。 お米の品種や卵の有無、豚肉か鶏肉か、調味料の種類や量がパラメータになります。チャーハンの良し悪しはこれらパラメータの良し悪しに左右されます。おいしいチャーハンを食べるためには、具材をベストな組み合わせと量で投入する必要があります。 昼食においしいチャーハンを食べたので、チャーハンでたとえました。 話を戻すと、機械学習の決定木の深さであったり、ニューラルネットワークのニューロン数であったり、パラメータは自分で設定する必要があります。機械学習では複数のパラメータを組み合わせて、ベストなレシピを作らねば良い予測モデルは作れません。   SAS Viyaでは各種機械学習アルゴリズムを提供していますが、各機械学習にそれぞれのパラメータが用意されています。料理に例えると、メニューにチャーハンのみならず餃子、ラーメン、寿司、ステーキ、チーズケーキがあるようなものです。シェフ(≒データサイエンティスト)は全てのベストなレシピ(≒パラメータ)を探索せねばならず、労力がいります。 しかし! SAS Viyaには更に便利な機能として、オートチューニングというものが用意されています。 オートチューニングは最も良いパラメータを短い時間で探索してくれる機能です。料理に例えると、究極のチャーハンレシピをViyaが自動的に作ってくれる機能です。夢のようですね。 オートチューニングでは機械学習のパラメータを変えながら複数の予測モデルを作り、最も良い予測モデルのパラメータを探してくれるというものです。決定木だけでもパラメータは10種類以上あるのですが、それらの最良な値をみつけてくれます。 パラメータチューニングを行う際、最も安易な探索方法は各パラメータの全パターンを試すことです。全パターンを試せば、その中から最も良いものはたしかにみつかります。しかし欠点はパラメータチューニングに長い時間がかかってしまい、現実的な手法ではありません。 SAS Viyaのオートチューニングはより賢いパラメータ探索のアルゴリズムを4種類用意しています。 遺伝的アルゴリズム(Genetic Algorithm, GA):パラメータを遺伝子と見立てて、淘汰、交叉、突然変異を組み換えすことでパラメータを探索する。 ラテン超方格サンプリング(Latin HyperCube Sampling, LHS):層別サンプリングの一種で、各パラメータをn個の区間に分割し、区間からランダムに値を取り出してパラメータを探索する。 ベイズ最適化(Bayesian Optimization):説明変数と予測の間にブラックボックス関数があると仮定し、ブラックボックス関数のパラメータの分布を探索する。 ランダムサンプリング(Random Sampling):ランダムにパラメータの値を選択して探索する。 探索アルゴリズムを詳しく説明していると終わらないので説明を短くまとめました。SAS Viyaではいずれかのアルゴリズムを利用してオートチューニングを実行することができます。   今回はPythonからSAS Viyaを操作して、オートチューニングを試してみたいと思います。 まずはPython SWATをimportし、CAS Sessionを生成してデータをロードします。 # PythonからCASを操作するためのSWATライブラリをインポート import swat   # mysessionという名称のCASセッションを作成 mysession = swat.CAS(host, port, user, password)   #

Work & Life at SAS
Rebecca Allen 0
Move of the Month: Turkish Getup

Everybody GET UP! Want to train the entire body in one exercise?  This is it!  The Turkish Getup is a multi-joint, multi-movement exercise that incorporates transitioning from the ground to standing.  This exercise requires synergy, coordination, and core/shoulder stabilization to increase your functional strength.  It may seem daunting, but it is

Data Visualization | Programming Tips
Warren F. Kuhfeld 0
Advanced ODS Graphics: Examining and processing templates

This post shows a variety of techniques including how to use PROC TEMPLATE and the SOURCE statement, PROC SGPLOT with multiple Y-axis tables, create comparable axes in two side-by-side graphs, create a broken axis, write and use a table template that wraps text, and find and display examples of certain statements in graph templates and fonts in style templates.

Advanced Analytics | Customer Intelligence | Machine Learning
Maarten Oosten 0
Bots, collusion and accountability in pricing

In the recent article, “Price-bots can collude against consumers,” the Economist discusses the consumer effects of prices set by price-bots. The article starts with an example of gasoline pricing strategies on Martha’s Vineyard. With a small number of gas stations on the island, the price-bots can cover all competitor prices frequently

Advanced Analytics
Rick Wicklin 0
The singular value decomposition: A fundamental technique in multivariate data analysis

The singular value decomposition (SVD) could be called the "billion-dollar algorithm" since it provides the mathematical basis for many modern algorithms in data science, including text mining, recommender systems (think Netflix and Amazon), image processing, and classification problems. Although the SVD was mathematically discovered in the late 1800s, computers have

1 … 419 420 421 422 423 … 704