## Demo: Automated Machine Learning in SAS Studio (Self-Paced)

In this demonstration, you access and examine the SAS Studio interface. You then load the course data in memory by using a pre-created SAS Studio flow. By running this flow, you establish a CAS session and then you connect your session to the location of pre-existing data files to load them into memory. Any data processing in SAS Viya requires the data to be loaded in memory first. Finally, you create a flow with the Automated Feature Engineering step to generate features from the PVA_Donors data that can be used as inputs to a predictive model.

Examining the SAS Studio Interface

1. From the Windows taskbar, launch Google Chrome. When the browser opens, select SAS Landing from the bookmarks bar. The user ID and password should be prefilled, but if not, sign in as student using the password Metadata0. (Be sure to use an uppercase M in the password.) If prompted, select Yes for assumable groups.

Note: You can also directly select the SAS Studio page from the bookmarks bar, if available.

2. Click the Applications menu button (the three-by-three grid) in the upper left corner, expand ANALYTICS LIFE CYCLE, and select Develop Code and Flows to launch SAS Studio. The SAS Studio Develop Code and Flows window is displayed. The main window of SAS Studio consists of a navigation pane on the left and a work area on the right. The navigation pane provides easy access to your snippets, steps, and libraries, as well as other components. The work area is used to display your data, code, logs, results, and flows.
3. In the left navigation pane, click the Explorer icon (second from the top). Programs and Flows will be run from the VST folder (Files/Home/workshop/VST). Note: The path to the VST folder may change in later versions of SAS Viya.
4. Next, click the Steps icon (third from the top). Steps can be used to create flows which automate data manipulation and analysis tasks.
5. Now click the Libraries icon (second from bottom) to access the default SAS libraries. You see the WORK, SASHELP, and SASUSER libraries, as well as others. Next, you create and access custom caslibs.

Assigning Libraries and Loading Course Data

Next you run the pre-created SAS Studio flow to assign libraries and load course data. A flow consists of one or more objects. Each object is represented by a node in the process flow. The flow shows the relationship between two or more objects such as a SAS program, a task, a query, and so on. You access pre-created flow as follows:

1. In the left navigation pane, click the Explorer icon (second from top). Expand Files > Home > workshop > VST > AssignLibrary.flw and double-click Assign Library flow.

Note: The SAS Program node in this flow executes a SAS program behind the scenes to establish a CAS session, assign libraries, and load the data in memory. A discussion about the underlying code in the flow is beyond the scope of this course.

2. Run the flow by clicking the Run toolbar button.
3. A green check mark on the Assign Library node indicates that the flow has run successfully. Click the Libraries icon (second from bottom) in the left navigation pane. Look for the VST library and expand it to ensure that the PVA_DONORS table along with other data tables are loaded in memory and are accessible via the VST library. With this step completed, one of the important tasks of loading the data into memory has been accomplished. You analyze this PVA_DONORS data set in upcoming lessons. However, to start with, let's move directly into automated machine learning in SAS Viya.

Note: A pre-made flow with steps for all the demonstrations in this course is located in the VST/backup flows folder.

Optional: After initially running AssignLibrary.flw, this flow is used later to re-establish the VST library whenever SAS Studio times out. As an optional alternative approach, the code from this flow can be added to the Autoexec file. Code in the Autoexec file is executed whenever SAS studio is started. This will result in the VST library being established whenever the user logs into SAS studio. To do this, click on Options at the top left side of SAS Studio, then choose Autoexec file. Copy and paste the code from the AssignLibrary flow to the Autoexec window, then click Save. The VST library will now be available whenever you log into SAS Studio.

Automated Machine Learning

1. In the work area, click the plus sign next to the AssignLibrary.flw tab to create a new tab. From the drop-down menu, choose Flow. Alternatively, select Flow from the New menu at the top left of SAS Studio.
2. Click on the Steps icon on the left side of the Navigation Pane. Under SAS Steps tab, expand Data (Input and Output) group, double click on the Table step.
3. In the work area, click on the Table step. At the lower half of the work area, under Table Properties tab, click the file cabinet next to the Library field. Under Libraries on the left, click on the VST library, then select the PVA_DONORS data on the right and click OK.
4. Scroll down through SAS Steps and expand Machine Learning group. Double click on theAutomated Feature Engineering step. The Automated Feature Engineering step explores the variables in the input data and automatically performs feature engineering in a parallel, scalable way.
5. Next, move your mouse towards the edge of the PVA_DONORS node until the pointer becomes a hand icon. Click and drag an arrow from PVA_DONORS node to the box on the left side of the Automated Feature Engineering node (the input port). Now Automated Feature Engineering is connected to the PVA_DONORS data. Click the Arrange nodes button to visually organize the nodes within the flow.
6. Click on the Automated Feature Engineering node. in the lower half of the work area, under the Data tab, find the Target field. Make sure Use a nominal target radio button is selected. Use the plus sign to select a nominal target variable. Scroll down the variable list and click on Response, then choose OK.
7. Under Inputs, ensure that Use all columns except target is selected.
8. Click the Options tab. Keep the settings under Variable Screening, Feature Engineering, and Feature Ranking at their defaults.
9. Click Run to execute the flow. Save the flow to the VST folder as Auto Feature Engineer.flw. When the run is complete, maximize the results window by clicking the three dots on the right side of the work area, choose Open in a browser tab, then choose Results.

Engineered features have been created automatically using appropriate feature transformation and extraction techniques. The idea was to automatically learn a set of features (from potentially noisy, raw data) that can be useful in machine learning tasks without needing manually created, handcrafted engineered features.

In the results window, turn your focus to the Label column. What is so special about this Label column? This is the column that holds the description of the newly generated features.

Note: Other columns in the results window are not discussed here. However, they are covered in detail in other SAS courses.

Going forward, you might want to use these generated features for model building. However, the intention of this demo was to explore the automated machine learning capabilities of the tool.