SAS Viya. Kevin D. Smith

Чтение книги онлайн.

Читать онлайн книгу SAS Viya - Kevin D. Smith страница 21

Автор:
Жанр:
Серия:
Издательство:
SAS Viya - Kevin D. Smith

Скачать книгу

Create a new DataFrame with only columns between

      # actionset and label.

      In [58]: asinfo = asinfo.ix[:, 'actionset':'label']

      In [59]: asinfo

       Out[59]:

      Action set information

      actionset label

      0 access

      1 aggregation

      2 astore

      3 autotune

      4 boolRule

      5 cardinality

      6 clustering

      7 decisionTree

      … … …

      41 svm

      42 textMining

      43 textParse

      44 transpose

      45 varReduce

      46 casfors Simple forecast service

      47 tkcsestst Session Tests

      48 cmpcas

      59 tkovrd Forecast override

      50 qlimreg QLIMREG CAS Action Library

      51 panel Panel Data

      52 mdchoice MDCHOICE CAS Action Library

      53 copula CAS Copula Simulation Action Library

      54 optimization Optimization

      55 localsearch Local Search Optimization

      [56 rows x 2 columns]

      Depending on your installation and licensing, the list varies from system to system. One very useful action set that should be automatically available on all systems is the simple action set. This action set contains actions for simple statistics such as summary statistics (max, min, mean, and so on), histograms, correlations, and frequencies. To load an action set, use the loadactionset action:

      In [60]: conn.loadactionset('simple')

      NOTE: Added action set 'simple'.

       Out[60]:

      [actionset]

      'simple

      + Elapsed: 0.0175s, user: 0.017s, mem: 0.255mb

      As you can see, this action returns a CASResults object as described in the previous section. It contains a single key called actionset that contains the name of the action set that was loaded. Typically, you do not need this return value, but it can be used to verify that the action set has been loaded. If you attempt to load an action set that cannot be loaded for some reason (such as incorrect name, no license, or no authorization), the CASResults object is empty.

      Now that we have loaded the simple action set, we can get help on it using the usual Python methods.

      In [61]: conn.simple?

      Type: Simple

      String form: <swat.cas.actions.Simple object at 0x7f3cdf7c07f0>

      File: swat/cas/actions.py

      Docstring:

      Analytics

      Actions

      -------

      simple.correlation : Generates a matrix of Pearson product-moment

      correlation coefficients

      simple.crosstab : Performs one-way or two-way tabulations

      simple.distinct : Computes the distinct number of values of the

      variables in the variable list

      simple.freq : Generates a frequency distribution for one or

      more variables

      simple.groupby : Builds BY groups in terms of the variable value

      combinations given the variables in the variable

      list

      simple.mdsummary : Calculates multidimensional summaries of numeric

      variables

      simple.numrows : Shows the number of rows in a Cloud Analytic

      Services table

      simple.paracoord : Generates a parallel coordinates plot of the

      variables in the variable list

      simple.regression : Performs a linear regression up to 3rd-order

      polynomials

      simple.summary : Generates descriptive statistics of numeric

      variables such as the sample mean, sample

      variance, sample size, sum of squares, and so on

      simple.topk : Returns the top-K and bottom-K distinct values of

      each variable included in the variable list based

      on a user-specified ranking order

      Once an action set has been loaded, it cannot be unloaded. The overhead for keeping an action set loaded is minimal, so this issue doesn’t make a significant difference.

      That is really all there is to loading action sets. We still do not have data in our system, so we cannot use any of the simple statistics actions yet. Let’s review some final details about options and dealing with errors in the next section, then the following chapter gets into the ways of loading data and using the analytical actions on those data sets.

      We have covered the overall workings of connecting to a CAS host, running CAS actions, working with the results of CAS actions, and loading CAS action sets. However, there are some details that we haven’t covered. Although these items aren’t necessary for using SWAT and CAS, they can be quite useful to have in your tool belt.

      Even though we have already covered

Скачать книгу