Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to analyze the process of R language data Modeling

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces how to carry out R language data modeling process analysis, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Intro

Recently, after sorting out the data analysis process, I found a code I wrote before and shared it with you. This is a project I did when I was in school. At that time, there were some problems due to lack of experience. These problems will be discussed later to avoid stepping in the pit. This sharing will bring some explanations, some areas may not be clear enough, welcome to leave a message for discussion.

In addition to sharing, this is also a review of your previous projects. Or use R language (after all, it is my favorite language). Python will release other projects if there is a need.

This article contains data import, cleaning, visualization, feature engineering, modeling code, you can choose what you need to refer to.

Project background

The data from Online Shopper's Intention contains 12330 pieces of data, 10 counting features and 8 category features. Use 'Revenue' as the tag for modeling. The ultimate goal is to build a model that can predict Revenue based on the data obtained.

Preparation in advance

First you need to download an R language and its comfortable version of R studio. How to download it? paste the words from my previous article directly. Haha.

Install R and Rstudio

If you have used R before, please ignore this paragraph.

It is very easy to install R and download it directly on the official website.

Then download Rstudio, which is equivalent to the open hanging version of R language, the interface is very friendly compared to R, there are many auxiliary functions, download address

# Note that Rstudio is based on R language. You need to download and install R language before you can install it.

After installation, run the following code to import package.

Setwd ("~ / Desktop/STAT5003/Ass") # Select the location where the project is stored, and this is also the location where your data csv is stored. # install.packages ("xxx") if you have not previously installed the following package, use this sentence to pack it first. Then go to load# the following packages are for the EDA partlibrary (GGally) library (ggcorrplot) library (psych) library (ggstatsplot) library (ggplot2) library (grid) # the following packages are for the Model partlibrary (MASS) library (Boruta) # Feature selection with the Boruta algorithmlibrary (caret) library (MLmetrics) library (class) library (neuralnet) library (e1071) library (randomForest) library (keras)

There are many imported packages. For the installation of keras, please refer to my previous article (R language is based on Keras's MLP neural network.

Https://www.yisu.com/article/234031.htm)

Data description

First of all, download this data to your computer, and then import it into R with the following code.

Dataset

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report