GithubHelp home page GithubHelp logo

nus-sds-singlife-dataminds's Introduction

DataMinds

Prediction Model for sales figures using Using Random Forest Regressor for ML Model and MSE & R-Square for model testing

Preparations:

pip3 install pandas
pip3 install matplotlib
pip3 install numpy
pip3 install scikit-learn

Training and testing MLmodel

python ML.py

You will find a mlmodel.h5 created in your directory

#Implement testing procedure

def testing_hidden_data(hidden_data: pd.DataFrame) -> list:
    dataset = hidden_data
    columns_to_drop = ["AccountID","Company","Industry","8-Digit SIC Code","8-Digit SIC Description","Entity Type","Parent Company","Parent Country","Ownership Type","Company Description","Sales (Global Ultimate Total USD)","Fiscal Year End","Global Ultimate Company","Global Ultimate Country","Domestic Ultimate Company"]
    dataset = dataset.drop(columns=[col for col in columns_to_drop if col in dataset.columns], errors='ignore')
    dataset = dataset[dataset["Company Status (Active/Inactive)"] == "Active"]
    dataset["Import/Export Status"] = dataset["Import/Export Status"].replace({'': '0','Imports':1, 'Exports':2,'Both Imports & Exports': 3})
    dataset = dataset.drop(["Company Status (Active/Inactive)"], axis=1)
    loaded_model = joblib.load('./mlmodel.h5')
    result = list(loaded_model.predict(dataset))
    return result

This test should output a list of predictions.

Make sure your dataset matches the format of catA_train.csv

test_df = pd.read_csv(filepath)
test_df = test_df.drop(columns=['Sales (Domestic Ultimate Total USD)'])
print(testing_hidden_data(test_df))

Do note that upon receiving requirements to pull down the original dataset for confidential purposes, the /data directory no longer exists. If you need original dataset format to test our model, please contact us at [email protected]

All Use of data is subject to approval of organizors

nus-sds-singlife-dataminds's People

Contributors

blankeeir avatar jiahong2003 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.