Skip to main content

No project description provided

Project description

Fastreport

Get report of different metrices for classification and regression problem for many popular algorithms with single line of code. You have to pass only features(dataframe) and target(series) as arguments

Link to PyPI

Link to Classification detailed example

Link to Regression detailed example

Installation

Run the following to install:

pip install fastreport

Install sklearn and xgboost

pip install sklearn
pip install xgboost

Usage

Classification

import report


report.report_classification(df_features,df_target,algorithms='default',test_size=0.3,scaling=None,
                             large_data=False,encode='dummy',average='binary',change_data_type = False,
                             threshold=8,random_state=None):
parameters
----------------------------

df_features : Pandas DataFrame

df_target : Pandas Series

algorithms : List ,'default'=
             [LogisticRegression(),
             GaussianNB(),
             DecisionTreeClassifier(),
             RandomForestClassifier(),
             GradientBoostingClassifier(),
             AdaBoostClassifier(),
             XGBClassifier()]
             The above are the default algorithms, if one needs any specific algorithms, they have to import
             libraries then pass the instances of alogorith as list
             For example, if one needs random forest and adaboost only, then pass 

             algorithms=[RandomForestClassifier(max_depth=8),AdaBoostClassifier()]
             But, these libraries must be imported before passing into above list like


test_size: If float, should be between 0.0 and 1.0 and represent the proportion of the 
           dataset to include in the test split.

scaling : {'standard-scalar', 'min-max'} or None , default=None

encode : {'dummy','onehot','label'} ,default='dummy'

change_data_type : bool, default=False
                   Some columns will be of numerical datatype though there are only 2-3 unique values in that column,
                   so these columns must be converted to object as it is more relevant.
                   By setting change_data_type= True , these columns will be converted into object datatype

threshold : int ,default=8
            Maximum unique value a column can have

large_data : bool, default=False
            If the dataset is large then the parameter large_data should be set to True, 
            make sure if your system has enough memory before setting Large_data=True


average : {'micro', 'macro', 'samples','weighted', 'binary'} or None, default='binary'
This parameter is required for multiclass/multilabel targets.
If ``None``, the scores for each class are returned. Otherwise, this
determines the type of averaging performed on the data:

``'binary'``:
    Only report results for the class specified by ``pos_label``.
    This is applicable only if targets (``y_{true,pred}``) are binary.
``'micro'``:
    Calculate metrics globally by counting the total true positives,
    false negatives and false positives.
``'macro'``:
    Calculate metrics for each label, and find their unweighted
    mean.  This does not take label imbalance into account.
``'weighted'``:
    Calculate metrics for each label, and find their average weighted
    by support (the number of true instances for each label). This
    alters 'macro' to account for label imbalance; it can result in an
    F-score that is not between precision and recall.
``'samples'``:
    Calculate metrics for each instance, and find their average (only
    meaningful for multilabel classification where this differs from
    :func:`accuracy_score`).

random_state : int, RandomState instance or None, default=None

Regression

import report

report.report_regression(df_features,df_target,algorithms='default',test_size=0.3,
                      scaling=None,large_data=False,change_data_type=True,encode='dummy',
                      threshold=8,random_state=None):
parameters
----------------------------

df_features : Pandas DataFrame

df_target : Pandas Series

 algorithms : List ,'default'=
             [LinearRegression(),
             Lasso(),
             Ridge(),
             RandomForestRegressor(),
             GradientBoostingRegressor(),
             AdaBoostRegressor(),
             XGBRegressor]
             The above are the default algorithms, if one needs any specific algorithms, they have to import
             libraries then pass the instances of alogorith as list
             For example, if one needs random forest and adaboost only, then pass 

             algorithms=[RandomForestRegressor(max_depth=8),AdaBoostRegressor()]
             But, these libraries must be imported before passing into above list like

test_size: If float, should be between 0.0 and 1.0 and represent the proportion of the 
           dataset to include in the test split.

scaling : {'Standard-scalar', 'min-max'} or None , default=None

encode : {'dummy','onehot','label'} ,default='dummy'

change_data_type : bool, default=False
                   Some columns will be of numerical datatype though there are only 2-3 unique values in that column,
                   so these columns must be converted to object as it is more relevant.
                   By setting change_data_type= True , these columns will be converted into object datatype

threshold : int ,default=8
            Maximum unique value a column can have

large_data : bool, default=False
            If the dataset is large then the parameter large_data should be set to True, 
            make sure if your system has enough memory before setting Large_data=True

random_state : int, RandomState instance or None, default=None

Future works

  1. Optimization
  2. Add more functionality

Drawbacks

  1. Not suitable for very large datasets
  2. Limited to existing users only

License

© 2021 KISHORE S This repository is licensed under the MIT license. See LICENSE for details.

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

fastreport-0.0.6.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastreport-0.0.6-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file fastreport-0.0.6.tar.gz.

File metadata

  • Download URL: fastreport-0.0.6.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.5.0.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for fastreport-0.0.6.tar.gz
Algorithm Hash digest
SHA256 2d968af523f0f80b2a0a3e388d3c26e951bb9576bd5b610d771dc30717f15046
MD5 7bc13e3af665ea1e54636cca070e0e11
BLAKE2b-256 df595f097f8d2ede8f1b5ccbb927c70d1355ebb9b622f406702ea2ab29ea60c3

See more details on using hashes here.

File details

Details for the file fastreport-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: fastreport-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.5.0.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for fastreport-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 07fc68ac44a889ba6fa644e5041766fdace7006b169983a6a58e11ec3bf55be2
MD5 ad15ccb5379eb59909a01747029adff8
BLAKE2b-256 3bb2d81fa0bde7a4368428655e62fdcf37a49332735f5ea95cc01cd95427878d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page