• Home
  • About Us
  • Contact Us
  • DMCA
  • Sitemap
  • Privacy Policy
Thursday, March 30, 2023
Insta Citizen
No Result
View All Result
  • Home
  • Technology
  • Computers
  • Gadgets
  • Software
  • Solar Energy
  • Artificial Intelligence
  • Home
  • Technology
  • Computers
  • Gadgets
  • Software
  • Solar Energy
  • Artificial Intelligence
No Result
View All Result
Insta Citizen
No Result
View All Result
Home Artificial Intelligence

CAS-Motion! Saving Frequency Tables – Half 2

Insta Citizen by Insta Citizen
December 12, 2022
in Artificial Intelligence
0
CAS-Motion! Saving Frequency Tables – Half 2
0
SHARES
0
VIEWS
Share on FacebookShare on Twitter


Welcome again to my SAS Customers weblog collection CAS Motion! – a collection on fundamentals. In my earlier submit CAS-Motion! Easy Frequency Tables – Half 1, I reviewed the way to use the easy.freq CAS motion to generate frequency distributions for a number of columns utilizing the distributed CAS server. On this submit I’ll present you the way to save the outcomes of the freq motion as a SAS information set or a distributed CAS desk.

On this instance, I’ll use the CAS language (CASL) to execute the freq CAS motion. Bear in mind, as an alternative of utilizing CASL, I may execute the identical motion with Python, R and extra with some slight modifications to the syntax for the particular language. Consult with the documentation for syntax in different languages.

Load the demonstration information into reminiscence

I will begin by executing the loadTable motion to load the WARRANTY_CLAIMS_0117.sashdat file from the Samples caslib into reminiscence. By default the Samples caslib needs to be out there in your SAS Viya surroundings. I will load the desk to the Casuser caslib after which I will clear up the CAS desk by renaming and dropping columns to make the desk simpler to make use of. For extra data the way to rename columns take a look at my earlier submit. Lastly I will execute the fetch motion to preview 5 rows.

proc cas;
   * Specify the enter/output CAS desk *;
   casTbl = {title = "WARRANTY_CLAIMS", caslib = "casuser"};
 
   * Load the CAS desk into reminiscence *;
    desk.loadtable / 
        path = "WARRANTY_CLAIMS_0117.sashdat", caslib = "samples",
        casOut = casTbl + {change=TRUE};
 
* Rename columns with the labels. Areas changed with underscores *;
 
   *Retailer the outcomes of the columnInfo motion in a dictionary *;
   desk.columnInfo consequence=cr / desk = casTbl;
 
   * Loop over the columnInfo consequence desk and create an inventory of dictionaries *;
   listElementCounter = 0;
   do columnMetadata over cr.ColumnInfo;
	listElementCounter = listElementCounter + 1;
	convertColLabel = tranwrd(columnMetadata['Label'],' ','_');
	renameColumns[listElementCounter] = {title = columnMetadata['Column'], rename = convertColLabel, label=""};
   finish;
 
   * Rename columns *;
   keepColumns = {'Campaign_Type', 'Platform','Trim_Level','Make','Model_Year','Engine_Model',
                  'Vehicle_Assembly_Plant','Claim_Repair_Start_Date', 'Claim_Repair_End_Date'};
   desk.alterTable / 
	title = casTbl['Name'], caslib = casTbl['caslib'], 
	columns=renameColumns,
	hold = keepColumns;
 
   * Preview CAS desk *;
   desk.fetch / desk = casTbl, to = 5;
give up;

The outcomes above present a preview of the warranty_claims CAS desk.

One Method Frequency for A number of Columns

Subsequent, I will execute the freq motion to generate a frequency distribution for a number of columns.

proc cas;
   casTbl = {title = "WARRANTY_CLAIMS", caslib = "casuser"};
   colNames = {'Model_Year', 
               'Vehicle_Assembly_Plant', 
	       {title = 'Claim_Repair_Start_Date', format = 'yyq.'}
   };
   easy.freq / desk= casTbl, inputs = colNames;
give up;

The freq CAS motion returns the frequency distribution of every column in a single consequence. Whereas that is nice,  what if you wish to create a visualization with the info? Or proceed processing the summarized information? How do you save this as a desk? Properly, you have got a couple of choices.

Save the outcomes as a SAS information set

First, it can save you the outcomes of a CAS motion as a SAS information set. The thought right here is the CAS motion will course of the info within the distributed CAS server, after which the CAS server returns smaller, summarized outcomes to the consumer (SAS Studio). The summarized outcomes can then be saved as a SAS information set.

To avoid wasting the outcomes of a CAS motion merely add the consequence possibility after the motion with a variable title. The outcomes of an motion return a dictionary to the consumer and retailer it within the specified variable. For instance, to avoid wasting the outcomes of the freq motion as a SAS information set full the next steps:

  1. Execute the identical CASL code from above, however this time specify the consequence possibility with a variable title to retailer the outcomes of the freq motion. Right here i will save the leads to the variable freq_cr.
  2. Use the DESCRIBE assertion to view the construction and information sort of the CASL variable freq_cr within the log (not required).
  3. Use the SAVERESULT assertion to avoid wasting the CAS motion consequence desk from the dictionary freq_cr as a SAS information set named warranty_freq. To do that specify the important thing Frequency that’s saved within the dictionary freq_cr to acquire the consequence desk.
proc cas;
   * Reference the CAS desk *;
   casTbl = {title = "WARRANTY_CLAIMS", caslib = "casuser"};
 
   * Specify the columns to investigate *;
   colNames = {'Model_Year', 
               'Vehicle_Assembly_Plant', 
               {title = 'Claim_Repair_Start_Date', format = 'yyq.'}
   };
   * 1. Analyze the CAS desk and retailer the outcomes *;
   easy.freq consequence = freq_cr / desk= casTbl, inputs = colNames;
 
   * 2. View the dictionary within the log *;
   describe freq_cr;
 
  * 3. Save the consequence desk as a SAS information set *;
   saveresult freq_cr['Frequency'] dataout=work.warranty_freq;
give up;

SAS Log

Within the log, the outcomes of the DESCRIBE assertion reveals the variable freq_cr is a dictionary with one entry. It comprises the important thing Frequency and the worth is a consequence desk. The desk comprises 22 rows and 6 columns. The NOTE within the log reveals the SAVERESULT assertion saved the consequence desk from the dictionary as a SAS information set named warranty_freq within the work library.

As soon as the summarized outcomes are saved in a SAS library, use your conventional SAS programming information to course of the SAS desk. For instance, now I can visualize the summarized information utilizing the SGPLOT process.

* Plot the SAS information set *;
title justify=left peak=16pt "Whole Guarantee Claims by 12 months";
proc sgplot information=work.warranty_freq noborder;
	the place Column = 'Model_Year';
	vbar Charvar / 
		response = Frequency
		nooutline;
	xaxis show=(nolabel);
	label Frequency = 'Whole Claims';
	format Frequency comma16.;
give up;

Save the Outcomes as a CAS Desk

As a substitute of saving the summarized outcomes as a SAS information set, you may create a brand new CAS desk on the CAS server. To try this all you want is so as to add the casOut parameter within the motion. Right here I will save the outcomes of the freq CAS motion to a CAS desk named warranty_freq within the Casuser caslib, and I’ll give the desk a descriptive label.

proc cas;
   * Reference the CAS desk *;
   casTbl = {title = "WARRANTY_CLAIMS", caslib = "casuser"};
 
   * Specify the columns to investigate *;
   colNames = {'Model_Year', 
               'Vehicle_Assembly_Plant', 
               {title = 'Claim_Repair_Start_Date', format = 'yyq.'}
   };
 
   * Analyze the CAS desk and create a brand new CAS desk *;
   easy.freq / 
	desk= casTbl, 
	inputs = colNames,
	casOut = {
		title = 'warranty_freq',
		caslib = 'casuser',
		label = 'Frequency evaluation by yr, meeting plant and restore date by quarter'
	};
give up;

The outcomes above present the freq motion returned details about the newly created CAS desk. After getting a CAS desk within the distributed CAS server you may proceed working with it utilizing CAS, or you may visualize the info like we did earlier than utilizing SGPLOT. The important thing idea right here is the SGPLOT process doesn’t visualize information on the CAS server. The SGPLOT process returns the complete CAS desk again to SAS (compute server) as a SAS information set, then the visualization happens on the consumer. This implies if the CAS desk is massive, an error or sluggish processing may happen. Nonetheless, in our situation we created a smaller summarized CAS desk, so sending 22 rows again to the consumer (compute server) is not going to be a problem.

* Make a library reference to a Caslib *;
libname casuser cas caslib='casuser';
 
 
* Plot the SAS information set *;
title justify=left peak=16pt "Whole Guarantee Claims by 12 months";
proc sgplot information=casuser.warranty_freq noborder;
	the place _Column_ = 'Model_Year';
	vbar _Charvar_ / 
		response = _Frequency_
		nooutline;
	xaxis show=(nolabel);
	label _Frequency_ = 'Whole Claims';
	format _Frequency_ comma16.;
give up;

Abstract

Utilizing the freq CAS motion allows you to generate a frequency distribution for a number of columns and allows you to save the outcomes as a SAS information set or a CAS desk. They keys to this course of are:

  • CAS actions execute on the distributed CAS server and return summarized outcomes again to the consumer as a dictionary. You may retailer the dictionary utilizing the consequence possibility.
  • Utilizing dictionary manipulation strategies and the SAVERESULT assertion it can save you the summarized consequence desk from the dictionary as a SAS information set. After getting the SAS information set you should utilize your entire acquainted SAS programming information on the normal compute server.
  • Utilizing the casOut parameter in a CAS motion allows you to save the summarized leads to the distributed CAS server.
  • The SGPLOT process doesn’t execute in CAS. In the event you specify a CAS desk within the SGPLOT process, the complete CAS desk will probably be despatched again to SAS compute server for processing. This may trigger an error or sluggish processing on massive tables.
  • Finest follow is to summarize massive information within the CAS server, after which work with the summarized outcomes on the compute server.

Further sources

freq motion
DESCRIBE assertion
SAVERESULT assertion
Plotting a Cloud Analytic Companies (CAS) In-Reminiscence Desk
SAS® Cloud Analytic Companies: CASL Programmer’s Information 
SAS® Cloud Analytic Companies: Fundamentals
CAS Motion! – a collection on fundamentals
Getting Began with Python Integration to SAS® Viya® – Index

 



Source_link

READ ALSO

A New AI Analysis Introduces Cluster-Department-Prepare-Merge (CBTM): A Easy However Efficient Methodology For Scaling Knowledgeable Language Fashions With Unsupervised Area Discovery

Bacterial injection system delivers proteins in mice and human cells | MIT Information

Related Posts

A New AI Analysis Introduces Cluster-Department-Prepare-Merge (CBTM): A Easy However Efficient Methodology For Scaling Knowledgeable Language Fashions With Unsupervised Area Discovery
Artificial Intelligence

A New AI Analysis Introduces Cluster-Department-Prepare-Merge (CBTM): A Easy However Efficient Methodology For Scaling Knowledgeable Language Fashions With Unsupervised Area Discovery

March 30, 2023
Bacterial injection system delivers proteins in mice and human cells | MIT Information
Artificial Intelligence

Bacterial injection system delivers proteins in mice and human cells | MIT Information

March 30, 2023
A Suggestion System For Educational Analysis (And Different Information Sorts)! | by Benjamin McCloskey | Mar, 2023
Artificial Intelligence

A Suggestion System For Educational Analysis (And Different Information Sorts)! | by Benjamin McCloskey | Mar, 2023

March 30, 2023
HAYAT HOLDING makes use of Amazon SageMaker to extend product high quality and optimize manufacturing output, saving $300,000 yearly
Artificial Intelligence

HAYAT HOLDING makes use of Amazon SageMaker to extend product high quality and optimize manufacturing output, saving $300,000 yearly

March 29, 2023
A system for producing 3D level clouds from advanced prompts
Artificial Intelligence

A system for producing 3D level clouds from advanced prompts

March 29, 2023
Detección y prevención, el mecanismo para reducir los riesgos en el sector gobierno y la banca
Artificial Intelligence

Detección y prevención, el mecanismo para reducir los riesgos en el sector gobierno y la banca

March 29, 2023
Next Post
Utilizing synthetic intelligence to identify breast most cancers

Utilizing synthetic intelligence to identify breast most cancers

POPULAR NEWS

AMD Zen 4 Ryzen 7000 Specs, Launch Date, Benchmarks, Value Listings

October 1, 2022
Only5mins! – Europe’s hottest warmth pump markets – pv journal Worldwide

Only5mins! – Europe’s hottest warmth pump markets – pv journal Worldwide

February 10, 2023
XR-based metaverse platform for multi-user collaborations

XR-based metaverse platform for multi-user collaborations

October 21, 2022
Magento IOS App Builder – Webkul Weblog

Magento IOS App Builder – Webkul Weblog

September 29, 2022
Migrate from Magento 1 to Magento 2 for Improved Efficiency

Migrate from Magento 1 to Magento 2 for Improved Efficiency

February 6, 2023

EDITOR'S PICK

4 Methods to Get Flip to DND on Any Android Cellphone

4 Methods to Get Flip to DND on Any Android Cellphone

January 18, 2023
Second within the Solar: Folks Energy Photo voltaic Cooperative

Second within the Solar: Folks Energy Photo voltaic Cooperative

September 28, 2022
Companions Kind JV for Photo voltaic Metal Fabrication

Companions Kind JV for Photo voltaic Metal Fabrication

February 12, 2023
In 2023 You Can Order Your Raspberry Pi And Meet It Too

In 2023 You Can Order Your Raspberry Pi And Meet It Too

December 12, 2022

Insta Citizen

Welcome to Insta Citizen The goal of Insta Citizen is to give you the absolute best news sources for any topic! Our topics are carefully curated and constantly updated as we know the web moves fast so we try to as well.

Categories

  • Artificial Intelligence
  • Computers
  • Gadgets
  • Software
  • Solar Energy
  • Technology

Recent Posts

  • Insta360 Movement: A Characteristic-packed Telephone Gimbal With 12 Hours Of Battery Life
  • iOS 16.4: What’s New on Your iPhone
  • Professionals and Cons of Hybrid App Improvement
  • Subsequent Degree Racing F-GT Simulator Cockpit Evaluation
  • Home
  • About Us
  • Contact Us
  • DMCA
  • Sitemap
  • Privacy Policy

Copyright © 2022 Instacitizen.com | All Rights Reserved.

No Result
View All Result
  • Home
  • Technology
  • Computers
  • Gadgets
  • Software
  • Solar Energy
  • Artificial Intelligence

Copyright © 2022 Instacitizen.com | All Rights Reserved.

What Are Cookies
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
SAVE & ACCEPT