0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Machine Learning Server for Windowsことはじめ

Last updated at Posted at 2019-07-17

はじめに

Machine Learning ServerはMicrosoftが用意している機械学習のためのサーバ群で、
本来はSQL Serverの補助のためのものなようです。
ただし、単体でも普通に使用できるようなので使ってみます。

なお、今回はMSDN Subscriptionの特典を用いてインストールと実行を行います。
開発者用のライセンスがない方や、本番環境で使用する場合にはフローが異なりますのでご注意ください。

公式サイトを参考に進めます。

インストール

https://my.visialstudio.com からダウンロードしてインストール。

初期設定

起動

%インストールフォルダ%\PYTHON_SERVER\python.exe をダブルクリックして起動。

コマンドが打てるので、以下のコードを1行ずつ実行する。

import os
import revoscalepy 
sample_data_path = revoscalepy.RxOptions.get_option("sampleDataDir")
ds = revoscalepy.RxXdfData(os.path.join(sample_data_path, "AirlineDemoSmall.xdf"))
summary = revoscalepy.rx_summary("ArrDelay+DayOfWeek", ds)  
print(summary)

すると、以下のような表示がされるはずです。

Summary Statistics Results for: ArrDelay+DayOfWeek
File name: ... AirlineDemoSmall.xdf
Number of valid observations: 600000.0

        Name       Mean     StdDev   Min     Max  ValidObs  MissingObs
0  ArrDelay  11.317935  40.688536 -86.0  1490.0  582628.0     17372.0

Category Counts for DayOfWeek
Number of categories: 7

            Counts
DayOfWeek         
1          97975.0
2          77725.0
3          78875.0
4          81304.0
5          82987.0
6          86159.0
7          94975.0

次に、コマンドプロンプトを起動し、以下を実行します。

> az ml admin --help

正常に動作するようなら、以下のような表示がされます。

Group
    az ml admin: Configure Machine Learning Server.
        Perform administration tasks to configure nodes, set up the system, and run diagnostic and
        capacity tests for Machine Learning Server. To get started run 'az ml admin bootstrap' for a
        convenient all in one command which prepares a one-box installation and runs basic
        diagnostics operations to assess the general health of the configuration.  To reset the
        machine back to the default install state run 'az ml admin node reset'.

Subgroups:
    capacity        : Evaluate the capacity of your configuration.
    compute-node-uri: Manage list of compute nodes accepting requests.
    credentials     : Encrypt connection and password secrets.
    diagnostic      : Run diagnostic tests of the configuration or of your code/service.
    node            : Commands such as setup, reset, list, stop, and start (web or compute) nodes.
    password        : Set a local 'admin' password.
    port            : Manage ports assigned to Machine Learning Server.

Commands:
    bootstrap       : Convenience all in one command to bootstrap configure a one-box configuration.

az: error argument _command_package: invalid choice: ml が発生した場合

コマンドラインツールの再インストールを参考に進めてください。

Webサーバーの有効化

以下のコマンドを打ち込んで、有効化します。
途中でパスワードを聞かれるので好きなパスワードを設定します。

> az ml admin bootstrap
Admin password:
Confirm admin password:

Visual Studioからの接続

ファイル -> 新規からPythonアプリケーションを作成します。

image.png

作成後、デフォルトのPython環境はVisualStudioのデフォルトなので変更します。

image.png

Python環境を変更するために、「Python環境」を右クリックし、「環境を追加」を選択します。

image.png

「既存の環境」タブから、下記のように設定を行います。

image.png

あとは、pythonのコードを書いて実行します。
エラーがなく起動できれば、セットアップは完了です。

image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?