BETH EVERSOLE: Do you have a business problem
or a conundrum or a decision that you're trying to make?
I'm going to talk about how you can
make decisions using SAS Viya.
Specifically, I'll talk about how
you can use Visual Analytics, Visual Statistics, and Visual
Data Mining and Machine Learning, Model Manager,
and Decision Manager, to explore your data,
to build and compare and select the best model,
and to finally make a decision.
I'll use a simple example, having
to do with voter turnout.
I recently heard on the radio that we
were having record voting turnout here
in the United States.
Record turnout, I was so excited.
Yes, record turnout, the radio announcer repeated.
A whopping 49%.
Wait, what?
Did I hear that correctly, 49%?
That is record turnout?
I quickly pulled out an envelope and did some
back-of-the-envelope calculations.
Let me see, carry the 1 and--
that's less than half.
Yes, you heard right, less than half of eligible voters
voted in the US general election in November 2018.
And that was a record turnout for a midterm election.
For convenience and demonstration purposes,
I created a very small data set from 1980 to 2014
with just a few variables.
Variables included state, year, education, success score
per state, percent high school graduates, percent ineligible
felons, voting eligible population, voting age
population, and so on.
I first created a geomap to look at voter turnout by state.
I can see, by the darkness of the color,
that Minnesota is one of the highest states.
I can see that Texas is one of the lower states.
If I look at my home state of Maryland,
I see we fall about in the middle.
So this is 49.3% of the voting eligible population voted
in Maryland from 1980 to 2014.
We can use ranking to look at the top 10 and bottom 10 voter
turnout states.
And we can look at voter turnout by voting eligible population
and as a percentage of voting age population.
One thing we notice here, that jumps right out of this bar
chart, is that the midterm years, such as 1982, '86, '90,
are much lower than the presidential election
years, such as 1980, '84, '88, et cetera.
You see a big discrepancy here.
In fact, I think I want to create a categorical variable
in my data set.
Here I create a categorical variable for election type.
You see, I just used the year and I
can determine if it's a presidential or midterm
election.
Now I can use election type, my new categorical variable,
as an input to my modeling down the road.
So back to my hypothetical situation,
let's say I want to call a friend to whine about low voter
turnout.
I don't want to inadvertently call a friend who did not vote,
because then I'll have to listen to all her lame excuses,
like she was getting a massage or she
had to reorganize her sock drawer, those kinds of things.
So at any rate, I want to figure out
which of my friends most likely voted,
so that I can call that one.
So together, let's use Visual Analytics, Visual Statistics,
Visual Data Mining and Machine Learning to build to models.
And we'll use Model Manager and Decision
Manager to manage those models and make a decision.
My first step is to decide which variables
are pertinent for my modeling effort.
I'll start by making a correlation matrix of most
of my measure variables.
I see that many of my variables are highly
correlated with each other.
So I'm going to eliminate my highly-correlated input
variables, because I know they're
going to make my model volatile and they're duplicative.
Now that I've paired down my input variables,
I can create a model directly from this page.
I press down the Alt-key, so that it
will duplicate on a new page, and I'll
duplicate as a decision tree.
Now I notice that I only have input variables that
are measures.
I want to add my election type categorical input.
And I want to add a partition ID.
Notice that although I have now a categorical input as one
of my inputs, my target is still a number and so this
is a regression decision tree, as opposed
to a classification decision tree.
Now is decision tree the best model I could have used?
I don't know.
I can actually, so easily, create other models
that I'm going to go ahead and create a couple
more models right here, just by duplicating on new page.
Pressing the Alt and this snowman icon
and I can duplicate on new page as a forest model
and as a linear regression model.
Notice that my roles are the same as I had in the decision
tree, because I duplicated my roles, my assessment criterion,
which is the validation average squared error.
These are all the same, because I duplicated this.
So I have the same inputs, the same response,
the same partition, everything.
So now I have three models that I can compare.
Be aware that I could also compare in the Model Studio
pipeline interface, but I can compare models
right here in the interactive interface, so I'll do that.
From my object's pane, under SAS Visual Statistics,
I find my Model Comparison object and I'll drag that in.
I'll select all to include my decision tree, my forest,
and my linear regression.
I see that my forest model is selected here.
And I want to look at both training and validation
assessments over here, because I see
that the validation average square error was
used to determine which was the best model.
Now I'm going to look at a pipeline in Model Studio.
And I could create that pipeline from an individual model,
but I'm going to create it right here from my comparison.
And you see when I click on this snowman, I can create pipeline
and I can add it to a new project.
I see I have a data node, my interactive data prep node.
My interactive forest model was the only model
that came through.
Why is that?
That was the best model based on my model comparison
in the interactive interface.
And I also have a Model Comparison node here.
So let me add a couple more models here in Model Studio.
I can do that simply by right-clicking on my data prep
node.
Add Below, Supervised Learning.
I'll pick a generalized linear model.
And I'll pick a gradient-boosting model.
Now I'll run this to see which is the best.
Let's look at our results.
We see the gradient-boosting model is the champion.
And we see that it was selected using the average squared error
from the validation data.
Recall that model manager lets us register or store
our models in a repository.
We can bring these models in from,
for example, the SAS Visual Analytics interface, the Model
Studio pipeline interface, or the SAS Studio interface,
or we can bring them from outside of Viya.
We can bring them from SAS 9.
We can bring PMML models.
We can bring lots of different models written in other coding
languages into Model Manager.
We can compare our models there and select the champion model
and we can monitor model performance.
We can also publish models.
For example, to the SAS Micro Analytic Service,
to CAS, to Teradata, to Hadoop, et cetera.
In this way, we can let these models score
in an external application or interface.
From the Pipeline Comparison tab, I can register a model.
I check the model, I go to the snowman,
and I register the model.
Once my model is registered, I can
go to the hamburger at the top, I can find Managed Models,
and go to Model Manager.
And I'll see my model registered there.
I'll sort by date modified.
And here I see the model that I just registered,
the gradient-boosting model, pipeline
that started out as a creation from the interactive interface.
If I go to my Projects tab in Model Manager,
I can see my projects and where they're located.
I can select a project.
And I can look at the history of that project, who modified it
and when.
Let's say there's a model I want to publish.
I'm going to pick this forest model
and I'm going to publish that using the snowman
icon in the upper right corner and selecting Publish.
I can publish this to CAS or to Teradata, Hadoop, or MAS,
Micro Analytics Service.
I see I published successfully and I can close.
Model Manager provides lots of information on the models.
If I select a model from my model list,
I can see the code associated with that model, the SAS file,
the JSON files.
I can look at the variables.
What are the input and output variables?
The properties.
I can see the modeler here, who modeled it,
the tool used to create the model.
And I can also look at my versions.
So in our example, we've created five different models
very quickly and easily.
We compared them, selected a champion,
we registered and published models,
and we let Model Manager track our model versions.
Now we're ready to make an actual decision,
to call or not to call my friend.
So I have to decide how likely is my friend to have voted.
And I can do that, easily.
I will set up a flow in Decision Manager.
To get to Decision Manager, I'll go again
to my hamburger, Manage Decisions.
I can add a model from my repository.
I can pick a variable from that model to make a decision on.
I'm going to use my prediction variable and I'm going to say,
if it's greater than 0.6, I'll make my decision based on that.
I can decide what to do if it's a yes.
I can go to a rule set that I've created
and say, follow these rules if I have a yes.
And I can go to the no side and add another rule set.
And now I've made my decision, based
on the predictive likelihood that someone would have voted
and I can decide to call my friend or to do something else.
So I walked you through Visual Analytics, Visual Statistics,
Visual Data Mining and Machine Learning, Model Manager,
and Decision Manager.
A really quick overview to show how I could solve a real world
problem, a question or a decision that I had,
using these tools.
Your decisions may be more complicated.
Your data sets might be much more complicated.
But you can use this same process
to make decisions for your organization or for yourself.
For more information, see the Model Managers user's guide
and documentation, the Decision Manager documentation.
Here are the data sets that I used if you're interested.
I'm Beth Eversole from SAS.
I hope this was helpful.