Top "Categorical-data" questions

Statistical data type whose value is one of a fixed number of nominal categories.

One-Hot Encoding in [R] | Categorical to Dummy Variables

I need to create a new data frame nDF that binarizes all categorical variables and at the same time retains …

r categorical-data
Working of labelEncoder in sklearn

Say I have the following input feature: hotel_id = [1, 2, 3, 2, 3] This is a categorical feature with numeric values. If I give …

python machine-learning scikit-learn categorical-data
Scikit-learn's LabelBinarizer vs. OneHotEncoder

What is the difference between the two? It seems that both create new columns, which their number is equal to …

python encoding scikit-learn data-science categorical-data
How to sort pandas dataframe by custom order on string index

I have the following data frame: import pandas as pd # Create DataFrame df = pd.DataFrame( {'id':[2967, 5335, 13950, 6141, 6169],\ 'Player': ['Cedric Hunter', 'Maurice …

python pandas sorting indexing categorical-data
how to check for correlation among continuous and categorical variables in python?

I have a dataset including categorical variables(binary) and continuous variables. I'm trying to apply a linear regression model for …

python linear-regression correlation categorical-data
How to specify a variable in pandas as ordinal/categorical?

I am trying to run some Machine learning algo on a dataset using scikit-learn. My dataset has some features which …

python pandas scikit-learn categorical-data
Linear model (lm) when dependent variable is a factor/categorical variable?

I want to do linear regression with the lm function. My dependent variable is a factor called AccountStatus: 1:0 days in …

r lm categorical-data r-factor
Categorical features correlation

I have some categorical features in my data along with continuous ones. Is it a good or absolutely bad idea …

pandas machine-learning categorical-data feature-engineering
Why is "relevel" not working with my logistic regression?

I'm trying to use the instruction relevel to redefine the refrence category in a factor to the last category. At …

r categorical-data
R coxph() warning: Loglik converged before variable

I'm having some trouble using coxph(). I've two categorical variables: Sex and Probable Cause, that I want to use as …

r survival-analysis categorical-data cox-regression