Skip to content

Commit

Permalink
Update 0.1.4
Browse files Browse the repository at this point in the history
- Added 10 new classifiers and regressors
- Updated Documentation

Signed-off-by: Arsh <[email protected]>
  • Loading branch information
d4rk-lucif3r committed Aug 12, 2022
1 parent 17d4e44 commit cc00315
Show file tree
Hide file tree
Showing 7 changed files with 314 additions and 15 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ Our Goal is to democratize Machine Learning and make it accessible to everyone.
- "lcv": "LassoCV Classifier"
- "llic": "LassoLarsIC Classifier"
- "llcv": "LassoLarsCV Classifier"
- "ransac": "RANSACClassifiers",
- "ompcv": "OrthogonalMatchingPursuitCV Classifier",
- "omp": "OrthogonalMatchingPursuit Classifier",
- "iso": "IsotonicRegression Classifier",
- "rad": "RadiusNeighbors Classifier",
- "quantile": "QuantileRegression Classifier",
- "theil": "TheilSenRegressor Classifier",
- "lars": "Lars Classifeir",
- "lcv": "LarsCV Classifier",
- "tweedie": "TweedieClassifiers",
- "all": "All Classifiers"

2) Regression
Expand Down Expand Up @@ -84,6 +94,16 @@ Our Goal is to democratize Machine Learning and make it accessible to everyone.
- "lcv": "LassoCV Regressor"
- "llic": "LassoLarsIC Regressor"
- "llcv": "LassoLarsCV Regressor"
- "ransac": "RANSACRegressor",
- "ompcv": "OrthogonalMatchingPursuitCV",
- "gpr": "GaussianProcessRegressor",
- "omp": "OrthogonalMatchingPursuit",
- "llars": "LassoLars",
- "iso": "IsotonicRegression",
- "fm": "Factorisation Machine Regressors",
- "rnr": "Radius Neighbors Regressor Regressors",
- "qr": "Quantile Regression Regressors",
- "theil": "TheilSenRegressor Regressors",
- "all": "All Regressors"

### Usage Example
Expand Down
20 changes: 20 additions & 0 deletions anai/supervised/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ def __init__(
"lcv": "LassoCV Classifier",\n
"llic": "LassoLarsIC Classifier",\n
"llcv": "LassoLarsCV Classifier",\n
"ransac": "RANSACClassifiers",\n
"ompcv": "OrthogonalMatchingPursuitCV Classifier",\n
"omp": "OrthogonalMatchingPursuit Classifier",\n
"iso": "IsotonicRegression Classifier",\n
"rad": "RadiusNeighbors Classifier",\n
"quantile": "QuantileRegression Classifier",\n
"theil": "TheilSenRegressor Classifier",\n
"lars": "Lars Classifeir",\n
"lcv": "LarsCV Classifier",\n
"tweedie": "TweedieClassifiers",\n
"all": "All Classifiers",\n
params : dict
contains parameters for model
Expand Down Expand Up @@ -853,6 +863,16 @@ def __init__(
"lcv": "LassoCV Regressor",\n
"llic": "LassoLarsIC Regressor",\n
"llcv": "LassoLarsCV Regressor",\n
"ransac": "RANSACRegressor",\n
"ompcv": "OrthogonalMatchingPursuitCV",\n
"gpr": "GaussianProcessRegressor",\n
"omp": "OrthogonalMatchingPursuit",\n
"llars": "LassoLars",\n
"iso": "IsotonicRegression",\n
"fm": "Factorisation Machine Regressors",\n
"rnr": "Radius Neighbors Regressor Regressors",\n
"qr": "Quantile Regression Regressors",\n
"theil": "TheilSenRegressor Regressors",\n
"all": "All Regressors",\n
params : dict
contains parameters for model
Expand Down
46 changes: 43 additions & 3 deletions anai/utils/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@
"lcv": "LassoCV Classifier",
"llic": "LassoLarsIC Classifier",
"llcv": "LassoLarsCV Classifier",
"ransac": "RANSACClassifiers",
"ompcv": "OrthogonalMatchingPursuitCV Classifier",
"omp": "OrthogonalMatchingPursuit Classifier",
"iso": "IsotonicRegression Classifier",
"rad": "RadiusNeighbors Classifier",
"quantile": "QuantileRegression Classifier",
"theil": "TheilSenRegressor Classifier",
"lars": "Lars Classifeir",
"lcv": "LarsCV Classifier",
"tweedie": "TweedieClassifiers",
}

regressors = {
Expand All @@ -55,14 +65,24 @@
"xgb": "XGBoost Regressor",
"cat": "Catboost Regressor",
"ann": "Multi-Layer Perceptron Regressor",
# "poisson": "Poisson Regressor",
"poisson": "Poisson Regressor",
"huber": "Huber Regressor",
"gamma": "Gamma Regressor",
"ridge": "Ridge CV Regressor",
"encv": "ElasticNetCV Regressor",
"lcv": "LassoCV Regressor",
# "llic": "LassoLarsIC Regressor",
# "llcv": "LassoLarsCV Regressor",
"llic": "LassoLarsIC Regressor",
"llcv": "LassoLarsCV Regressor",
"ransac": "RANSACRegressor",
"ompcv": "OrthogonalMatchingPursuitCV",
"gpr": "GaussianProcessRegressor",
"omp": "OrthogonalMatchingPursuit",
"llars": "LassoLars",
"iso": "IsotonicRegression",
"fm": "Factorisation Machine Regressors",
"rnr": "Radius Neighbors Regressor Regressors",
"qr": "Quantile Regression Regressors",
"theil": "TheilSenRegressor Regressors",
}

classifiers_ver = {
Expand Down Expand Up @@ -91,6 +111,16 @@
"lcv": "LassoCV Classifier",
"llic": "LassoLarsIC Classifier",
"llcv": "LassoLarsCV Classifier",
"ransac": "RANSACClassifiers",
"ompcv": "OrthogonalMatchingPursuitCV Classifier",
"omp": "OrthogonalMatchingPursuit Classifier",
"iso": "IsotonicRegression Classifier",
"rad": "RadiusNeighbors Classifier",
"quantile": "QuantileRegression Classifier",
"theil": "TheilSenRegressor Classifier",
"lars": "Lars Classifeir",
"lcv": "LarsCV Classifier",
"tweedie": "TweedieClassifiers",
"all": "All Classifiers",
}

Expand Down Expand Up @@ -120,6 +150,16 @@
"lcv": "LassoCV Regressor",
"llic": "LassoLarsIC Regressor",
"llcv": "LassoLarsCV Regressor",
"ransac": "RANSACRegressor",
"ompcv": "OrthogonalMatchingPursuitCV",
"gpr": "GaussianProcessRegressor",
"omp": "OrthogonalMatchingPursuit",
"llars": "LassoLars",
"iso": "IsotonicRegression",
"fm": "Factorisation Machine Regressors",
"rnr": "Radius Neighbors Regressor Regressors",
"qr": "Quantile Regression Regressors",
"theil": "TheilSenRegressor Regressors",
"all": "All Regressors",
}

Expand Down
63 changes: 57 additions & 6 deletions anai/utils/custom_models/wrapped_classifiers.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,79 @@
from anai.utils.wrappers.classification_shell import ClassificationWrapper
from sklearn.linear_model import (PoissonRegressor, GammaRegressor, LassoLarsIC,
LassoLarsCV)
from sklearn.linear_model import (GammaRegressor, LassoLarsCV, LassoLarsIC,
OrthogonalMatchingPursuit,
OrthogonalMatchingPursuitCV,
PoissonRegressor, QuantileRegressor,
RANSACRegressor, TheilSenRegressor,
TweedieRegressor)


class PoissonClassifier(ClassificationWrapper):
def __init__(self,num_classes=2, **params):
def __init__(self, num_classes=2, **params):
self.model = PoissonRegressor(**params)
self.num_classes = num_classes - 1


class GammaClassifier(ClassificationWrapper):
def __init__(self,num_classes=2, **params):
def __init__(self, num_classes=2, **params):
self.model = GammaRegressor(**params)
self.num_classes = num_classes - 1


class LassoLarsICClassifier(ClassificationWrapper):
def __init__(self,num_classes=2, **params):
def __init__(self, num_classes=2, **params):
self.model = LassoLarsIC(**params)
self.num_classes = num_classes - 1


class LassoLarsCVClassifier(ClassificationWrapper):
def __init__(self,num_classes=2, **params):
def __init__(self, num_classes=2, **params):
self.model = LassoLarsCV(**params)
self.num_classes = num_classes - 1


class TweedieClassifier(ClassificationWrapper):
def __init__(self, num_classes=2, **params):
self.model = TweedieRegressor(**params)
self.num_classes = num_classes - 1


# class GeneralizedLinearClassifier(ClassificationWrapper):
# def __init__(self,num_classes=2, **params):
# self.model = GeneralizedLinearRegressor(**params)
# self.num_classes = num_classes - 1


class RANSACClassifier(ClassificationWrapper):
def __init__(self, num_classes=2, **params):
self.model = RANSACRegressor(**params)
self.num_classes = num_classes - 1


class OrthogonalMatchingPursuitCVClassifier(ClassificationWrapper):
def __init__(self, num_classes=2, **params):
self.model = OrthogonalMatchingPursuitCV(**params)
self.num_classes = num_classes - 1


class OrthogonalMatchingPursuitClassifier(ClassificationWrapper):
def __init__(self, num_classes=2, **params):
self.model = OrthogonalMatchingPursuit(**params)
self.num_classes = num_classes - 1


# class AFMClassifier(ClassificationWrapper):
# def __init__(self,num_classes=2, **params):
# self.model = ComponentwiseGradientBoostingSurvivalAnalysis(**params)
# self.num_classes = num_classes - 1


class QuantileClassifier(ClassificationWrapper):
def __init__(self, num_classes=2, **params):
self.model = QuantileRegressor(**params)
self.num_classes = num_classes - 1


class TheilSenClassifier(ClassificationWrapper):
def __init__(self, num_classes=2, **params):
self.model = TheilSenRegressor(**params)
self.num_classes = num_classes - 1
Loading

0 comments on commit cc00315

Please sign in to comment.