Posted on

Celebrate the Big Data Problems – #3

How to have our basic statistics (Mean, Median, SD, Var, Cor, Cov) computed using R language?

The dataottam team has come up with blog sharing initiative called “Celebrate the Big Data Problems”. In this series of blogs we will share our big data problems using CPS (Context, Problem, Solutions) Framework.

Context:

In statistics Mean, Median, Standard Deviations, Variance, Correlation, or Covariance are foundations steps. From Data Analyst to Data Scientist they will use the basic statistics. It can be arrived using many languages. But here we will use the language called R.

Mean – The mean is the average of the numbers. And it’s easy to calculate; add up all the numbers, then divide by how many numbers there are. In another words it is the sum divided by the count.

Median – The median is the middle of a sorted list of numbers. To find the median, place the numbers in value order and find the middle.

Standard Deviation – SD is a measure of how spreads out numbers are. And the symbol for SD is sigma, a greek letter.

Variance – The Variance is a measure of how spread out numbers are and it is the average of the squared difrences from mean.

Correlation- The Corereltion is when two sets of data are strongly linked together we say they have a high correlation. Correlation is positive when the values increase together, and it is negative when one value decreases as the other increases.

Covariance – covariance is a measure of how much two random variables change together.

Problem:

How to have our basic statistics Mean, Median, Standard Deviation, Variance, Correlation, and Covariance are computed using R language.

Solutions:

Use the below functions as applies with assumptions of x and y are vectors.

  • mean(x) median(x) sd(x) var(x) cor(x,y) cov(x,y)

Continue Reading …

Posted on

Programming Tip of the Day – Difference between Value Type and Reference Type

Value type -> A variable which holds data in its location.

Reference Type -> A variable which holds a pointer to another location which holds the data.

Examples in C#:

Numeric variables, structures are value types

String, Arrays, and class are reference types

 

Programming Tip of the Day is brought to you by GUVI.  It is a collection of commonly known, yet commonly made mistakes by developers from time to time.

If you want to get programming tips by GUVI on a regular basis, Subscribe to GUVI Blogs by entering your email id in the “FOLLOW BLOG BY EMAIL” section.

Posted on

Programming Tip of the Day – Always close what you open

If you open connection to a database, don’t forget to close it.

If you open a stream to Reading or writing a File, don’t forget to close it.

Moral: Always close what you open unless you explicitly need it.

Programming Tip of the Day is brought to you by GUVI.  It is a collection of commonly known, yet commonly made mistakes by developers from time to time.

If you want to get programming tips by GUVI on a regular basis, Subscribe to GUVI Blogs by entering your email id in the “FOLLOW BLOG BY EMAIL” section.

Posted on

Programming Tip of the Day – Common Exceptions

Null Reference

C# – Object Reference not set to an instance of an object

JAVA – java.lang.nullpointerexception

– WOW, most favorite and common exception in the world.  Easy to avoid, just do a NULL Check before working on the variable or object.

C# – Index was out of the bounds of an array

JAVA – Array out of bounds exception 

– Probably the second most common exception in the world, again just do a simple check of Array Length and Current Index before working on the actual array item.

We at GUVI believe it is often the most basic of things that matter most.  Once you start getting your basics right, you can really go from level to level quite easily.  There is always more to learn, but the foundation is very important for future learnings.

 

Posted on

Programming tip of the day – 3 Step Process

Follow this 3 step process in each of your code piece!!

3 steps
3 steps

1.  Make the code work (Working code please)

2.  Make the code right and better (Refactor)

3.  Make the code fast (Optimize)

This is a good way to improve your programming skills.  If you start doing this way, sooner or later, all 3 steps will get integrated for you to provide a more beautiful flowing experience.

 

Subscribe to GUVI Blogs to get regular updates about all the latest blog posts and tips!!!

Posted on

Programming tip of the day – DRY principle

Hello Programmers,

Day in and Day out, Rajesh was writing code.  He was hard working, so he wrote code all the time.  But whenever his manager asks him to change some functionality, he takes a long time.  Manager becomes frustrated because he was not getting the output fast enough.  As days passed by, outputs became that much longer and the quality also reduced.  Rajesh was also frustrated.  He was always hard working, but had to work more and more harder as days passed by even to make small changes.  What was the reason?  Rajesh’s friend Vaibav came to help.  He found that Rajesh was not reusing the code that he wrote earlier, thereby duplicating code across the project.  Over a period of time, maintenance became difficult for Rajesh.  Then Vaibav suggested “Rajesh, always follow the DRY principle“.  Rajesh didn’t know what it was.  Vaibav suggested “Don’t Repeat Yourself 🙂 Always try to reuse code you or someone wrote earlier, because if you don’t, it is a waste of time for everyone”

DRY
Image: Courtesy deepubalan.com

 

MORAL: DON’T REPEAT YOURSELF.

Posted on

Quotes for real programmers !!

Welcome to GUVI Blogs from Team GUVI.  Today, we are bringing you some handmade quotes that can help motivate a programmer or two.  We always believe that programmers also need a lot of motivation and inspiration to achieve greatness in their programming careers.  So here you go on some of our thoughts. 1440_Programmer Table

  • “Programming is a rhythm game, the more you are in rhythm, the better output you would produce”
  • “A refactor a day keeps technical debt away”
  • “A tired programmer is a stupid programmer”
  • “A good programmer is one who can think of many different solutions to a coding problem and applies the best solution to that problem”
  • “Code is like an art, the more artistic approach you take to build it, the more beautiful it will be” Continue reading Quotes for real programmers !!