mlinsights: tricky scikit-learn#
mlinsights implements functions to get insights on machine learned
models or various kind of transforms to help manipulating
data in a single pipeline. It implements
QuantileLinearRegression
which trains a linear regression with L1 norm
non-linear correlation based on decision trees,
QuantileMLPRegressor
which is a modification of scikit-learn’s MLPRegressor
which trains a multi-layer perceptron with L1 norm…
Short example:
<<<
from sklearn.datasets import load_diabetes
from sklearn.linear_model import LinearRegression
from mlinsights.mlmodel import QuantileLinearRegression
data = load_diabetes()
X, y = data.data, data.target
clq = QuantileLinearRegression()
clq.fit(X, y)
print(clq.coef_)
clr = LinearRegression()
clr.fit(X, y)
print(clr.coef_)
>>>
[ 5.759 -301.117 464.043 385.354 -805.267 425.193 110.316 245.851
738.518 35.686]
[ -10.01 -239.816 519.846 324.385 -792.176 476.739 101.043 177.063
751.274 67.627]
This documentation was generated with scikit-learn version…
<<<
from sklearn import __version__
print(__version__)
>>>
1.4.dev0
Source are available at sdpython/mlinsights.