is an introduction to using the Python client on the SAS Viya platform. SAS Viya is a high-performance, fault-tolerant analytics architecture that can be deployed on both public and private cloud infrastructures. Although SAS Viya can be used by various SAS applications, it also enables you to access analytic methods from SAS, Python, Lua, and Java, as well as through a REST interface using HTTP or HTTPS. Of course, in this book we focus on the perspective of SAS Viya from Python.
SAS Viya consists of multiple components. The central piece of this ecosystem is SAS Cloud Analytic Services (CAS). CAS is the cloud-based server that all clients communicate with to run analytical methods. The Python client is used to drive the CAS component directly using objects and constructs that are familiar to Python programmers.
We assume that you have some knowledge about Python before you approach the topics in this book. However, the book includes an appendix that covers the features of Python that are used in the CAS Python client. We do not assume any knowledge of CAS itself. However, you must have a CAS server that is set up and is running in order to execute the examples in this book.
The chapters in the first part of the book cover topics from installation of Python to the basics of connecting, loading data, and getting simple analyses from CAS. Depending on your familiarity with Python, after reading the “Ten-Minute Guide to Using CAS from Python,” you might feel comfortable enough to jump to the chapters later in the book that are dedicated to statistical methods. However, the chapters in the middle of the book cover more detailed information about working with CAS such as constructing action calls to CAS and processing the results, error handling, managing your data in CAS, and using object interfaces to CAS actions and CAS data tables. Finally, the last chapter about advanced topics covers features and workflows that you might want to take advantage of when you are more experienced with the Python client.
This book covers topics that are useful to complete beginners as well as to experienced CAS users. Its examples extend from creating connections to CAS to simple statistics and machine learning. The book is also useful as a desktop reference.
Is This Book for You?
If you are using the SAS Viya platform in your work and you want to access analytics from SAS Cloud Analytic Services (CAS) using Python, then this book is a great starting point. You’ll learn about general CAS workflows, as well as the Python client that is used to communicate with CAS.
What Are the Prerequisites for This Book?
Some Python experience is definitely helpful while reading this book. If you do not know Python, there is an appendix that gives a crash course in learning Python. There are also a multitude of resources on the Internet for learning Python. The later chapters in the book cover data analysis and modeling topics. Although the examples provide step-by-step code walk-throughs, some training about these topics beforehand is helpful.
Scope of This Book
This book covers the installation and usage of the Python client for use with CAS. It does not cover the installation, configuration, and maintenance of CAS itself.
What Should You Know about the Examples?
This book includes tutorials for you to follow to gain “hands-on” experience with SAS.
Software Used to Develop the Book's Content
This book was written using version 1.0.0 of the SAS Scripting Wrapper for Analytics Transfer (SWAT) package for Python. SAS Viya 3.1 was used. Various Python resources and packages were used as well. SWAT works with many versions of these packages. The URLs of SWAT and other resources are shown as follows:
SAS Viya www.sas.com/en_us/software/viya.html
SAS Scripting Wrapper for Analytics Transfer (SWAT) – Python client to CAS github.com/sassoftware/python-swat (GitHub repository) sassoftware.github.io/python-swat/ (documentation)
Python www.python.org/
Anaconda – Data Science Python Distribution by Continuum Analytics www.continuum.io/
Pandas – Python Data Analysis Library pandas.pydata.org/
Jupyter – Scientific notebook application jupyter.org/
Example Code and Data
You can access the example code and data for this book by linking to its author page at https://support.sas.com/authors or on GitHub at: https://github.com/sassoftware/sas-viya-the-python-perspective.
We Want to Hear from You
SAS Press books are written by SAS Users for SAS Users. We welcome your participation in their development and your feedback on SAS Press books that you are using. Please visit https://www.sas.com/books to do the following:
● Sign up to review a book
● Recommend a topic
● Request information about how to become a SAS Press author
● Provide feedback on a book
Do you have questions about a SAS Press book that you are reading? Contact the author through [email protected] or https://support.sas.com/author_feedback.
SAS has many resources to help you find answers and expand your knowledge. If you need additional help, see our list of resources: https://www.sas.com/books.
About These Authors
Kevin D. Smith has been a software developer at SAS since 1997. He has been involved in the development of PROC TEMPLATE and other underlying ODS technologies for most of his tenure. He has spoken at numerous SAS Global Forum conferences, as well as at regional and local SAS users groups with the “From Scratch” series of presentations that were created to help users of any level master various ODS technologies. More recently, he has been involved in the creation of the scripting language interfaces to SAS Cloud Analytic Services on the SAS Viya platform.
Xiangxiang Meng, PhD, is a Senior Product Manager at SAS. The current focus of his work is on SAS® Visual Statistics, cognitive computing, the Python interface to SAS Cloud Analytic Services, and other new product initiatives. Previously, Xiangxiang worked on SAS® LASR™ Analytic Server, SAS® In-Memory Statistics for Hadoop, SAS Recommendation Systems, and SAS® Enterprise Miner™. His research interests include decision trees and tree ensemble models, automated and cognitive pipelines for business intelligence and machine learning, and parallelization of machine learning algorithms on distributed data. Xiangxiang received his PhD and MS from the University of Cincinnati.
Learn more about these authors by visiting their author pages, where you can download free book excerpts, access example code and data, read the latest reviews, get updates, and more: