Correlated features and classification accuracy

Correlated features do not affect classification accuracy per se. The problem in realistic situations is that we have a finite number of training examples with which to train a classifier. For a fixed number of training examples, increasing the number of features typically increases classification accuracy to a point but as the number of features … Read more

What is the difference between cross-entropy and log loss error?

They are essentially the same; usually, we use the term log loss for binary classification problems, and the more general cross-entropy (loss) for the general case of multi-class classification, but even this distinction is not consistent, and you’ll often find the terms used interchangeably as synonyms. From the Wikipedia entry for cross-entropy: The logistic loss … Read more

Controlling the threshold in Logistic Regression in Scikit Learn

There is a little trick that I use, instead of using model.predict(test_data) use model.predict_proba(test_data). Then use a range of values for thresholds to analyze the effects on the prediction; pred_proba_df = pd.DataFrame(model.predict_proba(x_test)) threshold_list = [0.05,0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,.7,.75,.8,.85,.9,.95,.99] for i in threshold_list: print (‘\n******** For i = {} ******’.format(i)) Y_test_pred = pred_proba_df.applymap(lambda x: 1 if x>i else 0) … Read more

scikit learn output metrics.classification_report into CSV/tab-delimited format

As of scikit-learn v0.20, the easiest way to convert a classification report to a pandas Dataframe is by simply having the report returned as a dict: report = classification_report(y_test, y_pred, output_dict=True) and then construct a Dataframe and transpose it: df = pandas.DataFrame(report).transpose() From here on, you are free to use the standard pandas methods to … Read more

What is the difference between back-propagation and feed-forward Neural Network?

A Feed-Forward Neural Network is a type of Neural Network architecture where the connections are “fed forward”, i.e. do not form cycles (like in recurrent nets). The term “Feed forward” is also used when you input something at the input layer and it travels from input to hidden and from hidden to output layer. The … Read more

Different decision tree algorithms with comparison of complexity or performance

Decision Tree implementations differ primarily along these axes: the splitting criterion (i.e., how “variance” is calculated) whether it builds models for regression (continuous variables, e.g., a score) as well as classification (discrete variables, e.g., a class label) technique to eliminate/reduce over-fitting whether it can handle incomplete data The major Decision Tree implementations are: ID3, or … Read more