Posts

Showing posts from August, 2024

KNN SUPERSTORE DATASET

Image
CODE # PREPARING DATASET library(tidyverse) library(rio) library(janitor) # Load data and filter for Graduation only, but retain other classes for a balanced dataset DataStore <- import("C:/Users/aishw/Downloads/superstore_data.csv") %>%   clean_names("upper_camel") %>%   select(NumWebVisitsMonth, NumWebPurchases, Education)  # Ensure at least one instance of each education level is included DataStore <- DataStore %>%    filter(Education %in% c("Graduation", "Basic", "Master", "PhD")) # Keep more classes for analysis head(DataStore) OUTPUT EXPLANATION The head(DataStore) function in R is used to display the first few rows of a data frame. It provides a quick overview of the data structure, column names, and sample values. In the context of your code, DataStore is a data frame containing information about the number of web visits, number of web purchases, and education level for a set of individuals. The head(D...