R on jDataLab
https://www.jdatalab.com/tags/R/
Recent content in R on jDataLabHugo -- gohugo.ioen-usmogonpan@gmail.com (J-W)mogonpan@gmail.com (J-W)Sat, 30 May 2020 01:45:03 -0600Developing R Packages using devtools
https://www.jdatalab.com/data_science_and_data_mining/2020/05/30/R-devtools-package.html
Sat, 30 May 2020 01:45:03 -0600mogonpan@gmail.com (J-W)https://www.jdatalab.com/data_science_and_data_mining/2020/05/30/R-devtools-package.htmlThe relevant commands when using devtools to developing an R packageMake Database Connection & Run SQL in RMarkdown
https://www.jdatalab.com/data_science_and_data_mining/2018/11/03/rmarkdown-database-connection.html
Sat, 03 Nov 2018 01:45:03 -0600mogonpan@gmail.com (J-W)https://www.jdatalab.com/data_science_and_data_mining/2018/11/03/rmarkdown-database-connection.htmlA data scientist has to work with many different types of data storage and there are chances when you need to pull data from enterprise data warehouse into your analysis environment.
We can write SQL queries to retrieve data from database tables and write the data to a local CSV file. Read the local CSV file into R or Python in the analysis environment.
Alternatively, if you work with the R environment, RMarkdown supports database connection.A Beginner Guide to Association Rules Visualization - Minimum Support
https://www.jdatalab.com/data_science_and_data_mining/2018/10/21/association-rule-visualize-1.html
Sun, 21 Oct 2018 01:45:03 -0600mogonpan@gmail.com (J-W)https://www.jdatalab.com/data_science_and_data_mining/2018/10/21/association-rule-visualize-1.htmlThis post shows you how to visualize association rules by using the R packages arules and aulesViz. In order to test the script, you must have already completed the following parts.
Part 1 Transactions Class in arules Part 2 Read Transaction Data Part 3 Generate Itemsets Part 4 Generate Rules The Basket Data In Part 2 Read Transaction Data,
we have read the following five shopping baskets into transactions of the Transactions class.A Beginner Guide to Association Rules Visualization - Quality Measures
https://www.jdatalab.com/data_science_and_data_mining/2018/10/21/association-rule-visualize-2.html
Sun, 21 Oct 2018 01:45:03 -0600mogonpan@gmail.com (J-W)https://www.jdatalab.com/data_science_and_data_mining/2018/10/21/association-rule-visualize-2.htmlThis post shows you how to visualize association rules by using the R packages arules and aulesViz. In order to better understand the script, you may have already completed the following parts.
Part 1 Transactions Class in arules Part 2 Read Transaction Data Part 3 Generate Itemsets Part 4 Generate Rules The Basket Data In Part 2 Read Transaction Data, we have read the following five shopping baskets in a plain text file, into transactions of the Transactions class.A Guide to Association Rules in R - Part 4 Rule Generation in arules
https://www.jdatalab.com/data_science_and_data_mining/2018/10/20/association-rule-generate.html
Sat, 20 Oct 2018 01:45:03 -0600mogonpan@gmail.com (J-W)https://www.jdatalab.com/data_science_and_data_mining/2018/10/20/association-rule-generate.htmlThis is Part 4 to show you how to generate confident association rules by using the R packages arules and aulesViz. In order to test the script, you must have already completed the following parts.
Part 1 Transactions Class in arules Part 2 Read Transaction Data Part 3 Generate Itemsets The Basket Data In [Part 2]( {{site.url}}{{site.baseurl}}{% post_url 2018-10-15-association-rule-read-transactions %} ), we have read the following five shopping baskets into transactions of the Transactions class.A Guide to Association Rules in R - Part 3 Generate Frequent Itemsets in arules
https://www.jdatalab.com/data_science_and_data_mining/2018/10/18/association-rule-generate-itemset.html
Thu, 18 Oct 2018 01:45:03 -0600mogonpan@gmail.com (J-W)https://www.jdatalab.com/data_science_and_data_mining/2018/10/18/association-rule-generate-itemset.htmlThis is Part 3 to show you how to perform association rules mining by using the R packages arules and aulesViz. In order to test the script, you must complete Part 1 and Part 2.
Part 1 Transactions Class in arules Part 2 Read Transaction Data The Basket Data In Part 2 Read Transaction Data ,
we have read the following five shopping basket data into R, of the Transactions class.A Guide to Association Rules in R - Part 2 Read Market Basket Data in arules
https://www.jdatalab.com/data_science_and_data_mining/2018/10/15/association-rule-read-transactions.html
Mon, 15 Oct 2018 01:45:03 -0600mogonpan@gmail.com (J-W)https://www.jdatalab.com/data_science_and_data_mining/2018/10/15/association-rule-read-transactions.htmlThis is a simple guide to show you how to run the function read.transaction to coerce shopping basket data into the required format by the packages arules and aulesViz.
The letter a through s are the name of shopping items available. Assume that we store the sample basket data in a plain text file, namely baskets.
Convert the Sample Data into the Transactions Class The arules package provides the function read.A Guide to Association Rules in R - Part 1 The Transactions Class in arules
https://www.jdatalab.com/data_science_and_data_mining/2018/10/10/association-rule-transactions-class.html
Wed, 10 Oct 2018 01:45:03 -0600mogonpan@gmail.com (J-W)https://www.jdatalab.com/data_science_and_data_mining/2018/10/10/association-rule-transactions-class.htmlThis is a simple guide to show you how to shape raw shopping basket data into the required format before mining association rule in R with the packages arules and aulesViz. The R package tidyverse is used for a fast data wrangling for this purpose.
Association rules reflect regularities of items or elements in a set of items, such as sale items, web link clicks or web page visits. The apriori command in the R package arules mines frequent itemsets, association rules and class association rules using the Apriori algorithm.Measuring Uncertainty by Calculating Shannon Entropy
https://www.jdatalab.com/data_science_and_data_mining/2017/02/22/shannon-entropy.html
Wed, 22 Feb 2017 01:45:03 -0600mogonpan@gmail.com (J-W)https://www.jdatalab.com/data_science_and_data_mining/2017/02/22/shannon-entropy.htmlIs amount of information measurable? Can we quantify the information that is contained in a dataset? For a given probability distribution of a categorical attribute (which will be referred to as class label in the following part), the entropy is a measure of the amount of information that indicates level of uncertainty about which class label will be chosen.
A larger entropy value indicates a higher level of uncertainty or diversity, implying lower purity of the distribution.What is a Database Driver? Access Database in VS Code. R. Python. Java
https://www.jdatalab.com/information_system/2017/02/16/database-driver.html
Thu, 16 Feb 2017 12:45:03 -0600mogonpan@gmail.com (J-W)https://www.jdatalab.com/information_system/2017/02/16/database-driver.htmlIn a computer system, an adaptor program is required for making a connection to another system of different type. Similar to connecting a printer to a computer by using a printer driver, a DBMS (database management system) needs a database driver that enables a database connection in other systems. (Last updated on 2020-11-7)
A database driver is a computer program that implements a protocol (ODBC or JDBC) for a database connection.Linear Regression Analysis
https://www.jdatalab.com/data_science_and_data_mining/2017/02/08/linear-regression.html
Wed, 08 Feb 2017 12:45:03 -0600mogonpan@gmail.com (J-W)https://www.jdatalab.com/data_science_and_data_mining/2017/02/08/linear-regression.htmlPredictive learning is a process where a model is trained from known predictors and the model is used to predict, for a given new observation, either a continuous value or a categorical label. This results in two types of data mining techniques, classification for a categorical label and regression for a continuous value.
Linear regression is not only the first type but also the simplest type of regression techniques. As indicated by the name, linear regression computes a linear model which is line of best fit for a set of data points.Data Binning and Plotting in R
https://www.jdatalab.com/data_science_and_data_mining/2017/01/30/data-binning-plot.html
Mon, 30 Jan 2017 01:45:03 -0600mogonpan@gmail.com (J-W)https://www.jdatalab.com/data_science_and_data_mining/2017/01/30/data-binning-plot.htmlUpdated on 9/28/2019
Data binning is a basic skill that a knowledge worker or data scientist must have. When we want to study patterns collectively rather than individually, individual values need to be categorized into a number of groups beforehand. We can group values by a range of values, by percentiles and by data clustering.
Grouping by a range of values is referred to as data binning or bucketing in data science, i.Outlier Detection by Data Visualization with Boxplot
https://www.jdatalab.com/data_science_and_data_mining/2017/01/27/outlier-boxplot.html
Fri, 27 Jan 2017 01:45:03 -0600mogonpan@gmail.com (J-W)https://www.jdatalab.com/data_science_and_data_mining/2017/01/27/outlier-boxplot.htmlOutliers in a collection of data are the values which are far away from most other points. A boxplot is usually used to visualize a dataset for spotting unusual data points. However, is an outlier abnormal or normal? It needs to be decided by data analysts.
The boxplot displays five descriptive values which are minimum, \(Q_1\), median, \(Q_3\) and maximum.
The First Quartile and Third Quartile Place a sample variable into ascending order.Univariate Graphics in R
https://www.jdatalab.com/data_science_and_data_mining/2017/01/25/univariate-graphics-r.html
Wed, 25 Jan 2017 01:45:03 -0600mogonpan@gmail.com (J-W)https://www.jdatalab.com/data_science_and_data_mining/2017/01/25/univariate-graphics-r.htmlThis post shows how to use some of R basic graphics techniques and plotting features to explore a single numeric variable.
Create a Custom Function univPlots The function univPlots takes a numeric vector and creates 6 plots: scatterplot, dotchart, histogram, density plot, CDF (cumulative distribution function) plot and boxplot.
univPlots <- function (x){ # set up a matrix layout for multiple plots mat <- rbind(1:3, 4:6) layout(mat) # 1 plot(x, main='scatter plot') # 2 hist(x, main="frequency") # 3 boxplot(x, main='boxplot') # 4 dotchart(x, main='dot chart') rug(x) # 5 x.