Book Image

Hands-On Data Science with Anaconda

By : Yuxing Yan, James Yan
Book Image

Hands-On Data Science with Anaconda

By: Yuxing Yan, James Yan

Overview of this book

Anaconda is an open source platform that brings together the best tools for data science professionals with more than 100 popular packages supporting Python, Scala, and R languages. Hands-On Data Science with Anaconda gets you started with Anaconda and demonstrates how you can use it to perform data science operations in the real world. The book begins with setting up the environment for Anaconda platform in order to make it accessible for tools and frameworks such as Jupyter, pandas, matplotlib, Python, R, Julia, and more. You’ll walk through package manager Conda, through which you can automatically manage all packages including cross-language dependencies, and work across Linux, macOS, and Windows. You’ll explore all the essentials of data science and linear algebra to perform data science tasks using packages such as SciPy, contrastive, scikit-learn, Rattle, and Rmixmod. Once you’re accustomed to all this, you’ll start with operations in data science such as cleaning, sorting, and data classification. You’ll move on to learning how to perform tasks such as clustering, regression, prediction, and building machine learning models and optimizing them. In addition to this, you’ll learn how to visualize data using the packages available for Julia, Python, and R.
Table of Contents (15 chapters)

F-test, critical value, and the decision rule

In the previous examples, we saw the F-value for the performance of the whole model. Now, let's look at the F-distribution. Assume that x1 and x2 are two independent random variables with the Chi-Square distribution with df1 and df2 degrees of freedom, respectively. The ratio of x1/df1 divided by x2/df2 would follow an F-distribution:

An R program to draw a graph for the F distribution with (10, 2) degrees of freedom is shown here:

> d1<-4 
> d2<-2 
> n<-100 
> x = seq(0, 5, length = n) 
> plot(x, df(x = x, df1 = d1, df2 = d2),type='l') 

The related plot is shown here:

The following R program shows the critical value for a given α of 0.1 and (1, 2) degrees of freedom:

> alpha<-0.1
> d1<-1
> d2<-1
> qf(1-alpha,df1=d1,df2=d2)
[1] 39.86346

The following Python program...