Code Monkey home page Code Monkey logo

canvass_codingchallenge's Introduction

Canvass_codingchallenge

Answers to the challenge

Task 1

Link for this notebook can be found here

Models used can be found in this folder, prefixed with Task1.

Assumptions

  1. For few turbines there are readings beyond today's date. For the interest of this analysis, I am going to assume these are valid readings
  2. Dealing with NAs in the dataset - median imputation.
  3. Cost for checking failures in wind turbines is lower than cost for failing to check for malfunctions/failures. False positives might not be a bad option in this case.
  4. Date range isn't continuous. Assuming the units do not fail in that period.
  5. If the window length of 40 isn't satisfied, padding with 0s. This assumes that there isn't going to be a failure (although right censored data). Check if padding with another number such as -1 helps with predictions .

Ideas

  1. LSTM using keras to model dependancy over period of 40 days. Used recall and auc-roc(area under curve) to evaluate model performance. This can be attributed to the imbalance in the dataset.
  2. Feature enginnering -- create a column possible_failure; mark it 1 if there is failure within a 40 day window, prior to the current observation for a turbine. This column can then be used as a predictor, as it now holds information about failures within a 40 days.
  3. Basic multi-label ensemble models using sci-kit learn (https://arxiv.org/pdf/1609.08349.pdf) - Explore hamming distance to evaluate models and scikit learn functions (http://scikit.ml/api/classify.html#ensemble-approaches)
  4. Kaplan meir estimates -- survival analysis based on failure events

To run best performing model:

Example use case:

from Task1 import RandomForestWrapper
import pandas as pd

t1 = RandomForestWrapper()
dummy_data = pd.read_csv('../data/forecasting_dataset.csv', parse_dates=[['date', 'time']]).sample(10)
dt = dummy_data.dropna().drop(['date_time','y'],axis = 1)
t1.predict(dt)

Where dt is the held out dataset

Task 2

Link for this notebook can be found here

Models used can be found in this folder, prefixed with Task2.

Assumptions

  1. No break in 1hour observation of data of the parameters. Fetching the 6th record to model pollution 6 hours later (ease of analysis)
  2. There are 365 rows with negative reading for pollution. Although this seems like an anomaly, ignoring it for the purpose of the analysis due to lack of domain knowledge. Try removing these observations and predicting
  3. Missing values have been imputed with their mean.

Ideas

  1. Imputing missing values with mean/mode of the column based on datatype.
  2. Compared various boosting (ensemble algorithms) as I'm dealing with a small dataset.
  3. Looking at adjusted $R^2$ along with mean square error to evaluate model performance. Tune best performing model.
  4. PCA shows that 5 features can explain close to 90% of the variance in the dataset. Perform PCA to reduce number of features for analysis.

To run best performing model on the held out dataset:

Example use case:

from Task2 import XGBoostWrapper
import pandas as pd

t2 = XGBoostWrapper()
dummy_data = pd.read_csv('../data/forecasting_dataset.csv', parse_dates=[['date', 'time']]).sample(10)
dt = dummy_data.dropna().drop(['date_time','y'],axis = 1)
t2.predict(dt)

Where dt is the held out dataset

canvass_codingchallenge's People

Contributors

abishek-murali avatar

Watchers

 avatar paper2code - bot 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.