0

Network architecture is as follows:

dataset features(input_expansion) are expanded by using chebshy polynomial then i got(Exp_layer),

split the dataset into train and test and applied back propagation between exp_layer and output layer(1 node) using keras.

where when evaluating accuracy is fluctuating.

and please suggest me how to increase the accuracy. dataset is used is JM1 from Promise repository

from keras.models import Sequential
from keras.layers import Dense
import numpy as np
from keras.optimizers import SGD,adam
from keras import backend as kb
from sklearn.model_selection import train_test_split
import pandas as pd
from sklearn.ensemble import ExtraTreesClassifier##model used for feature selection
from sklearn.feature_selection import SelectFromModel##for feature selection
from sklearn.feature_selection import RFE
from sklearn.linear_model import LogisticRegression
data=pd.read_excel('jm1_csv.xls')
dataset=data.dropna(how='any')
input_expansion = dataset.iloc[:,:-1].values
Y = dataset.iloc[:,-1].values
rows = dataset.shape[0]
columns=input_expansion.shape[1]
print(columns)

def funexp(x):
     a = np.array([])
     for i in x:
          t0x=1
          t1x=i
          t2x=2*(i**2)-1
          t3x=4*(i**3)-3*i
          t4x=8*(i**4)-8*(i**2)+1
          a = np.append(a, np.array([t0x,t1x,t2x,t3x,t4x]))
     return a


Exp_layer = np.array([])
for i in input_expansion:
     Exp_layer=np.append(Exp_layer,funexp(i))
Exp_layer=Exp_layer.reshape(len(input_expansion),(columns)*5)

X_train, X_test, Y_train, Y_test = train_test_split(Exp_layer, Y, test_size=0.2)
keras_model = Sequential()
keras_model.add(Dense(1, input_dim=(columns*5), activation='relu'))
optimizer=SGD(0.001)
keras_model.compile(loss='mean_absolute_error',optimizer=optimizer,metrics=['accuracy'])
keras_model.fit(X_train,Y_train,epochs=20,batch_size=50)
results = keras_model.evaluate(X_test, Y_test, batch_size=50)
print('Loss:', results[0])
print('Accuracy of FLANN:', results[1])
```
  • The target for this dataset is binary, right? A binary indicator of whether or not the software has defects? Why are you using a network that has an unbounded output layer (ReLU activation) and MAE loss? The standard approach for a binary problem is a sigmoid output with cross-entropy loss. This has a number of nice properties, chief among them that you're estimating the probability of a defect, whereas this network has no interpretation as a probability model. – Sycorax Feb 04 '20 at 04:49
  • Even i changed loss cross-entropy and sigmoid activation function accuracy is decreased and same accuracy is fluctuating – Suresh Reshu Feb 04 '20 at 04:55
  • Accuracy isn't a great way to measure how well a model is doing. https://stats.stackexchange.com/questions/312780/why-is-accuracy-not-the-best-measure-for-assessing-classification-models It's probably the case that minor shifts in weights are moving observations to opposite sides of 0.5, so accuracy will always fluctuate. Large fluctuations suggest the learning rate is too large; or something else. Tuning a neural network takes a lot of work. Some suggestions for how to do this: https://stats.stackexchange.com/questions/352036/what-should-i-do-when-my-neural-network-doesnt-learn/352037#352037 – Sycorax Feb 04 '20 at 04:58
  • Anyway, this dataset is small and the signal is dubious. It's unlikely that any model will do especially well. As a baseline, tune a random forest and compare to that; maybe a well-tuned NN can beat that level of accuracy. In general, neural networks aren't really the kind of model that you can just throw together and expect good results. If you're building a neural network, you're signing up to spend a lot of time fiddling with the knobs to get a good result. – Sycorax Feb 04 '20 at 05:01
  • i am a begginer in machine learning, so can u pls go through the code mentioned and suggest me in a bigginer level thank you – Suresh Reshu Feb 04 '20 at 05:06
  • That's not really how this website works; how to use this website is explained in the [help]. My suggestion is to read a high-quality textbook on neural networks such as Goodfellow's *Deep Learning* or a general machine learning textbook like *Elements of Statistical Learning.* We have more suggestions here https://stats.stackexchange.com/questions/tagged/machine-learning+references – Sycorax Feb 04 '20 at 05:10
  • Thank you Very much – Suresh Reshu Feb 04 '20 at 05:11

0 Answers0