MACHINE LEARNING RECIPES
DATA CLEANING PYTHON
DATA MUNGING
PANDAS CHEATSHEET
ALL TAGS
# What is rowmeans and colmeans in R?

# What is rowmeans and colmeans in R?

This recipe explains what is rowmeans and colmeans in R

Exploratory Data Analysis is a crucial step before building any machine learning model on a dataset. This also includes gathering statistical inferences from the data. There are a few main terms in statistics which describes the central tendency of the variables i.e. means and medians. R gives us the flexibilty to calculate these measures row-wise and column-wise.

This recipe focuses on using rowMeans() and colMeans() functions.

rowMeans() function calculates the means of of all the rows in the dataset and displays the output

colMeans() function calculates the means of all the columns in the dataset and displays the output

```
# Data manipulation package
library(tidyverse)
# reading a dataset
customer_seg = read.csv('R_77_Mall_Customers.csv')
glimpse(customer_seg)
```

Rows: 200 Columns: 5 $ CustomerID1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 1... $ Gender Male, Male, Female, Female, Female, Female, ... $ Age 19, 21, 20, 23, 31, 22, 35, 23, 64, 30, 67, ... $ Annual.Income..k.. 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 19, ... $ Spending.Score..1.100. 39, 81, 6, 77, 40, 76, 6, 94, 3, 72, 14, 99,...

Dataset description: It is the basic data about the customers going to the supermarket mall. We are interested in all the numeric variables in the dataset.

```
# calculating means of every row apart ignoring the values in the 2nd column as it is categorical
rowMeans(customer_seg[,-2])
```

```
# calculating means of every column apart ignoring the values in the 2nd column as it is categorical in nature
colMeans(customer_seg[,-2])
```

CustomerID100.5Age38.85Annual.Income..k..60.56Spending.Score..1.100.50.2

Machine Learning Project in R-Detect fraudulent click traffic for mobile app ads using R data science programming language.

In this deep learning project, we will predict customer churn using Artificial Neural Networks and learn how to model an ANN in R with the keras deep learning package.

The goal of this data science project is to build a predictive model and find out the sales of each product at a given Big Mart store.

In this machine learning resume parser example we use the popular Spacy NLP python library for OCR and text classification.

Deep Learning Project- Learn to apply deep learning paradigm to forecast univariate time series data.

PySpark Project-Get a handle on using Python with Spark through this hands-on data processing spark python tutorial.

This project analyzes a dataset containing ecommerce product reviews. The goal is to use machine learning models to perform sentiment analysis on product reviews and rank them based on relevance. Reviews play a key role in product recommendation systems.

Data Science Project in R-Predict the sales for each department using historical markdown data from the Walmart dataset containing data of 45 Walmart stores.

In this data science project, you will work with German credit dataset using classification techniques like Decision Tree, Neural Networks etc to classify loan applications using R.

Data Science Project in Python- Build a machine learning algorithm that automatically suggests the right product prices.