#๐Ÿ”’ python project on car price prediction using AI and machine learning

29 messages ยท Page 1 of 1 (latest)

west shellBOT
#

@jaunty aspen

Python help channel opened

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.

copper crescent
#

!code

west shellBOT
#
Formatting code on Discord

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

For long code samples, you can use our pastebin.

copper crescent
#

!paste if it doesn't fit in 2000 characters

west shellBOT
#
Pasting large amounts of code

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.

jaunty aspen
cyan orbit
jaunty aspen
#

please resolve the error

cyan orbit
#

Itsnot visible

copper crescent
cyan orbit
copper crescent
jaunty aspen
copper crescent
jaunty aspen
#

where should I send?

copper crescent
jaunty aspen
copper crescent
#

or if you're using a related python module (like django or something) and the problem is there, someone can help with that

west frost
#

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?

jaunty aspen
#

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

jaunty aspen
west shellBOT
#
Python help channel closed

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.