Data: columns = [‘carat’, ‘cut’, ‘price’]
features = ['carat,'cut'] target = 'price' model = KneighborsRegressor(n_neighbors=2) model.fit(train[features],train[target]) !pip install graphviz !apt-get install graphviz import graphviz from sklearn.tree import_graphviz dot_data = export_graphvi(model, out_file=None, feature_names = features, filled = True, rotate = True) graphviz_Source()
Error is this KNeighborsRegressor instance is not fitted yet. Call ‘fit’ with appropriate arguments before using this method. What do i change to make export_graphvi run?