Programming Tips

Strengthen your programming skills with tips and techniques from the experts

Learn SAS | Programming Tips
Rick Wicklin 0
Round to even

In grade school, students learn how to round numbers to the nearest integer. In later years, students learn variations, such as rounding up and rounding down by using the greatest integer function and least integer function, respectively. My sister, who is an engineer, learned a rounding method that rounds half-integers

Programming Tips
Elena Shtern 0
How SAS® Viya® fosters collaboration

When my younger son grabs a book or a toy from his older siblings without permission, his line of defense is always the same: “Sharing is caring!” Our kids' schools teach and reinforce this philosophy. Likewise, our family has rules to ensure peaceful, orderly sharing. Similarly, many organizations value collaboration.

Programming Tips
SAS Japan 0
新しいSAS ViyaのPython向けパッケージ :sasctl

なぜ“sasctl”が必要なのか? オープンソースとの統合性はSAS Viyaの一つの重要な製品理念であり、そのための機能拡張を継続的に行っています。その一環として”sasctl”という新しいパッケージがリリースされました。SAS Viyaでは従来から、PythonからViyaの機能を使用するために”SWAT”パッケージを提供しており、SAS Viyaのインメモリー分析エンジン(CAS)をPythonからシームレスに活用し、データ準備やモデリングをハイパフォーマンスで実行することができるようになっていました。しかし、データ準備やモデル開発は、アナリティクス・ライフサイクル(AI&アナリティクスの実用化に不可欠なプロセス)の一部のパートにすぎません。そこで、開発されたモデルをリポジトリに登録・管理して、最終的に業務に実装するためのPython向けパッケージとして”sasctl”が生まれたのです。 sasctlの概要 sasctlで提供される機能は、大まかに、3つのカテゴリーに分けられます。 また、この3つのカテゴリーは、お互いに依存する関係を持っています。 1.セッション sasctlを使用する前に、まずSAS Viyaのサーバーに接続する必要があります。(この接続は、ViyaマイクロサービスのRESTエンドポイントに対して行われることに注意してください) SAS Viyaのサーバーへの接続は、セッションのオブジェクトを生成することにより行われます。 >>> from sasctl import Session >>> sess = Session(host, username, password) この時点で、sasctlはViya環境を呼び出して認証し、この後のすべての要求に自動的に使用される認証トークンを受け取りました。 ここからは、このセッションを使用してViyaと通信します。 2.タスク タスクは一般的に使用される機能を意味し、可能な限りユーザーフレンドリーになるように設計されています。各タスクは、機能を実現するために、内部的にViya REST APIを複数回呼び出しています。例えば、register_modelタスクではREST APIを呼び出し、下記の処理を実行しています: リポジトリの検索 プロジェクトの検索 プロジェクトの作成 モデルの作成 モデルのインポート ファイルのアップロード その目的としては、ユーザーがPythonを使って、アナリティクス・ライフサイクルで求められるタスクを実行する際に、sasctlの単一のタスクを実行するだけで済むようにすることです。 >>> from sasctl.tasks import register_model >>> register_model(model, 'My Model', project='My Project') 今後も継続的に新しいタスクを追加していきますが、現在のsasctlには下の2つのタスクを含まれています:

Programming Tips
Rick Wicklin 0
What is a geometric mean?

There are several different kinds of means. They all try to find an average value from among a set of numbers. Although the most popular mean is the arithmetic mean, the geometric mean can be useful for problems in statistics, finance, and biology. A common application of the geometric mean

1 19 20 21 22 23 65

Back to Top