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
What type of power source is used for gmaw
nataly862011 [7]

Answer:

The GMAW process commonly uses a constant voltage power source (GMAW-CV) that allows for a relatively constant welding voltage output over a range of welding currents. For GMAW-CV the welder selects the wire feed speed (WFS) on the wire feeder unit and an appropriate voltage on the welding power supply.

4 0
3 years ago
Read 2 more answers
A wall in a house contains a single window. The window consists of a single pane of glass whose area is 0.11 m2 and whose thickn
Assoli18 [71]

Answer:

Explanation:

Given that,

The area of glass A_g = 0.11m^2

The thickness of the glass t_g=4mm=4\times10^-^3m

The area of the styrofoam A_s=11m^2

The thickness of the styrofoam t_s=0.20m

The thermal conductivity of the glass k_g=0.80J(s.m.C^o)

The thermal conductivity of the styrofoam  k_s=0.010J(s.m.C^o)

Inside and outside temperature difference is ΔT

The heat loss due to conduction in the window is

Q_g=\frac{k_gA_g\Delta T t}{t_g} \\\\=\frac{(0.8)(0.11)(\Delta T)t}{4.0\times 10^-^3}\\\\=(22\Delta Tt)j

The heat loss due to conduction in the wall is

Q_s=\frac{k_sA_s\Delta T t}{t_g} \\\\=\frac{(0.010)(11)(\Delta T)t}{0.20}\\\\=(0.55\Delta Tt)j

The net heat loss of the wall and the window is

Q=Q_g+Q_s\\\\=\frac{k_gA_g\Delta T t}{t_g}+\frac{k_sA_s\Delta T t}{t_g}\\\\=(22\Delta Tt)j +(0.55\Delta Tt)j \\\\=(22.55\Delta Tt)j

The percentage of heat lost by the window is

=\frac{Q_g}{Q}\times 100\\\\=\frac{22\Delta T t}{22.55\Delta T t}\times 100\\\\=97.6 \%

7 0
4 years ago
What is the difference between white and yellow line?
Savatey [412]

Answer:

The question doesnt make any sense. Like what are the lines used for.

Explanation:

5 0
3 years ago
Read 2 more answers
Air at 30 C, 1 bar, 50% relative humidity enters an insulated chamber operating at steady state with a mass flow rate of 3 kg/mi
Tju [1.3M]

Answer:

A) The relative humidity : 0.818 (81.8%), Temperature at C = 14.4⁰c

B) The rate of energy destruction = 0.0477 kw  

Explanation:

Given data :

at point 1 : m1 = 3 kg/min , T1 = 30⁰c, p1 = 1 bar,  ∅ = 0.50 ( 50%)

at point 2 : T2 = 5⁰c,  P2 = 1 bar, m2 = 5 kg/min

at point 3 : p3 = 1 bar

5 0
3 years ago
Carbon dioxide (CO2) is used in industrial and research application, and is sometimes stored at very high pressure in rigid meta
12345 [234]

Answer:

a)m =  247.43 kg

b) m = 123.71 kg

Explanation:

a)

Given data:

volume  =0.8 m^3

P =  18,000 kPa

T =35 degree C = 308 K

By ideal gas equation we have following relation

PV = mRT

where R is gas constant

R = \frac{8.314}{44} = 0.18895 kJ/ kg K

m =\frac{PV}{RT}

m = \frac{18000\times 0.8}{0.18895 \times 308}

m = 247.43 kg

b)

when pressure = 9000 kPa

from ideal gas equation

PV = mRT

where R is gas constant

R = \frac{8.314}{44} = 0.18895 kJ/ kg K

m =\frac{PV}{RT}

m = \frac{9000\times 0.8}{0.18895 \times 308}

m = 123.71 kg

3 0
3 years ago
Other questions:
  • A turbine produces shaft power from a gas that enters the turbine with a (static) temperature of 628 K, a velocity of 143 m/s an
    7·1 answer
  • A lake with an area of 525 [acre] was monitored during a one-month period. The average inflow was 30 [cfs] for the month and the
    11·1 answer
  • A mass of 8000 kg of slightly enriched uranium (2% U-235, 98% U-238) is exposed for 30 days in a reactor operating at (6.18) hea
    5·1 answer
  • What are the two safety precautions taken before driving a car​
    12·1 answer
  • explain the four functional blocks on an oscilloscope and describe the major controls within each block
    6·1 answer
  • What is compression ratio of an Otto cycle? How does it affect the thermal efficiency of the cycle?
    14·1 answer
  • Water is pumped steadily through a 0.10-m diameter pipe from one closed pressurized tank to another tank. The pump adds 4.0 kW o
    9·1 answer
  • Researchers at the University of__________modified the iPhone to allow it to create medical images.
    9·2 answers
  • What is a problem that technology can help solve that problem?
    12·2 answers
  • What is the primary damage control telephone circuit for
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!