I need a model that will take in a few numerical parameters, and give back a numerical answer (Context: predicting a slope based on environmental factors without having to actually take measurements to find the slope).

However, I am lost, given that I have not found (on the web) any model that is able to solve this task. If someone can suggest a type of model that would be able to solve this type of problem, I would greatly appreciate it. Resources and libraries would also be useful if you care to suggest any. I'm using Python.

  • 1
    $\begingroup$ Are you talking about regression? I suggest you check up the term and see whether that's what you meant and edit the question accordingly if it is not what you mean. $\endgroup$
    – user9947
    Jul 12, 2019 at 20:01
  • 2
    $\begingroup$ Welcome to SE:AI! It would be ideal if we could mention the problem in the question header. (Better for search and should help attract answers.) $\endgroup$
    – DukeZhou
    Jul 12, 2019 at 20:48

1 Answer 1


You're probably looking for regression, either linear or non-linear, which usually refers to a set of methods that can be used to predict a continuous (or numerical) value (the value of the so-called dependent variable), given one or more possibly numerical values (the values of the independent variables). (The other common task is called classification, where the outcome variable is discrete.)

The dependent and independent variables can also be vectors. In that case, it is called multivariate linear or non-linear regression. If there is more than one independent variable (or, also called, predictor), then it is called multivariable (or multiple) linear or non-linear regression. See, for example, Multivariate or Multivariable Regression? (2013), by Bertha Hidalgo and Melody Goodman.

In linear regression, the dependent variable is assumed to be a linear combination of the independent variables, while, in non-linear regression, it is assumed to be a non-linear combination (which is any combination or relationship that is not linear).

The independent variables (or predictors) do not actually need to be independent of each other and, of course, the dependent variable does not need to be independent of the predictors (otherwise you would not be able to predict the value of the dependent variable, given the predictors), so the expression predictor is possibly more appropriate than independent variable. See, for example, In Regression Analysis, why do we call independent variables "independent"?, by Frank Harrell. However, the dependent variable is assumed to be dependent on the independent variables, so you could think of the independent variables as the variables that are not the dependent variables (if this helps you to memorize the concept).

There are more synonyms for the dependent and independent variables, depending on the context or area. For example, the predictors (or independent variables) can also be called covariates, regressors or explanatory variables. The dependent variable can also be called regressand, outcome variable, or explainable variable.

There are other types of regression models. In particular, there is the generalized regression model (GLM), which is (as the name suggests) a generalization of several regression models. The famous logistic regression (where the outcome is actually binomial or binary, so discrete) is an application of the generalized regression model, where the link function (which is a concept that is used in the context of GLMs) is the logit function. See, for example, Why is logistic regression a linear model?. Note that linear regression is also an application of a GLM. See also this article 1.1. Generalized Linear Models, which gives you an overview of different GLMs.

Have also a look at this article Choosing the Correct Type of Regression Analysis, which provides a few guidelines to help you choose the most appropriate regression model for your task.

In Python, you could use, for example, sklearn.linear_model.LinearRegression. The Python library sklearn provides several other regressors. For example, sklearn.ensemble.AdaBoostRegressor or sklearn.ensemble.RandomForestRegressor. (Of course, you will need a training dataset to train these regressors, when calling their method fit).


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .