Package: bciavm
The Blockchain & Climate Institute (BCI) is a progressive think tank providing leading expertise in the deployment of emerging technologies for climate and sustainability actions.As an international network of scientific and technological experts, BCI is at the forefront of innovative efforts, enabling technology transfers, to create a sustainable and clean global future.Automated Valuation Model (AVM)AboutAVM is a term for a service that uses mathematical modeling combined with databases of existing properties and transactions to calculate real estate values.
The majority of automated valuation models (AVMs) compare the values of similar properties at the same point in time.
Many appraisers, and even Wall Street institutions, use this type of model to value residential properties. (seeWhat is an AVMInvestopedia.com)For more detailed info about the AVM, please read theAboutpaper in theresources directory.Valuation ProcessKey FunctionalitySupervised algorithmsTree-based & deep learning algorithmsFeature engineering derived from small clusters of similar propertiesEnsemble (value blending) approachesSet the required AWS Environment VariablesexportACCESS_KEY=YOURACCESS_KEYexportSECRET_KEY=YOURSECRET_KEYexportBUCKET_NAME=bci-transition-risk-dataexportTABLE_DIRECTORY=/dbfs/FileStore/tables/Installfrom PyPIpipinstallbciavmStartLoad the training data from the BCI S3 bucketfrombciavm.core.configimportyour_bucketfrombciavm.utils.bci_utilsimportReadParquetFile,get_postcodeOutcode_from_postcode,get_postcodeArea_from_outcode,drop_outliers,preprocess_dataimportpandasaspddfPricesEpc=pd.DataFrame()dfPrices=pd.DataFrame()yearArray=['2020','2019']foryearinyearArray:singlePriceEpcFile=pd.DataFrame(ReadParquetFile(your_bucket,'epc_price_data/byDate/2021-02-04/parquet/'+year))dfPricesEpc=dfPricesEpc.append(singlePriceEpcFile)dfPricesEpc['POSTCODE_OUTCODE']=dfPricesEpc['Postcode'].apply(get_postcodeOutcode_from_postcode)dfPricesEpc['POSTCODE_AREA']=dfPricesEpc['POSTCODE_OUTCODE'].apply(get_postcodeArea_from_outcode)dfPricesEpc.groupby('TypeOfMatching_m').count()['Postcode']Preprocess & split the data for training/testingimportbciavmX_train,X_test,y_train,y_test=bciavm.preprocess_data(dfPricesEpc)Build the pipeline and get the default pipeline parametersfrombciavm.pipelinesimportRegressionPipelineclassAVMPipeline(RegressionPipeline):custom_name='AVM Pipeline'component_graph={"Preprocess Transformer":["Preprocess Transformer"],'Imputer':['Imputer',"Preprocess Transformer"],'One Hot Encoder':['One Hot Encoder',"Imputer"],'K Nearest Neighbors Regressor':['K Nearest Neighbors Regressor','One Hot Encoder'],"XGBoost Regressor":["XGBoost Regressor",'One Hot Encoder'],'MultiLayer Perceptron Regressor':['MultiLayer Perceptron Regressor','One Hot Encoder'],'Final Estimator':['Linear Regressor',"XGBoost Regressor",'MultiLayer Perceptron Regressor','K Nearest Neighbors Regressor']}avm_pipeline=AVMPipeline(parameters={})avm_pipeline.parametersFit the pipelineavm_pipeline.fit(X_train,y_train)Score the pipelineavm_pipeline.score(X_test,y_test,objectives=['MAPE','MdAPE','ExpVariance','MaxError','MedianAE','MSE','MAE','R2','Root Mean Squared Error'])Next StepsRead more about bciAVM on ourdocumentation page:How does it relate to BCI Risk Modeling?Technical & financial support provided by CCG Analytics