classification

Why does sigmoid & crossentropy of Keras/tensorflow have low precision?

不羁岁月 提交于 2020-08-27 21:54:10
问题 I have the following simple neural network (with 1 neuron only) to test the computation precision of sigmoid activation & binary_crossentropy of Keras: model = Sequential() model.add(Dense(1, input_dim=1, activation='sigmoid')) model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy']) To simplify the test, I manually set the only weight to 1 and bias to 0, and then evaluate the model with 2-point training set {(-a, 0), (a, 1)} , i.e. y = numpy.array([0, 1]) for a in

Handling different Factor Levels in Train and Test data

寵の児 提交于 2020-08-24 14:56:58
问题 I have a training data set of 20 column , all of which are factors which i have to use for training a model, I have been given test data set on which I have to apply my model for predictions and submit. I was doing initial data exploration and just out of curiosity checked the levels of training data and testing data levels since we are dealing with all categorical variables.To my dismay most of the categories (variables) have different levels in training and testing data set. for example

Handling different Factor Levels in Train and Test data

折月煮酒 提交于 2020-08-24 14:43:48
问题 I have a training data set of 20 column , all of which are factors which i have to use for training a model, I have been given test data set on which I have to apply my model for predictions and submit. I was doing initial data exploration and just out of curiosity checked the levels of training data and testing data levels since we are dealing with all categorical variables.To my dismay most of the categories (variables) have different levels in training and testing data set. for example

Process for oversampling data for imbalanced binary classification

扶醉桌前 提交于 2020-08-17 11:14:08
问题 I have about a 30% and 70% for class 0 (minority class) and class 1 (majority class). Since I do not have a lot of data, I am planning to oversample the minority class to balance out the classes to become a 50-50 split. I was wondering if oversampling should be done before or after splitting my data into train and test sets. I have generally seen it done before splitting in online examples, like this: df_class0 = train[train.predict_var == 0] df_class1 = train[train.predict_var == 1] df

Process for oversampling data for imbalanced binary classification

∥☆過路亽.° 提交于 2020-08-17 11:14:05
问题 I have about a 30% and 70% for class 0 (minority class) and class 1 (majority class). Since I do not have a lot of data, I am planning to oversample the minority class to balance out the classes to become a 50-50 split. I was wondering if oversampling should be done before or after splitting my data into train and test sets. I have generally seen it done before splitting in online examples, like this: df_class0 = train[train.predict_var == 0] df_class1 = train[train.predict_var == 1] df

Process for oversampling data for imbalanced binary classification

余生长醉 提交于 2020-08-17 11:11:30
问题 I have about a 30% and 70% for class 0 (minority class) and class 1 (majority class). Since I do not have a lot of data, I am planning to oversample the minority class to balance out the classes to become a 50-50 split. I was wondering if oversampling should be done before or after splitting my data into train and test sets. I have generally seen it done before splitting in online examples, like this: df_class0 = train[train.predict_var == 0] df_class1 = train[train.predict_var == 1] df