What’s wrong with this code
import pandas as pd
from sklearn.tree import DecisionTreeClassifier
income_data = pd.read_csv(‘C:\Waqar\Code with Mosh\Python Learning\Sample Income.csv’)
X = income_data.drop(columns = [‘Income’])
y = income_data[‘Income’]
model = DecisionTreeClassifier()
model.fit(X, y)
predictions = model.predict([2023])
hear is the data of csv file
Year | Income | |
---|---|---|
2015 | 50000 | |
2016 | 51000 | |
2017 | 52020 | |
2018 | 53060.4 | |
2019 | 54121.2 | |
2020 | 55203.42 | |
2021 | 56307.06 | |
2022 | 57433.14 |