Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Overlapping Line Chart for Accelerometer Data. Code base - This is a sample Python script. # Press to search everywhere for classes, files, tool windows,

Overlapping Line Chart for Accelerometer Data. Code base- This is a sample Python script.
# Press to search everywhere for classes, files, tool windows,
actions, and settings.
def analyze_data():
# Use a breakpoint in the code line below to debug your
script.
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# (Step 1) Selecting the one data for further data analysis.
Give the path & file name below.
affected_filename =...
affected_df = pd.read_csv(affected_filename, skiprows=10)
acc_x = np.array(affected_df['Accelerometer X'])
acc_y = np.array(affected_df['Accelerometer Y'])
acc_z = np.array(affected_df['Accelerometer Z'])
acc_mag = np.sqrt(acc_x * acc_x + acc_y * acc_y + acc_z *
acc_z)-1
plt.plot(range(len(acc_mag)), acc_mag)
plt.show()
# (Step 3) Identifying the data for sedentary behavior (i.e.,
sleeping).
# If you identify the beginning index of the sedentary
behavior, the ending index will be automatically done.
# If you select the beginning index too loosely, the
subsequent sedentary_data may include active behavior.
# So, be careful.
start_index =...
end_index = start_index + int(0.500e6)
sedentary_range = range(start_index, end_index)
sedentary_data = acc_mag[sedentary_range]
plt.plot(range(len(sedentary_data)), sedentary_data)
plt.show()
# (Step 5) Computing beta
# Computing mu
mu =...
# Computing std
sigma =...
# Then, computing beta, using mu and std
beta =...
# (Step 6) Computing M3 for the data
# You can apply beta to identify the data of active behavior.
active_data =...
M3= len(active_data)/len(acc_mag)
# Press the green button in the gutter to run the script.
if __name__=='__main__':
analyze_data(). The ... should be filled. Dataset is already chosen. Thank you. Also how to figure out starting index?
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Define Management or What is Management?

Answered: 1 week ago

Question

What do you understand by MBO?

Answered: 1 week ago

Question

What is meant by planning or define planning?

Answered: 1 week ago

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago