[81a4e3]: / __pycache__ / app.cpython-310.pyc

Download this file

14 lines (14 with data), 1.5 kB

o

mªìf]ã@sþddlmZmZddlZddlmZmZddlZddl	Z
ddlZe
ddƒ
Ze e¡ZWdƒn1s5wYe
ddƒ
Ze e¡ZWdƒn1sOwYe
ddƒ
Ze e¡ZWdƒn1siwYeƒZe d¡d	efd
d„ƒZdS)é)Ú
PreprocessÚMissingValueN)ÚFastAPIÚRequestzmodel/columns.pklÚrbzmodel/scaler.pklzmodel/model.pklz	/predict/Úrequestc

Ãsîz]| ¡IdH}tj|dd}t|dddd}| |¡}t|ƒ}| ¡}|t}t 	|¡}d}t
 |¡}| ¡dj
}	| ¡dj
}
tj|tjd}| |
g|	|i¡}|d}d| ¡iWStyv}zdt|ƒiWYd}~Sd}~ww)	NÚrecords)Zorientr)Z	dataframeZmissing_value_perZvariance_thresholdZmin_null_perz(model/optimized_random_forest_model.onnx)ZdtypeZpredictionsÚerror)ÚjsonÚpdZ	read_jsonrÚ_mappingrZfill_dataframeÚcolsÚscZ	transformÚortZInferenceSessionZ
get_inputsÚnameZget_outputsÚnpZarrayZfloat32ÚrunÚtolistÚ	ExceptionÚstr)
rÚdataZdfZpreprocessorÚtestÚmZx_testZoptimized_model_pathÚsessionZ
input_nameZoutput_nameZy_predÚe©rú)C:\Users\mohammad\Desktop\q3 (2)\.\app.pyÚpredicts6€ü


€ÿr)ÚutilsrrÚpickleZfastapirrZpandasrZnumpyrZonnxruntimerÚopenÚfÚloadr
rÚmodelÚappZpostrrrrrÚ<module>s$ÿÿÿ