Giter VIP home page Giter VIP logo

decision-trees-classifier's Introduction

GitHub Logo

Decision Trees Classifier

We have seen how decision trees work. Let's try to solve a classification problem using decision trees.

Task 1: Load the dataset

Write a function load_data that loads a dataset with numpy's loadtext api

  • Accepts the following parameter
    • path to file (str)
    • skiprows (header rows to be skipped)

Task 2: Write a function called myDecisionClassifier()

  • Accepts the following parameters:

    • X_train, y_train, X_test (Numpy arrays for training, testing; any format acceptable by sklearn will work)
    • paramgrid (list of parameters (including those of the classfier) for RandomizedSearchCV)
    • n_iter_search (Number of iterations the search will be run)
    • KFold (the number of k-folds to be used in cross-validation) (Optional) (Default 3)
    • early_stopping_rounds (Int) (Optional) (Default 10)
    • seed (a number; a subsequent call to the function with the same seed will reproduce the same results)(optional) (Default 42)
    • **kwargs (To set parameters to the base classifier)
  • Should return

    • predictions for X_test
    • trained RandomizedSearchCV object

Task 3: Figure out the best parameters for Pima Indian Diabetes Dataset

  • Write a function called finetune_class which

    • Takes in X_train, X_test, y_train, param_grid, n_iter_search
    • Returns y_pred_test, Trained RandomizedSearch Object
  • You will use myDecisionClassifier() function

  • Based on the stage-wise optimization values further fine tune the model

  • You will need to provide a parameter grid to the said function, be careful to choose which values to be optimized.

decision-trees-classifier's People

Contributors

mudassirkhan19 avatar

Watchers

Soumendra Prasad Dhanee avatar James Cloos avatar Suraj Jadhav avatar PradeepJaiswar avatar Mayuresh Suresh Shilotri avatar  avatar Sangam Angre avatar Shweta Doshi 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.