1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Helen [10]
4 years ago
6

Use deep neural networks (you may use any free deep learning software tool) to perform a binary classification task, show final

classification accuracies by using 10-fold cross-validation for different cases such as different training epochs. Please show your steps clearly.You may use MS-Word to open this file. The first 13 columns are inputs, and the final column is class (either Healthy (0) or Sick (1, 2, 3, 4)). So you need to pre-process the data to make a training file for binary heart disease classification (the final column value will be either Healthy (+1) or Sick (-1), i.e., 1, 2, 3 and 4 are converted into Sick (-1)).Use SVM to perform the same heart disease classification task and show final classification accuracies by using 10-fold cross-validation for different cases such as different parameters of SVM. Please compare SVM and deep neural networks in classification performance.
Engineering
1 answer:
Pani-rosa [81]4 years ago
6 0

The following SVM is used to perform the same heart disease classification task and the final classficiation accuracies.

<u>Explanation:</u>

import numpy as np

import pandas as pd

import seaborn as sns

import matplotlib.pyplot as plt

%matplotlib inline

dataset = pd.read_csv('heart_disease. csv')

dataset.head(2)

# creating target variables

from sklearn.preprocessing import LabelEncoder

le = LabelEncoder()

y=le.fit_transform(dataset['Car Acceptability'])

#standardizing the input feature

from sklearn.preprocessing import StandardScaler

sc= StandardScaler()

X= sc.fit_transform(all_input_columns)

from sklearn.model_selection import train_test_split

X_train, X_test, y_train, y_test = train_test_split(X, output_category, test_size=0.3)  

# K fold validation

def build_classifier():

classifier = Sequential()

#First Hidden Layer

classifier.add(Dense(8, activation='relu', kernel_initializer='random_uniform', input_dim=13))

  #Second Hidden Layer

classifier.add(Dense(8, activation='relu', kernel_initializer='random_uniform'))

#Output Layer

classifier.add(Dense(4, activation='softmax', kernel_initializer='random_uniform'))

#Compiling the neural network

classifier.compile(optimizer ='adam',loss='categorical_crossentropy', metrics =['accuracy'])

return classifier

We pass build_classifier function to the build_fn argument while constructing the KerasClassifier class. Batch_size is 10 and we run 150 epochs

classifier = KerasClassifier(build_fn=build_classifier, batch_size=10, nb_epoch=150)

As we have used the KerasClassifier to warp the model, we can use scikit-learn. Once we do that then we can use neural network like any other scikit algorithms like Random forest and perform 10 fold cross-validation.

accuracies = cross_val_score(estimator=classifier, X= X, y=output_category,cv=10, n_jobs=-1)

note: do with each fold by replacing 10 with other

You might be interested in
An overhead 25m long, uninsulated industrial steam pipe of 100mm diameter is routed through a building whose walls and air are a
DedPeter [7]

Answer:

a) he rate of heat loss from the steam line is 18.413588 kW

b) the annual cost of heat loss from line is $12904.25

Explanation:

a)

first we find the area

A = πdL

d is the diameter (0.1m) and L is the length (25m)

so

A = π ×  0.1 × 25

A = 7.85 m²

Now rate of heat loss through convection

qconv = hA(Ts -Ta)

h is the convective heat transfer coefficient (10 W/m²K), Ts is surface temperature (150°), Ta is temperature of air (25°)

so we substitute

qconv = 10 W/m²K × 7.85 m² × ( 150° - 25°)

qconv = 9817.477 J/s

Now heat lost through radiation

qrad = ∈Aα ( Ts⁴ - Ta⁴)

∈ is the emissivity (0.8), α is the boltzmann constant ( 5.67×10⁻⁸m⁻²K⁻⁴ ),

first we shall covert our temperatures from Celsius to kelvin scale

Ts is surface temperature (150 + 273K ), Ta is temperature of air (25 + 273K)

so we substitute

qrad = 0.8 × 7.854 × 5.67×10⁻⁸ × ( (423)⁴ - (298)⁴ )

qrad = 3.5625×10⁻⁷ × 2.413×10¹⁰

qrad = 8596.112 J/s

Now to get the total rate of heat loss through convection and radiation, we say

q = qconv + qrad

q = 9817.477 + 8596.112

q = 18413.588 J/s ≈ 18.413588 kW

Therefore the rate of heat loss from the steam line is 18.413588 kW

b)

annual cost of heat lost rate

A = C × q/n × ( 3600 × 24 × 365 )

C is the cost of heat per MJ( $0.02/10⁶) n is broiler efficiency ( 0.9)

so we substitute

A = 0.02/10⁶  × 18413.588/0.9 × ( 3600 × 24 × 365 )

A = $12904.25

Therefore the annual cost of heat loss from line is $12904.25

4 0
3 years ago
Find the velocity and rate of flow of water through a rectangular channel of 6m wide and 3m deep when it's running full. The cha
Elza [17]

Answer:

V = 1.5062 m/s

Explanation:

look to the photos

5 0
3 years ago
Ihjpr2 ywjegnak'evsinawhe2'qwmasnh ngl,;snhy
WITCHER [35]

Answer:

ummm ok?

Explanation:

6 0
3 years ago
Read 2 more answers
Is a gas turbine a heat engine?
Nookie1986 [14]
Gas turbines extract the energy from combustion gas

and heat engines convert thermal and chemical energy to mechanical energy

gas is considered a chemical so i'm pretty sure it is considered one
4 0
3 years ago
Just getting to your class is enough for showing up.<br> A) True<br> B) False
Lady bird [3.3K]
False you have to do the work and perricapate
8 0
4 years ago
Read 2 more answers
Other questions:
  • At a high school science fair, Connor won first place for his replica of the Golden Gate Bridge. Connor liked the project so muc
    5·1 answer
  • Carbon dioxide steadily flows into a constant pressure heater at 300 K and 100 kPa witha mass flow rate of 9.2 kg/s. Heat transf
    11·1 answer
  • You are given a body with no body forces and told that the stress state is given as: ⎡ ⎣ 3αx 5βx2 + αy γz3 5βx2 + αy βx2 0 γz3 0
    8·1 answer
  • A cruise missile under test is moving horizontally at Ma =2 in the atmosphere at an elevation of 2000 m (Air temperature is 2 °C
    5·1 answer
  • Use a passband of 0 to 5 kHz with 5 kHz cutoff frequency and filter to attenuate all frequencies at and above 10 kHz by at least
    8·1 answer
  • Which allows a user to run applications on a computing device? Group of answer choices Application software CSS Operating system
    11·1 answer
  • N2 flows through an insulated horizontal tube at steady state. With an inlet temperature of 150°C and a velocity change from 2 m
    11·1 answer
  • Write a program that prints a one-month calendar. The userspecifies the number of days in the month and the day of the weekon wh
    9·1 answer
  • Assume the transistor is biased in the saturation region at VGS 4 V. (a) Calculate the ideal cutoff frequency. (b) Assume that t
    5·1 answer
  • write a paragraph on how iron and copper(separately) is manufactured, what it consists of and processes that it went through to
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!