我正在做一个预测房价的项目,并希望使用 streamlit 进行部署。
# Take the users input
Lot_Area = st.number_input('LotArea')
Year_Built = st.number_input('YearBuilt')
Total_rooms = st.number_input('TotRmsAbvGrd')
# store the inputs
features = [Lot_Area, Year_Built, Total_rooms]
# convert user inputs into an array fr the model
int_features = [int(x) for x in features]
final_features = [np.array(int_features)]
if st.button('Predict'): # when the submit button is pressed
prediction = model.predict(final_features)
st.balloons()
st.success(f'The house price is: $ {round(prediction[0], 2)}')
但是,当我使用流运行 app.py 在终端中运行时,它会在我的网络浏览器中打开,但出现以下错误:
NameError: name 'true' is not defined Traceback: File "c:\users\anju\anaconda3\lib\site-packages\streamlit\ScriptRunner.py", line 322, in _run_script exec(code, module.dict ) File " C:\Users\Anju\app.py”,第 1468 行,在“滚动”中:true
你能帮我解决这个问题吗?