Create a new dataframe

Assignment Help Python Programming
Reference no: EM132900933

Big Data Analytics Assessment

Overview

Write Python code (especially PySpark where possible) to implement the tasks below (Please explain your code in detail in your report). Where appropriate, the output of code execution should be presented that relates to your answer to the tasks into your report, as the evidence of working program (e.g., screenshots). Output included without supporting explanation or interpretation will not receive credit.

Where the tasks involve big data analytics with machine learning, you may need to formulate technical solution step by step, e.g., choose appropriate machine learning models / algorithms, justifying appropriateness of models/algorithms/techniques used, applying them in the context of the given task, and practising data visualisation techniques where appropriate. Test your solution and conduct experiments where appropriate. Evaluate the performance of implemented solution and analyse results where appropriate. Delve into deep technical explanations of the results and suggest possible improvement, etc. Make conclusions where appropriate.

You need to present your solution to the tasks into a technical report. The report should be submitted onto Blackboard.

Assignment tasks

Part
You will need to download the data file "Medical_info.csv" from the Blackboard. The dataset is about a study of factors predicting serum testosterone levels in a screened population in some country. The key to the variables in the dataset is explained in the table below. Please note there are null or missing values in some columns of the dataset.

id

Identification Number

age

Age (years)

BMI

Body Mass Index (kg/m2)

PSA

Prostate Specific Antigen (ng/mL)

TG

Serum Triglyceride (mg/dL)

Cholesterol

Serum Cholesterol (mg/dL)

LDLChole

Serum Low-Density Lipoprotein (mg/dL)

HDLChole

Serum High-Density Lipoprotein (mg/dL)

Glucose

Fasting Plasma Glucose (mg/dL)

Testosterone

Serum Testosterone (ng/mL)

BP_1

Blood pressure category, coded as 1=Low, 2=High

1. Load the data file into a Spark DataFrame (1st DataFrame). Describe the structure of the DataFrame.

2. Create a new DataFrame (2nd DataFrame) by removing all the rows with null/missing values in the 1st DataFrame and calculate the number of rows removed.

3. Calculate summary statistics of the ‘age' feature in the 2nd DataFrame, including its min value, max value, mean value, median value, variance and standard deviation. Generate a histogram for the ‘age' feature and describe the distribution of the feature.

4. Display the quartile info of the ‘BMI' feature in the 2nd DataFrame. Generate a boxplot for the ‘BMI' feature and discuss the distribution of the feature based on the boxplot.

5. Use Spark DataFrame API (i.e., expression methods) to count the number of rows where ‘age' is greater than 50 and ‘BP_1' equals 1.

6. Use the ‘BP_1' feature in the 2nd DataFrame as the target label, to build two classification models based on all other columns as predictors. Conduct performance evaluation for the two models and make conclusions.

Part (II)

You will need to download the data file "Region_info.csv" from the Blackboard. The dataset provides information such as population size, average life expectancy, GDP per capita, and so on for some regions. The key to the variables in the dataset is explained in the table below.

Population

Identification Number

fertility

Average number of children a woman in a given country gives birth to

HIV

HIV infection rate

CO2

CO2 emission (tonnes per person)

BMI_male

Body Mass Index (male)

GDP

Gross Domestic Product

BMI_female

Body Mass Index (female)

life

Average life expectancy

child_mortality

Death of children under 5 years of age per 1000 live births

region

Region

1. Load the data file into a Spark DataFrame (1st DataFrame). Describe the structure of the created data frame.

2. Create a new DataFrame (2nd DataFrame) by removing the ‘region' column.

3. Use a graph, explore and describe the relationship between ‘fertility' feature and ‘life' feature in the 2nd DataFrame.

4. Use Spark SQL query to display the ‘fertility' and ‘life' columns in the 2nd DataFrame where ‘fertility' is great than 1.0 and ‘life' is greater than 70.

5. Build a linear regression model to predict life expectancy (the ‘life' column) in the 2nd DataFrame using the ‘fertility' column as the predictor. Conduct performance evaluation for the model and make conclusions.

6. Build a Lasso regression model to predict life expectancy (the ‘life column) in the 2nd DataFrame using all other columns as the predictor. Conduct performance evaluation for the model and make conclusions.

Attachment:- Big Data Analytics Assessment.rar

Reference no: EM132900933

Questions Cloud

Society grants legitimacy and power to business : The Iron Law of Social Responsibility indicates that "society grants legitimacy and power to business. In the long run, those who do not use power in a manner
How does current organizational and operational structure : How does the current organizational and operational structure, including the system of corporate governance, benefit the firm?
Similarities between e business and e commerce : Explain business and explain ecommerce. What are the similarities between e business and e commerce?
Do think is a good idea for target to implement : Describe the positives and negatives that may be associated with this change. Explain. Do you think this is a good idea for Target to implement? Explain.
Create a new dataframe : Create a new DataFrame (2nd DataFrame) by removing all the rows with null/missing values in the 1st DataFrame and calculate the number of rows removed
Discuss why fuel prices fluctuate : Read the two articles below that discuss why fuel prices fluctuate. you are not expected to fully understand the Data and Methodology.
What are the reasons behind the decrease in sales : What actions or strategy (data/sales/changes) should be taken to turn sales around and regain market share? What are the reasons behind the decrease in sales?
How do you overcome language and cultural differences : How will disputes be handled within the team? How do you overcome language and cultural differences?
What role do emotions serve : What role do your emotions serve? And is it okay to express them in the workplace? A salesperson with intense passion can convince someone

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd