import pandas as pd
import numpy as np
from mining_tools import my_tools
from testimbalance import abalone_input
from imbalance_tools import handle_imbalance
from create_dendogram import my_dendogram

#Check the class abalone_input which is used to take input from the data-set manually
ab=abalone_input()
x=ab.encoded_Data()

x=pd.DataFrame(data=x[0:,0:])



y=x.iloc[:,-1].values
y=y.astype(np.float)

#Dealing with class imbalance
#Balanced sampling technique as described in the project report
hi=handle_imbalance()
abalone_balanced=hi.simple_oversample_undersample(x.values.astype(np.float),y)
abalone_smote=hi.modified_smote(x.values.astype(np.float),y,2)
y_abalone=abalone_balanced[:,-1]
x_abalone=abalone_balanced[:,:-1]
x_abalone=pd.DataFrame(data=x_abalone[0:,0:])
#print('balanced',x_abalone)

y_smote=abalone_smote[:,-1]
x_smote=abalone_smote[:,:-1]
x_smote=pd.DataFrame(data=x_smote[0:,0:])

#input from pulser dataset
data=pd.read_csv('HTRU_2.csv')
y_htru=data.iloc[:,-1].values.astype(np.float)
x_htru=data.iloc[:,:-1]

#This class takes feature vector & target as input along with the String that describes it & number of clusters
#At first the the dendrogram program should be ran to determine how many clusters the user wants to opt for.
ob=my_tools(x_htru,y_htru,'Pulser imbalanced Raw',2) 
ob.full_throttle()#This method calls all the sub modules of my_tools program & therefore please be patient it'll take around 10 mins
#to finish execution & export autogenerated report with performance metrics.

#Balanced sampling technique as described in the project report
balanced_data=hi.simple_oversample_undersample(data.values.astype(np.float),y_htru)
#Balanced sampling with SMOTE 
balanced_data_smote=hi.modified_smote(data.values.astype(np.float),y_htru,2)
y_balanced=balanced_data[:,-1]
x_balanced=balanced_data[:,:-1]
x_balanced=pd.DataFrame(data=x_balanced[0:,0:])
y_balanced_smote=balanced_data_smote[:,-1]
x_balanced_smote=balanced_data_smote[:,:-1]
x_balanced_smote=pd.DataFrame(data=x_balanced_smote[0:,0:])

ob=my_tools(x_balanced,y_balanced,'Pulser balanced sampling',2)
ob.full_throttle()  #This method calls all the sub modules of my_tools program & therefore please be patient it'll take around 10 mins
#to finish execution & export autogenerated report with performance metrics.
ob=my_tools(x_balanced_smote,y_balanced_smote,'Pulser SMOTE',2)
ob.full_throttle()


06cfd0a3efb236ab9ca8e7f42d715e8118d11a7a
<mask token>

<mask token>
ob.full_throttle()
<mask token>
ob.full_throttle()
<mask token>
ob.full_throttle()

<mask token>
ab = abalone_input()
x = ab.encoded_Data()
x = pd.DataFrame(data=x[0:, 0:])
y = x.iloc[:, -1].values
y = y.astype(np.float)
hi = handle_imbalance()
abalone_balanced = hi.simple_oversample_undersample(x.values.astype(np.
    float), y)
abalone_smote = hi.modified_smote(x.values.astype(np.float), y, 2)
y_abalone = abalone_balanced[:, -1]
x_abalone = abalone_balanced[:, :-1]
x_abalone = pd.DataFrame(data=x_abalone[0:, 0:])
y_smote = abalone_smote[:, -1]
x_smote = abalone_smote[:, :-1]
x_smote = pd.DataFrame(data=x_smote[0:, 0:])
data = pd.read_csv('HTRU_2.csv')
y_htru = data.iloc[:, -1].values.astype(np.float)
x_htru = data.iloc[:, :-1]
ob = my_tools(x_htru, y_htru, 'Pulser imbalanced Raw', 2)
ob.full_throttle()
balanced_data = hi.simple_oversample_undersample(data.values.astype(np.
    float), y_htru)
balanced_data_smote = hi.modified_smote(data.values.astype(np.float), y_htru, 2
    )
y_balanced = balanced_data[:, -1]
x_balanced = balanced_data[:, :-1]
x_balanced = pd.DataFrame(data=x_balanced[0:, 0:])
y_balanced_smote = balanced_data_smote[:, -1]
x_balanced_smote = balanced_data_smote[:, :-1]
x_balanced_smote = pd.DataFrame(data=x_balanced_smote[0:, 0:])
ob = my_tools(x_balanced, y_balanced, 'Pulser balanced sampling', 2)
ob.full_throttle()
ob = my_tools(x_balanced_smote, y_balanced_smote, 'Pulser SMOTE', 2)
ob.full_throttle()

import pandas as pd
import numpy as np
from mining_tools import my_tools
from testimbalance import abalone_input
from imbalance_tools import handle_imbalance
from create_dendogram import my_dendogram
ab = abalone_input()
x = ab.encoded_Data()
x = pd.DataFrame(data=x[0:, 0:])
y = x.iloc[:, -1].values
y = y.astype(np.float)
hi = handle_imbalance()
abalone_balanced = hi.simple_oversample_undersample(x.values.astype(np.
    float), y)
abalone_smote = hi.modified_smote(x.values.astype(np.float), y, 2)
y_abalone = abalone_balanced[:, -1]
x_abalone = abalone_balanced[:, :-1]
x_abalone = pd.DataFrame(data=x_abalone[0:, 0:])
y_smote = abalone_smote[:, -1]
x_smote = abalone_smote[:, :-1]
x_smote = pd.DataFrame(data=x_smote[0:, 0:])
data = pd.read_csv('HTRU_2.csv')
y_htru = data.iloc[:, -1].values.astype(np.float)
x_htru = data.iloc[:, :-1]
ob = my_tools(x_htru, y_htru, 'Pulser imbalanced Raw', 2)
ob.full_throttle()
balanced_data = hi.simple_oversample_undersample(data.values.astype(np.
    float), y_htru)
balanced_data_smote = hi.modified_smote(data.values.astype(np.float), y_htru, 2
    )
y_balanced = balanced_data[:, -1]
x_balanced = balanced_data[:, :-1]
x_balanced = pd.DataFrame(data=x_balanced[0:, 0:])
y_balanced_smote = balanced_data_smote[:, -1]
x_balanced_smote = balanced_data_smote[:, :-1]
x_balanced_smote = pd.DataFrame(data=x_balanced_smote[0:, 0:])
ob = my_tools(x_balanced, y_balanced, 'Pulser balanced sampling', 2)
ob.full_throttle()
ob = my_tools(x_balanced_smote, y_balanced_smote, 'Pulser SMOTE', 2)
ob.full_throttle()

import pandas as pd
import numpy as np
from mining_tools import my_tools
from testimbalance import abalone_input
from imbalance_tools import handle_imbalance
from create_dendogram import my_dendogram

#Check the class abalone_input which is used to take input from the data-set manually
ab=abalone_input()
x=ab.encoded_Data()

x=pd.DataFrame(data=x[0:,0:])



y=x.iloc[:,-1].values
y=y.astype(np.float)

#Dealing with class imbalance
#Balanced sampling technique as described in the project report
hi=handle_imbalance()
abalone_balanced=hi.simple_oversample_undersample(x.values.astype(np.float),y)
abalone_smote=hi.modified_smote(x.values.astype(np.float),y,2)
y_abalone=abalone_balanced[:,-1]
x_abalone=abalone_balanced[:,:-1]
x_abalone=pd.DataFrame(data=x_abalone[0:,0:])
#print('balanced',x_abalone)

y_smote=abalone_smote[:,-1]
x_smote=abalone_smote[:,:-1]
x_smote=pd.DataFrame(data=x_smote[0:,0:])

#input from pulser dataset
data=pd.read_csv('HTRU_2.csv')
y_htru=data.iloc[:,-1].values.astype(np.float)
x_htru=data.iloc[:,:-1]

#This class takes feature vector & target as input along with the String that describes it & number of clusters
#At first the the dendrogram program should be ran to determine how many clusters the user wants to opt for.
ob=my_tools(x_htru,y_htru,'Pulser imbalanced Raw',2) 
ob.full_throttle()#This method calls all the sub modules of my_tools program & therefore please be patient it'll take around 10 mins
#to finish execution & export autogenerated report with performance metrics.

#Balanced sampling technique as described in the project report
balanced_data=hi.simple_oversample_undersample(data.values.astype(np.float),y_htru)
#Balanced sampling with SMOTE 
balanced_data_smote=hi.modified_smote(data.values.astype(np.float),y_htru,2)
y_balanced=balanced_data[:,-1]
x_balanced=balanced_data[:,:-1]
x_balanced=pd.DataFrame(data=x_balanced[0:,0:])
y_balanced_smote=balanced_data_smote[:,-1]
x_balanced_smote=balanced_data_smote[:,:-1]
x_balanced_smote=pd.DataFrame(data=x_balanced_smote[0:,0:])

ob=my_tools(x_balanced,y_balanced,'Pulser balanced sampling',2)
ob.full_throttle()  #This method calls all the sub modules of my_tools program & therefore please be patient it'll take around 10 mins
#to finish execution & export autogenerated report with performance metrics.
ob=my_tools(x_balanced_smote,y_balanced_smote,'Pulser SMOTE',2)
ob.full_throttle()

