Code Monkey home page Code Monkey logo

ml-package-based-on-sklearn's Introduction

ML-Package-based-on-sklearn

It is a class called ModelCompare with a few public methods and members

METHODS

init(inp)

1.params
inp= inp is a dictionary
the keys are nick names of models while values are official names of them
and they are all provided as strings
eg:
inp={'rf':'RandomForestClassifier','svc':"SVC"}

loadData(x,y)

1.PARAMS
x= the characters of the whole dataset
y= labels of the whole dataset
2.FUCTION load dataset to the object

fit()

1.FUNCTION
fit the input dataset with default params
in this fuction, the input dataset will be split into train and test parts
and they are storaged in the private members __x_train __x_test and so on

predict(test)

1.PARAMS
test= the dataset for testing
2.FUNCTION
predict the dataset with all the models storaged in private member __models
the results are stored in a public member predict_data
it is a dictionary whose keys are nicknames of models while values are lists of predictions

showAccurancy()

1.FUNCTION
show accurancy value of all models
IT USES MODELS WITH DEFAULT PARAMS (I.E THE MODELS TRAINED BY FIT METHOD)
the datasets are split in fit method
the results are stored in a private member __scores
it is a dict whose keys are nicknames while values are float

showCrossValScore()

1.FUNCTION
show cross val score of all models
the models have best params which are trained by GridSearch method
I.E THIS METHOD CAN ONLY BE USED AFTER YOU USE GRIDSEARCH METHOD
results are stored in a private member __cross_val_scores
it is a dict whose keys are nicknames while values are lists of scores

GridSearch()

1.FUNCTION
search best params for all models
best params are stored in a private member __best_params
it is a dict whose keys are nicknames and values are dicts
these dicts has structures as {'param_name':param}

best scores are stored as private dict __best_scores

OfficialVoting(inp,test)

1.PARAMS
inp= a list of strings consisting of names
names can be official names or nicknames
test= dataset for testing
2.FUNCTION
hard voting classifier with input models
return a dataframe of predictions
models are trained by this voting model

HardVoting(inp,test)

1.PARAMS
inp= a list of strings consisting of names and they can be nicknames or official names
test= dataset for testing
2.FUNCTION
use models trained in gridsearch for hard voting
RESULTS ARE RETURNDED IN A LIST

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.