World's Best AI Learning Platform with profoundly Demanding Certification Programs
Designed by IITians, only for AI Learners.
How to store the name of independent variable in a list which show non linear behavior ?.......How to understand data is linear or non linear ? Only by visualization or any another method
Linearity and Non- linearity can be studied by visualizing the data
To store the name of the independent variable in a list, you can simply create a list and append the variable name to it. For example:
ind_vars =  # create an empty list ind_vars.append('temperature') # append the variable name to the list
To understand whether the data is linear or non-linear, you can use visualization techniques such as scatter plots or line plots to get a sense of the relationship between the independent and dependent variables. If the data points form a straight line when plotted, then the data is likely to be linear. If the data points do not form a straight line, then the data is likely to be non-linear.
In addition to visualization, you can also use statistical tests to determine whether the data is linear or non-linear. For example, you can use the Durbin-Watson test to determine whether there is autocorrelation in the data, which would indicate a non-linear relationship. You can also use polynomial regression to fit a curve to the data and compare the results to a linear model to see which model fits the data better.
Running random forest algorithm with one variable