Skip to main content

USEP price prediction

Project description



Nextstep integrates major popular machine learning algorithms, offering data scientists an all-in-one package. At the same time, it lifts the programming constraints by extracting key hyper-parameters into a configuration dictionary, empowering less experienced python users the ability to explore machine learning.

Nextstep was originally developed for a data science challenge which involved price prediction. So it has a dedicated module to obtain data (oil and weather) via open API or web-scraping. It evolves into a machine learning prediction toolkit.


First time installation

pip install nextstep

Upgrade to the latest version

pip install nextstep --upgrade

Quick Tutorial

getData module

generate oil prices

from nextstep.getData.oil import *

brent_daily.csv and wti_daily.csv will be generated at the current directory. They contain historical oil price until the most recent day.

generate weather data

This function relies on an API key from worldweatheronline. It is free for 60 days as of 27/3/2020. It will generate csv data files in the current directory.

from import weather
config = {
		'frequency' : 1,
		'start_date' : '01-Jan-2020',
		'end_date' : '31-Jan-2020',
		'api_key' : 'your api key here',
		'location_list' : ['singapore'],
		'location_label' : False

model module

Every ML model has a unique config. Please fill in accordingly.

random forest

# examples, please fill in according to your project scope
from nextstep.model.random_forest import random_forest
config = {
            'label_column' : 'USEP',
            'train_size' : 0.9,
            'seed' : 66,
            'n_estimators' : 10,
            'bootstrap' : True,
            'criterion' : 'mse',
            'max_features' : 'sqrt'
random_forest_shell = random_forest(config)

random_forest_shell.build_model(data) # build model


from nextstep.model.arima import arima
config = {
		'lag' : 7,
		'differencing' : 0,
		'window_size' : 2,
		'label_column' : 'USEP',
		'train_size' : 0.8,
		'seed' : 33
arima_shell = arima(config)

arima_shell.autocorrelation(data) # plot autocorrelation to determine p, lag order
arima_shell.partial_autocorrelation(data) # plot partial autocorrelation to determine q, moving average widow size
arima_shell.build_model(data) # build model

# residual plot to check model performance


Pull requests are welcome


yuesong YANG

bolin ZHU

Ziyue Yang

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nextstep-0.0.19.tar.gz (6.5 MB view hashes)

Uploaded source

Built Distribution

nextstep-0.0.19-py3-none-any.whl (18.3 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page