Decision trees based models

can we have the coefficient of the model trained as linear regression,
or in other word can we extract a formula from decision trees or XGBOOST

Hey @yahiaoui_asma,
If you train a linear regression model with the help of sklearn, you can access the coefficients and intercept using the coef_ and intercept_ attributes of the sklearn.linear_model.LinearRegression class respectively. You can read more about it here.

Similarly, if you train a decision tree model with the help of sklearn, you can access the entire tree structure, and hence, the formulation, using the tree_ attribute of sklearn.tree.DecisionTreeClassifier and sklearn.tree.DecisionTreeRegressor classes. You can read more about it here and here.

Let us know if this helps.

Cheers,
Elemento