DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • A Beginner's Guide to Machine Learning: What Aspiring Data Scientists Should Know
  • The Magic of Apache Spark in Java
  • Audio Analytics: An Important Technology for Autonomous Cars
  • Beyond Code Coverage: A Risk-Driven Revolution in Software Testing With Machine Learning

Trending

  • After 9 Years, Microsoft Fulfills This Windows Feature Request
  • Introduction to Retrieval Augmented Generation (RAG)
  • Code Reviews: Building an AI-Powered GitHub Integration
  • Building Resilient Networks: Limiting the Risk and Scope of Cyber Attacks
  1. DZone
  2. Data Engineering
  3. AI/ML
  4. K-Means Clustering With SAS

K-Means Clustering With SAS

K-means clustering partitions observations into clusters in which each observation belongs to the cluster with the nearest mean.

By 
Jitendra Bafna user avatar
Jitendra Bafna
DZone Core CORE ·
Mar. 15, 17 · Tutorial
Likes (2)
Comment
Save
Tweet
Share
32.7K Views

Join the DZone community and get the full member experience.

Join For Free

PROC FASTCLUS performs disjoint cluster analysis on the basis of distances computed from one or more quantitative variables.

The most-used cluster analysis procedure is PROC FASTCLUS, or k-means clustering. K-means clustering aims to partition n observations into k clusters in which each observation belongs to the cluster with the nearest mean.

K-means clustering also known as unsupervised learning. Unsupervised learning is a type of Machine Learning algorithm used to draw inferences from datasets consisting of input data without labeled responses.

The most common unsupervised learning method is cluster analysis, which is used for exploratory data analysis to find hidden patterns or grouping in data. There is no dependent variable used in unsupervised learning for analysis.

Clustering means the grouping of a particular set of objects based on their characteristics, aggregating them according to their similarities.

PROC FASTCLUS is used in a variety of analytic, business intelligence, reporting, and data management situations.

PROC FASTCLUS <MAXCLUSTERS= n> <RADIUS= t> <options>; 
VAR variables; 
ID variables; 
FREQ variable; 
WEIGHT variable; 
BY variables;

The PROC FASTCLUS statement calls the FASTCLUS procedure.

  • out specifies the output dataset.

  • radius = t specifies the minimum distance from the previous seed to classify an observation as a new seed; by default, t = 0.

  • maxclusters = n specifies the maximum number of clusters permitted; by default, n is 100.

Let's understand k-means clustering with the help of an example. We will perform the k-means on insurance data contains 100 observation and 5 variables (Premium_Paid, Age, Days_to_Renew, Claims_made, Income).Image title

Income and Age variables are used to perform k-means clustering.

proc fastclus data = libref.cluster out = out maxc= 3;
var Income Age;
title 'FASTCLUS ANALYSIS';
RUN;

When you run this code, the output is generated and it shown on the screen. The clusters are grouped on the basis of maximum distance from seed to observations.

Image title

Image title

The R-squared value for the model is 0.89444 (>0.70). Hence, this a good fit model. The distance between the seed and observation of the first cluster distance is 18750, and the last cluster is the maximum value.

Image title

Now, you know about k-means clustering with SAS.

Machine learning clustering SAS (software)

Opinions expressed by DZone contributors are their own.

Related

  • A Beginner's Guide to Machine Learning: What Aspiring Data Scientists Should Know
  • The Magic of Apache Spark in Java
  • Audio Analytics: An Important Technology for Autonomous Cars
  • Beyond Code Coverage: A Risk-Driven Revolution in Software Testing With Machine Learning

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!