[scikit-learn] question regarding 'RANSACRegressor' object has no attribute 'inlier_mask_'

2022-07-29 Thread Shang-Rou Hsieh via scikit-learn
To whom it may concern, Belows are the codes: -  - - - - from sklearn.linear_model import RANSACRegressor ransac = RANSACRegressor(LinearRegression(), max_trials=100, # default min_samples=0.95, loss='absolute_error', #

Re: [scikit-learn] question regarding 'RANSACRegressor' object has no attribute 'inlier_mask_'

2022-07-29 Thread Guillaume Lemaître
You need to fit the estimator to access the fitted attribute: In [1]: from sklearn.linear_model import RANSACRegressor ...: from sklearn.datasets import make_regression ...: X, y = make_regression( ...: n_samples=200, n_features=2, noise=4.0, random_state=0) ...: reg = RANSACRegres

Re: [scikit-learn] question regarding 'RANSACRegressor' object has no attribute 'inlier_mask_'

2022-07-29 Thread Shang-Rou Hsieh via scikit-learn
Thanks. I will give it a try. On Friday, July 29, 2022 at 03:06:19 PM PDT, Guillaume Lemaître wrote: You need to fit the estimator to access the fitted attribute: In [1]: from sklearn.linear_model import RANSACRegressor   ...: from sklearn.datasets import make_regression   ...: X, y =