Skip to main content
added 358 characters in body
Source Link

I am not sure what doTL;DR: It is a convention to convert categorical features to numeric features before you mean by 'indictor values'can use them in regression, or any other machine learning algorithm for that matter. IfTechnically, there is nothing that is stopping ML algorithms from working with categorical features but their software implementation would be prohibitively expensive, hence this convention in ML practice.

Turning to your problem, if you are trying to convert categorical labelslabel values into numerical values, there are various methods but it appears the best one for your data would be One-Hot encoder. Both Scikit-Learn and PySpark, and most other libraries provide handy functions for it, as it is very common operation. For example:

from sklearn.preprocessing import OneHotEncoder
one_hot = OneHotEncoder()
one_hot.fit(...your_columns...)

Once you have all data in numeric form, you can use pretty much any algorithm.

As for the last figure, it is scatter plot between x and y, and it is not obvious what theyx and y are. Weirdly enough, it is notnot one-on-one relationship because a given value of x seems to produce multiple value of y?!!! And vice versa.

The shape of a graph depends on the values being plotted against each other. And I am not sure what you are plotting therein earlier figures that is giving youryou straight lines!

I am not sure what do you mean by 'indictor values'. If you are trying to convert categorical labels into numerical values, there are various methods but the best one for your data would be One-Hot encoder. Both Scikit-Learn and PySpark and most other libraries provide handy functions for it, as it very common operation. For example:

from sklearn.preprocessing import OneHotEncoder
one_hot = OneHotEncoder()
one_hot.fit(...your_columns...)

As for the last figure, it is scatter plot between x and y, and it is not obvious what they are. Weirdly enough, it is not one-on-one relationship because a given value of x seems to produce multiple value of y?!!! And vice versa.

The shape of a graph depends on the values being plotted against each other. And I am not sure what you are plotting there that is giving your straight lines!

TL;DR: It is a convention to convert categorical features to numeric features before you can use them in regression, or any other machine learning algorithm for that matter. Technically, there is nothing that is stopping ML algorithms from working with categorical features but their software implementation would be prohibitively expensive, hence this convention in ML practice.

Turning to your problem, if you are trying to convert categorical label values into numerical values, there are various methods but it appears the best one for your data would be One-Hot encoder. Both Scikit-Learn and PySpark, and most other libraries provide handy functions for it, as it is very common operation. For example:

from sklearn.preprocessing import OneHotEncoder
one_hot = OneHotEncoder()
one_hot.fit(...your_columns...)

Once you have all data in numeric form, you can use pretty much any algorithm.

As for the last figure, it is scatter plot between x and y, and it is not obvious what x and y are. Weirdly enough, it is not one-on-one relationship because a given value of x seems to produce multiple value of y?!!! And I am not sure what you are plotting in earlier figures that is giving you straight lines!

Source Link

I am not sure what do you mean by 'indictor values'. If you are trying to convert categorical labels into numerical values, there are various methods but the best one for your data would be One-Hot encoder. Both Scikit-Learn and PySpark and most other libraries provide handy functions for it, as it very common operation. For example:

from sklearn.preprocessing import OneHotEncoder
one_hot = OneHotEncoder()
one_hot.fit(...your_columns...)

As for the last figure, it is scatter plot between x and y, and it is not obvious what they are. Weirdly enough, it is not one-on-one relationship because a given value of x seems to produce multiple value of y?!!! And vice versa.

The shape of a graph depends on the values being plotted against each other. And I am not sure what you are plotting there that is giving your straight lines!