def button_search(self): # Utilise la classe Traitement pour faire la recherche g = Traitement(self.searchd.get(), self.searchf.get(), self.searchl.get(), self.searchdo.get()) print(g) g.search() messagebox.showinfo("Sauvegarde", lecture_txt())
def __init__(self,base,nmois,id,cv_primary,cv_i,taille_maille,classifieur_fr=None,classifieur_fs=None,coef=0,**kwargs): cm = kwargs.get('cm',plt.cm.RdBu) cm_bright = kwargs.get('cm_bright', ListedColormap(['#FF0000','#0000FF'])) marker_size = kwargs.get('marker_size',None) figsize = kwargs.get('figsize',None) Visualizer.__init__(taille_maille,coef,cm=cm,cm_bright=cm_bright,marker_size=marker_size,figsize=figsize) std = kwargs.get('std',True) self.X_fs,self.X_val,self.Y_val,self.X_test,self.Y_test = proc.import_val_test_XY_cv_fs(base,id,cv_primary,cv_i,nmois=nmois,std=std,classifieur_fr=classifieur_fr,classifieur_fs=classifieur_fs)
def generate_CV_sets(dataSet, replace=False): X = proc.import_X(dataSet.base, dataSet.nmois, std=dataSet.std) Y = proc.import_Y(dataSet.base, dataSet.nmois) for id in dataSet.id_list: df = pd.DataFrame(index=X.index, columns=np.arange(1, dataSet.cv_primary.get_n_splits())) for i, (IndexTrain_iloc, IndexTest) in enumerate(dataSet.cv_primary.split(X, Y)): IndexTrain = X.iloc[IndexTrain_iloc].index Index = [i in IndexTrain for i in X.index] df[i] = Index foldername = foldername('CV_primary', dataSet.base) filename = dataSet.get_filename(id) df.to_pickle(foldername + filename)
def button_search(self): print("Boutton Rechercher") g = Traitement(self.searchd.get(), self.searchf.get(), self.searchl.get(), self.searchdo.get()) print(g)
def traitement(self,MainWindow): self.traitementImage = QtWidgets.QMainWindow() self.ui = traitement.Ui_traitementImage() self.ui.setupUi(self.traitementImage) self.traitementImage.show() MainWindow.close()
def display_base(self,n_dimensions,base,nmois,id,cv_primary,cv_i,classifieur_fr=None,classifieur_fs=None,std=True): X_fs,X_val,Y_val,X_test,Y_test = proc.import_val_test_XY_cv_fs(base,id,cv_primary,cv_i,nmois=nmois,std=std,classifieur_fr=classifieur_fr,classifieur_fs=classifieur_fs) self.display_XY(X_fs,X_val,Y_val,X_test,Y_test)
def import_Y(self): return proc.import_Y(self.base, self.nmois)
def import_X(self): return proc.import_X(self.base, self.nmois, self.std)