<jupyter_start><jupyter_text>Data Preparation  Importing a dataset<jupyter_code>dataset = pd.read_csv('Position_Salaries.csv')
X = dataset.iloc[:, 1:2].values
y = dataset.iloc[:, 2].values<jupyter_output><empty_output><jupyter_text>Decision Tree Regression  Fitting the model to the dataset<jupyter_code>from sklearn.tree import DecisionTreeRegressor
regressor = DecisionTreeRegressor(random_state=0)
regressor.fit(X, y)<jupyter_output><empty_output><jupyter_text>Predicting a new result<jupyter_code>regressor.predict(6.5)<jupyter_output><empty_output><jupyter_text>Visualising the Regression results<jupyter_code>X_grid = np.arange(min(X), max(X), 0.01)
X_grid = X_grid.reshape((len(X_grid), 1))
plt.scatter(X, y, color='red')
plt.plot(X_grid, regressor.predict(X_grid), color='blue')
plt.title('Truth or Bluff (Decision Tree Regression)')
plt.xlabel('Position level')
plt.ylabel('Salary')
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13733905579399142, 'fraction_numerical': 0.01072961373390558, 'mean_word_length': 10.240963855421686, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '484908', 'license': 'MIT', 'n_tokens_mistral': 371, 'n_tokens_neox': 349, 'n_words': 55, 'path': 'Regression jupyter notebooks/s08_decision_tree.ipynb', 'repo_name': 'siddharthjain1611/Machine_Learning-A-Z-', 'size': '932'}