#๐ python project on car price prediction using AI and machine learning
29 messages ยท Page 1 of 1 (latest)
@jaunty aspen
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
!code
!paste if it doesn't fit in 2000 characters
If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
I've pasted the code here: https://paste.pythondiscord.com/

please resolve the error
Itsnot visible
not really, wrong link
and also probably no one will resolve the problem for you, many are willing to help you solve it yourself though
I tried my best but I'm not able to solve it
you still haven't sent the code
where should I send?
after you paste in https://paste.pythondiscord.com/, you'll get a link containing your code
that's not python
maybe look for help in another server
or if you're using a related python module (like django or something) and the problem is there, someone can help with that
only first one is correct delete rest
from flask import Flask, render_template, request
import pandas as pd
import pickle
import numpy as np
app = Flask(__name__)
car = pd.read_csv("Cleaned car.csv")
model = pickle.load(open("LinearRegressionModel.pkl", 'rb'))
@app.route('/')
def index():
companies = sorted(car['company'].unique())
car_models = sorted(car['name'].unique())
year = sorted(car['year'].unique(), reverse=True)
fuel_type = car['fuel_type'].unique()
companies.insert(0, "Select Company")
return render_template('index.html', companies=companies, car_models=car_models, years=year, fuel_types=fuel_type)
@app.route('/predict', methods=['POST'])
def predict():
company = request.form.get('company')
car_model = request.form.get('car_model')
year = int(request.form.get('year'))
fuel_type = request.form.get('fuel_type')
kms_driven = int(request.form.get('kilo_driven'))
prediction = model.predict(pd.DataFrame([[car_model, company, year, kms_driven, fuel_type]], columns=['name', 'company', 'year', 'kms_driven', 'fuel_type']))
return str(np.round(prediction[0], 2))
if __name__ == "__main__":
app.run(debug=True)
bruh
@jaunty aspen is this?
I'm getting the following error on running this project
AttributeError: 'OneHotEncoder' object has no attribute '_infrequent_enabled'. Did you mean: '_check_infrequent_enabled'?
127.0.0.1 - - [27/May/2024 18:19:32] "GET /?debugger=yes&cmd=resource&f=style.css HTTP/1.1" 200 -
can someone please help with the error
could you please help in resolving the error
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.