Skip to main content

Posts

Showing posts from September, 2020

“Gapminder” Exploratory Data Analysis using R for Data Science

M ain focus is to investigate the dataset Gapminder and interact with it. To illustrate the basic use of EDA in the dplyr,ggplot2 package, I use a “gapminder” datasets. This data is a data.frame created for the purpose of predicting sales volume. Using the dplyr package to perform data transformation and manipulation operations.  Using the ggplot2 package to visually analyze our data. Load Packages #install.packages("gapminder") library(gapminder) library(dplyr) library(ggplot2) The variables are explained as follows: Country — factor with 142 levels Continent — Factor with 5 levels Year — ranges from 1952 to 2007 in increments of 5 years lifeExp — life expectancy at birth, in years pop — population dgoPercap — GDP per capita head(gapminder_unfiltered,5) #Unfiltered data tail(gapminder_unfiltered,5) Display name of Variables : names(gapminder_unfiltered) Data Cleaning : Finding the missing values as we can see this data has no missing values str(gapminder_unfiltered) summary

RegEx in R for Data Science

The ‘regex’ family of languages and commands is used for manipulating text strings. More specifically, regular expressions are typically used for finding specific patterns of characters and replacing them with others. Finding Regex Matches in String Vectors The grep function takes your regex as the first argument, and the input vector as the second argument. If you pass value=FALSE or omit the value parameter then grep returns a new vector with the indexes of the elements in the input vector that could be (partially) matched by the regular expression. If you pass value=TRUE, then grep returns a vector with copies of the actual elements in the input vector that could be (partially) matched. > grep("a+", c("abc", "def", "cba a", "aa"), perl=TRUE, value=FALSE) [1] 1 3 4 > grep("a+", c("abc", "def", "cba a", "aa"), perl=TRUE, value=TRUE) [1] "abc" "cba a"

Data Cleaning in R for Data Science

Data Cleaning in R for Data Science : Removing duplicate values Removing null values Changing column names to readable, understandable, formatted names Removing commas from numeric values i.e. (1,000,657 to 1000657) Converting data types into their appropriate types for analysis The Experiment : The experiment conducted here is retrieved from UCI Machine Learning Repository where a group of 30 volunteers (age bracket of 19–48 years) performed six activities (WALKING, WALKING_UPSTAIRS, WALKING_DOWNSTAIRS, SITTING, STANDING, LAYING) wearing a Samsung Galaxy S smartphone. The data collected from the embedded accelerometers was divided into testing and trained data. Step 1: Retrieving Data from URL The first step required is to obtain the data. Often, to avoid the headache of manually downloading thousands of files, they are downloaded using small code snippets. Since this was a zipped folder . Data Reference : http://archive.ics.uci.edu/ml/datasets/Human+Activity+Recognition+Using+Smartp

Java Objects & Classes

  Java Objects & Classes : J ava is an Object-Oriented Language. As a language that has the Object-Oriented feature, Java supports the following fundamental concepts − Polymorphism Inheritance Encapsulation Abstraction Classes Objects Instance Method Message Passing Objects in JAVA : Everything in Java is associated with classes and objects, along with its attributes and methods . For example : in real life, a car is an object. The car has attributes, such as weight and color, and methods , such as drive and brake. A Class is like an object constructor, or a “blueprint” for creating objects. Classes in Java A class is a blueprint from which individual objects are created. public class Dog {  String breed;  int age;  String color;  void barking() { …. }  void hungry() { …. }  void sleeping() { …. } } Constructors One of the most important sub topic would be constructors. Every class has a constructor. If we do not explicitly write a constructor for a class, the Java compiler build

JAVA Basics : Introduction

J ava is a high-level programming language originally developed by Sun Microsystems and released in 1995. Java runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX. This tutorial gives a complete understanding of Java. This reference will take you through simple and practical approaches while learning Java Programming language.                                               Why to Learn java Programming? Java is a MUST for students and working professionals to become a great Software Engineer specially when they are working in Software Development Domain. I will list down some of the key advantages of learning Java Programming: Object Oriented  − In Java, everything is an Object. Java can be easily extended since it is based on the Object model. Platform Independent  − Unlike many other programming languages including C and C++, when Java is compiled, it is not compiled into platform specific machine, rather into platform independent byte code. This