import keras
from keras import Sequential
from keras.layers import Dense, Dropout
from keras import backend
import numpy as np
from matplotlib import pyplot as plt
from keras.utils import to_categorical
np.seterr(divide='ignore', invalid='ignore')
gas = np.loadtxt('feature_result.txt')
# gas = all_data[np.where(all_data[:, 0] == 4)]
# np.savetxt('gas.txt', gas, fmt='%.5f'),目的是找出4号气体的浓度和所有数据
np.random.seed(133)
np.random.shuffle(gas)
gas_max_min = gas[:, 0:15]
# # z-score方法
# gas_mean = np.mean(gas_z_score, axis=0)
# gas_std = np.std(gas_z_score, axis=0)
# gas_new = (gas_z_score - gas_mean) / gas_std
from sklearn import preprocessing
min_max_scaler = preprocessing.MinMaxScaler()
gas_new = min_max_scaler.fit_transform(gas_max_min)
gas_train_attr = gas_new[:int(gas_new.shape[0] * 0.75)]
gas_train_label_origin = gas[:int(gas.shape[0] * 0.75), 15].reshape(-1, 1)
mlp_classification
最新推荐文章于 2023-11-28 23:29:58 发布