반응형
반응형
본문 바로가기

공부/R Programming51

Data Science Week 10 Data Science Week 10 Using continuous variable as input variable - Now we take a continuous variable "age" as predictor (input variable) to make prediction - To use 'age' variable for prediction, we convert it into range variable 'age_group', which contains under 20, 20s, 30s, 40s, 50s, over60 summary(adult$age) adult.train$age_group 2021. 5. 3.
Data Science Week 09 Data Science Week 09 Memorization Method Classification and Regression Classification is a task that predicts discrete event (class) - is a e-mail spam or not (binary) - does a patient have breast cancer or not (binary) - predict letter grade a student expected to get for this class (multi-class, A, B, C, D, F) Regressoin is a task that predicts continuous value (score) - expected housing price .. 2021. 5. 3.
pums.sample R library(dplyr) library(tidyr) library(stringr) library(lubridate) load("2020.RData") Q1. str(pums.sample) head(pums.sample) Q2. pums.sample$SEX 2021. 4. 17.
[Week 06] Lectures [Week 06] Lectures tidy data? is ... Gather columns into key-value pairs library(tidyr) wide_df 2021. 4. 9.
[Week 04] Lectures [Week 04] Lectures # Useful functions sample(X, #sample, replace = FALSE, ...) [41 sample split] sample - random-sampling with and without (default) replacement set.seed(2018) x 25) mtcars[mtcars$mpg > 25, ] [42 merge which] Merge Merge(df1, df2, ...) - Join two data frames into one with common variables x 2021. 3. 28.
[Week 03] Lectures [Week 03] Lectures [33 data loading] # Import swimming_pools.csv: pools pools 2021. 3. 28.
Data Science Week 03 - 02 Data Science Week 03 - 02 ## The apply() family - apply() - lapply() - sapply() - vapply() - mapply() - rapply() - tapply() ----------- apply() apply(X, MARGIN, FUN, ... ) - X is matrix or dataframe - MARGIN is a variable defining how the function is applied : -- MARGIN = 1, it applies over rows -- MARGIN = 2, it applies over columns - FUN is the function that you want to apply to the data examp.. 2021. 3. 19.
Data Science Week 03 - 01 Data Science Week 03 # Import swimming_pools.csv : pools pools 2021. 3. 18.
Week 01: Basics of R Week 01: Basics of R print("hello") [1] "hello" a = 10 b = 20 a+b [1] 30 ?print install.package("randomForest") library("package name") or require("package name") Variable is a container to hold data (or information) that we want to work with. Variable can hold - a single value: 10, 10.5, "abc", factor, NA, NULL - multiple values: vector, matrix, list - specially formatted data (values): data.fr.. 2021. 3. 2.

반응형