Category : classification

I am trying to do a binary classification using Keras LSTM. My input data is of shape 2340 records * 254 features. The output is 1*2340. Below is my code. X_res = np.array(X_res) X_res = np.reshape(X_res,([1,2340,254])) y_res = np.array(y_res) y_res = np.reshape(y_res,([1,2340])) y_test = np.array(y_test) y_test = np.reshape(y_test,([1,314])) model = keras.Sequential() model.add(keras.layers.LSTM(32 ,input_dim = 254,return_sequences=True)) ..

Read more

I have a multiclass problem with 10 classes. Using any of the sklearn classifiers with predict_proba I get an output of (n_classes, n_samples, n_classes_probability_1_or_0) in my case (10, 4789, 2) Now with binary Classification I would just do model.predict_proba(X)[:, 1] I had assumed that: pred = np.array(model.predict_proba(X)) pred = pred.reshape(-1, 10, 2)[:, :, 1] would ..

Read more

I have written the following code to perform RandomizedSearchCV on LightGBM Classifier Model, but I am getting the following error. ValueError: For early stopping, at least one dataset and eval metric is required for evaluation Code import lightgbm as lgb fit_params={"early_stopping_rounds":30, "eval_metric" : ‘f1’, "eval_set" : [(X_val,y_val)], ‘eval_names’: [‘valid’], ‘verbose’: 100, # ‘categorical_feature’: ‘auto’ } ..

Read more

I’m relatively new to Machine Learning, I was using a Logistic Regression model from sklearn to classify whether someone has heart disease or not based on some 13 features. So, when it came to checking feature importance once the model was trained, I noticed this feature called slope which had feature importance of around 0.45: ..

Read more

When we opt for one-vs-all configuration to binarize our multi-class test dataset, doesn’t this configuration leave the dataset unbalanced for computing the AUC since this will lead to increase in True Negative’s which will in turn effect the FPR (False Positive Rate)? For instance, class A and ‘not A’ won’t be the same size. Class ..

Read more