Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import matplotlib.pyplot as plt
- import numpy as np
- from mpl_toolkits.mplot3d import Axes3D
- from sklearn import datasets, linear_model
- diabetes = datasets.load_diabetes()
- X_train = diabetes.data[:-20, (0,1)]
- y_train = diabetes.target[:-20]
- ransac = linear_model.RANSACRegressor(
- linear_model.LinearRegression()
- )
- ransac.fit(X_train, y_train)
- fig = plt.figure()
- plt.clf()
- ax = Axes3D(fig)
- ax.plot_surface([-5,5],[-5,5], ransac.predict(X_train))
- ValueError: shape mismatch: objects cannot be broadcast to a single shape
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement