quicklearnkit 0.0.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
quicklearn/__init__.py ADDED
@@ -0,0 +1,2 @@
1
+ from .quickimports import *
2
+ from .utils import create_random
@@ -0,0 +1,90 @@
1
+ from sklearn.linear_model import LogisticRegression as logisticregression
2
+ from sklearn.neighbors import KNeighborsClassifier as knnclassifier
3
+ from sklearn.tree import DecisionTreeClassifier as decisiontreeclassifier
4
+ from sklearn.ensemble import RandomForestClassifier as randomforestclassifier
5
+ from sklearn.ensemble import GradientBoostingClassifier as gradientboostingclassifier
6
+ from sklearn.ensemble import AdaBoostClassifier as adaboostclassifier
7
+ from xgboost import XGBClassifier as xgboostclassifier
8
+ from sklearn.svm import SVC as supportvectorclassifer
9
+
10
+
11
+ class LogisticRegressionmodel:
12
+ def __init__(self, **kwargs):
13
+ self.model = logisticregression(**kwargs)
14
+
15
+ def fit(self, X,y):
16
+ self.model.fit(X,y)
17
+
18
+ def predict(self,X):
19
+ self.model.predict(X)
20
+
21
+
22
+ class KNeighborsClassifiermodel:
23
+ def __init__(self, **kwargs):
24
+ self.model = knnclassifier(**kwargs)
25
+
26
+ def fit(self, X,y):
27
+ self.model.fit(X,y)
28
+
29
+ def predict(self,X):
30
+ self.model.predict(X)
31
+
32
+ class DecisionTreeClassifiermodel:
33
+ def __init__(self, **kwargs):
34
+ self.model = decisiontreeclassifier(**kwargs)
35
+
36
+ def fit(self,X,y):
37
+ self.model.fit(X,y)
38
+
39
+ def predict(self, X):
40
+ self.model.predict(X)
41
+
42
+ class RandomForestClassifiermodel:
43
+ def __init__(self, **kwargs):
44
+ self.model = randomforestclassifier(**kwargs)
45
+
46
+ def fit(self, X,y):
47
+ self.model.fit(X,y)
48
+
49
+ def predict(self, X):
50
+ self.model.predict(X)
51
+
52
+ class GradientBoostingClassifiermodel:
53
+ def __init__(self, **kwargs):
54
+ self.model = gradientboostingclassifier(**kwargs)
55
+
56
+ def fit(self, X,y):
57
+ self.model.fit(X,y)
58
+
59
+ def predict(self, X):
60
+ self.model.predict(X)
61
+
62
+ class AdaBoostClassifiermodel:
63
+ def __init__(self, **kwargs):
64
+ self.model = adaboostclassifier(**kwargs)
65
+
66
+ def fit(self, X,y):
67
+ self.model.fit(X,y)
68
+
69
+ def predict(self, X):
70
+ self.model.predict(X)
71
+
72
+ class SVClassifiermodel:
73
+ def __init__(self, **kwargs):
74
+ self.model = supportvectorclassifer(**kwargs)
75
+
76
+ def fit(self, X,y):
77
+ self.model.fit(X,y)
78
+
79
+ def predict(self, X):
80
+ self.model.predict(X)
81
+
82
+ class XGBClassifiermodel:
83
+ def __init__(self, **kwargs):
84
+ self.model = xgboostclassifier(**kwargs)
85
+
86
+ def fit (self, X,y):
87
+ self.model.fit(X,y)
88
+
89
+ def predict(self, X):
90
+ self.model.fit(X)
@@ -0,0 +1,21 @@
1
+ #from .regression import LinearRegression, KNeighborsRegression, DecisionTreeRegression, RandomForestRegression, AdaBoostRegression, GradientBoostingRegression, XGBRegressor,SVR
2
+ #from .classifier import LogisticRegression, KNeighborsClassifier, DecisionTreeClassifier, RandomForestClassifier, AdaBoostClassifier, GradientBoostingClassifier, XGBClassifier, SVC
3
+
4
+ #__all__= [
5
+ # 'LinearRegression', ' KNeighborsRegressor', 'DecisionTreeRegressor', 'RandomForestRegressor', 'AdaBoostRegressor', 'GradientBoostingRegressor', 'XGBRegressor', 'SVR',
6
+ # 'LogisticRegression', 'KNeighborsClassifier', 'DecisionTreeClassifier', 'RandomForestClassifier', 'AdaBoostClassifier', 'GradientBoostingClassifier', 'XGBClassifier', 'SVC'
7
+ #]
8
+
9
+ from .regressor import LinearRegressionmodel, KNNRegressionmodel, DecisionTreeRegressionmodel, RandomForestRegressionmodel, GradientBoostingRegressionmodel, AdaBoostRegressionmodel, XGBoostRegressionmodel, ElasticNetRegressionmodel
10
+ from .classifier import LogisticRegressionmodel, KNeighborsClassifiermodel, DecisionTreeClassifiermodel, RandomForestClassifiermodel, AdaBoostClassifiermodel, GradientBoostingClassifiermodel, XGBClassifiermodel, SVClassifiermodel
11
+ from .utils import create_random
12
+
13
+ __all__=[
14
+ 'LinearRegressionmodel','LogisticRegressionmodel', 'KNNRegressionmodel','GradientBoostingRegressionmodel',
15
+ 'AdaBoostRegressionmodel', 'XGBoostRegressionmodel', 'ElasticNetRegressionmodel',
16
+ 'DecisionTreeRegressionmodel', 'RandomForestRegressionmodel',
17
+ 'KNeighborsClassifiermodel', 'DecisionTreeClassifiermodel', 'RandomForestClassifiermodel','AdaBoostClassifiermodel',
18
+ 'GradientBoostingClassifiermodel', 'XGBClassifiermodel', 'SVClassifiermodel',
19
+ 'create_random'
20
+ ]
21
+
@@ -0,0 +1,92 @@
1
+ from sklearn.linear_model import LinearRegression as linearregression
2
+ from sklearn.neighbors import KNeighborsRegressor as knnregressor
3
+ from sklearn.tree import DecisionTreeRegressor as decisiontreeregressor
4
+ from sklearn.ensemble import RandomForestRegressor as randomforestregressor
5
+ from sklearn.ensemble import GradientBoostingRegressor as gradientboostingregressor
6
+ from sklearn.ensemble import AdaBoostRegressor as adaboostregressor
7
+ from xgboost import XGBRegressor as xgboostregressor
8
+ from sklearn.svm import SVR as supportvectorregressor
9
+ from sklearn.linear_model import ElasticNet as elasticnetregressor
10
+
11
+
12
+
13
+ class LinearRegressionmodel:
14
+ def __init__(self, **kwargs):
15
+ self.model = linearregression(**kwargs)
16
+
17
+ def fit(self, X,y):
18
+ self.model.fit(X,y)
19
+
20
+ def predict(self,X):
21
+ self.model.predict(X)
22
+
23
+
24
+ class KNNRegressionmodel:
25
+ def __init__(self, **kwargs):
26
+ self.model = knnregressor(**kwargs)
27
+
28
+ def fit(self, X, y):
29
+ self.model.fit(X,y)
30
+
31
+ def predict(self, X):
32
+ self.model.predict(X)
33
+
34
+ class DecisionTreeRegressionmodel:
35
+ def __init__(self, **kwargs):
36
+ self.model = decisiontreeregressor(**kwargs)
37
+
38
+ def fit(self,X,y):
39
+ self.model.fit(X,y)
40
+
41
+ def predict(self, X):
42
+ self.model.predict(X)
43
+
44
+ class RandomForestRegressionmodel:
45
+ def __init__(self, **kwargs):
46
+ self.model = randomforestregressor(**kwargs)
47
+
48
+ def fit(self, X, y):
49
+ self.model.fit(X,y)
50
+
51
+ def predict(self,X):
52
+ self.model.predict(X)
53
+
54
+ class GradientBoostingRegressionmodel:
55
+ def __init__(self, **kwargs):
56
+ self.model = randomforestregressor(**kwargs)
57
+
58
+ def fit(self, X, y):
59
+ self.model.fit(X,y)
60
+
61
+ def predict(self,X):
62
+ self.model.predict(X)
63
+
64
+ class AdaBoostRegressionmodel:
65
+ def __init__(self, **kwargs):
66
+ self.model = adaboostregressor(**kwargs)
67
+
68
+ def fit(self, X, y):
69
+ self.model.fit(X,y)
70
+
71
+ def predict(self,X):
72
+ self.model.predict(X)
73
+
74
+ class XGBoostRegressionmodel:
75
+ def __init__(self, **kwargs):
76
+ self.model = xgboostregressor(**kwargs)
77
+
78
+ def fit(self, X, y):
79
+ self.model.fit(X,y)
80
+
81
+ def predict(self,X):
82
+ self.model.predict(X)
83
+
84
+ class ElasticNetRegressionmodel:
85
+ def __init__(self, **kwargs):
86
+ self.model = elasticnetregressor(**kwargs)
87
+
88
+ def fit(self, X, y):
89
+ self.model.fit(X,y)
90
+
91
+ def predict(self,X):
92
+ self.model.predict(X)
quicklearn/utils.py ADDED
@@ -0,0 +1,39 @@
1
+ import numpy as np
2
+
3
+ def create_random(mean, std, size, random_state=None):
4
+ """
5
+ Generate random data with a specified mean and standard deviation.
6
+
7
+ Parameters:
8
+ mean (float): Desired mean of the data.
9
+ std (float): Desired standard deviation of the data.
10
+ size (int): Length of the data to generate.
11
+ random_state (int, optional): Seed for reproducibility. Defaults to None.
12
+
13
+ Returns:
14
+ dict: A dictionary containing:
15
+ - "data": Random data with the specified mean and standard deviation.
16
+ - "mean": Actual mean of the generated data.
17
+ - "std": Actual standard deviation of the generated data.
18
+
19
+ Raises:
20
+ ValueError: If std is negative or size is not a positive integer.
21
+ """
22
+ if std < 0:
23
+ raise ValueError("Standard deviation must be non-negative.")
24
+ if size <= 0:
25
+ raise ValueError("Size must be a positive integer.")
26
+
27
+ # Create a random number generator instance
28
+ rng = np.random.default_rng(random_state)
29
+
30
+ # Generate random normal data
31
+ x = rng.normal(size=size)
32
+ x1 = (x - np.mean(x)) / np.std(x)
33
+ x2 = (x1 * std) + mean
34
+
35
+ return {
36
+ "data": x2,
37
+ "mean": np.mean(x2),
38
+ "std": np.std(x2)
39
+ }
@@ -0,0 +1,2 @@
1
+ from .quickimports import *
2
+ from .utils import create_random
@@ -0,0 +1,90 @@
1
+ from sklearn.linear_model import LogisticRegression as logisticregression
2
+ from sklearn.neighbors import KNeighborsClassifier as knnclassifier
3
+ from sklearn.tree import DecisionTreeClassifier as decisiontreeclassifier
4
+ from sklearn.ensemble import RandomForestClassifier as randomforestclassifier
5
+ from sklearn.ensemble import GradientBoostingClassifier as gradientboostingclassifier
6
+ from sklearn.ensemble import AdaBoostClassifier as adaboostclassifier
7
+ from xgboost import XGBClassifier as xgboostclassifier
8
+ from sklearn.svm import SVC as supportvectorclassifer
9
+
10
+
11
+ class LogisticRegressionmodel:
12
+ def __init__(self, **kwargs):
13
+ self.model = logisticregression(**kwargs)
14
+
15
+ def fit(self, X,y):
16
+ self.model.fit(X,y)
17
+
18
+ def predict(self,X):
19
+ self.model.predict(X)
20
+
21
+
22
+ class KNeighborsClassifiermodel:
23
+ def __init__(self, **kwargs):
24
+ self.model = knnclassifier(**kwargs)
25
+
26
+ def fit(self, X,y):
27
+ self.model.fit(X,y)
28
+
29
+ def predict(self,X):
30
+ self.model.predict(X)
31
+
32
+ class DecisionTreeClassifiermodel:
33
+ def __init__(self, **kwargs):
34
+ self.model = decisiontreeclassifier(**kwargs)
35
+
36
+ def fit(self,X,y):
37
+ self.model.fit(X,y)
38
+
39
+ def predict(self, X):
40
+ self.model.predict(X)
41
+
42
+ class RandomForestClassifiermodel:
43
+ def __init__(self, **kwargs):
44
+ self.model = randomforestclassifier(**kwargs)
45
+
46
+ def fit(self, X,y):
47
+ self.model.fit(X,y)
48
+
49
+ def predict(self, X):
50
+ self.model.predict(X)
51
+
52
+ class GradientBoostingClassifiermodel:
53
+ def __init__(self, **kwargs):
54
+ self.model = gradientboostingclassifier(**kwargs)
55
+
56
+ def fit(self, X,y):
57
+ self.model.fit(X,y)
58
+
59
+ def predict(self, X):
60
+ self.model.predict(X)
61
+
62
+ class AdaBoostClassifiermodel:
63
+ def __init__(self, **kwargs):
64
+ self.model = adaboostclassifier(**kwargs)
65
+
66
+ def fit(self, X,y):
67
+ self.model.fit(X,y)
68
+
69
+ def predict(self, X):
70
+ self.model.predict(X)
71
+
72
+ class SVClassifiermodel:
73
+ def __init__(self, **kwargs):
74
+ self.model = supportvectorclassifer(**kwargs)
75
+
76
+ def fit(self, X,y):
77
+ self.model.fit(X,y)
78
+
79
+ def predict(self, X):
80
+ self.model.predict(X)
81
+
82
+ class XGBClassifiermodel:
83
+ def __init__(self, **kwargs):
84
+ self.model = xgboostclassifier(**kwargs)
85
+
86
+ def fit (self, X,y):
87
+ self.model.fit(X,y)
88
+
89
+ def predict(self, X):
90
+ self.model.fit(X)
@@ -0,0 +1,21 @@
1
+ #from .regression import LinearRegression, KNeighborsRegression, DecisionTreeRegression, RandomForestRegression, AdaBoostRegression, GradientBoostingRegression, XGBRegressor,SVR
2
+ #from .classifier import LogisticRegression, KNeighborsClassifier, DecisionTreeClassifier, RandomForestClassifier, AdaBoostClassifier, GradientBoostingClassifier, XGBClassifier, SVC
3
+
4
+ #__all__= [
5
+ # 'LinearRegression', ' KNeighborsRegressor', 'DecisionTreeRegressor', 'RandomForestRegressor', 'AdaBoostRegressor', 'GradientBoostingRegressor', 'XGBRegressor', 'SVR',
6
+ # 'LogisticRegression', 'KNeighborsClassifier', 'DecisionTreeClassifier', 'RandomForestClassifier', 'AdaBoostClassifier', 'GradientBoostingClassifier', 'XGBClassifier', 'SVC'
7
+ #]
8
+
9
+ from .regressor import LinearRegressionmodel, KNNRegressionmodel, DecisionTreeRegressionmodel, RandomForestRegressionmodel, GradientBoostingRegressionmodel, AdaBoostRegressionmodel, XGBoostRegressionmodel, ElasticNetRegressionmodel
10
+ from .classifier import LogisticRegressionmodel, KNeighborsClassifiermodel, DecisionTreeClassifiermodel, RandomForestClassifiermodel, AdaBoostClassifiermodel, GradientBoostingClassifiermodel, XGBClassifiermodel, SVClassifiermodel
11
+ from .utils import create_random
12
+
13
+ __all__=[
14
+ 'LinearRegressionmodel','LogisticRegressionmodel', 'KNNRegressionmodel','GradientBoostingRegressionmodel',
15
+ 'AdaBoostRegressionmodel', 'XGBoostRegressionmodel', 'ElasticNetRegressionmodel',
16
+ 'DecisionTreeRegressionmodel', 'RandomForestRegressionmodel',
17
+ 'KNeighborsClassifiermodel', 'DecisionTreeClassifiermodel', 'RandomForestClassifiermodel','AdaBoostClassifiermodel',
18
+ 'GradientBoostingClassifiermodel', 'XGBClassifiermodel', 'SVClassifiermodel',
19
+ 'create_random'
20
+ ]
21
+
@@ -0,0 +1,92 @@
1
+ from sklearn.linear_model import LinearRegression as linearregression
2
+ from sklearn.neighbors import KNeighborsRegressor as knnregressor
3
+ from sklearn.tree import DecisionTreeRegressor as decisiontreeregressor
4
+ from sklearn.ensemble import RandomForestRegressor as randomforestregressor
5
+ from sklearn.ensemble import GradientBoostingRegressor as gradientboostingregressor
6
+ from sklearn.ensemble import AdaBoostRegressor as adaboostregressor
7
+ from xgboost import XGBRegressor as xgboostregressor
8
+ from sklearn.svm import SVR as supportvectorregressor
9
+ from sklearn.linear_model import ElasticNet as elasticnetregressor
10
+
11
+
12
+
13
+ class LinearRegressionmodel:
14
+ def __init__(self, **kwargs):
15
+ self.model = linearregression(**kwargs)
16
+
17
+ def fit(self, X,y):
18
+ self.model.fit(X,y)
19
+
20
+ def predict(self,X):
21
+ self.model.predict(X)
22
+
23
+
24
+ class KNNRegressionmodel:
25
+ def __init__(self, **kwargs):
26
+ self.model = knnregressor(**kwargs)
27
+
28
+ def fit(self, X, y):
29
+ self.model.fit(X,y)
30
+
31
+ def predict(self, X):
32
+ self.model.predict(X)
33
+
34
+ class DecisionTreeRegressionmodel:
35
+ def __init__(self, **kwargs):
36
+ self.model = decisiontreeregressor(**kwargs)
37
+
38
+ def fit(self,X,y):
39
+ self.model.fit(X,y)
40
+
41
+ def predict(self, X):
42
+ self.model.predict(X)
43
+
44
+ class RandomForestRegressionmodel:
45
+ def __init__(self, **kwargs):
46
+ self.model = randomforestregressor(**kwargs)
47
+
48
+ def fit(self, X, y):
49
+ self.model.fit(X,y)
50
+
51
+ def predict(self,X):
52
+ self.model.predict(X)
53
+
54
+ class GradientBoostingRegressionmodel:
55
+ def __init__(self, **kwargs):
56
+ self.model = randomforestregressor(**kwargs)
57
+
58
+ def fit(self, X, y):
59
+ self.model.fit(X,y)
60
+
61
+ def predict(self,X):
62
+ self.model.predict(X)
63
+
64
+ class AdaBoostRegressionmodel:
65
+ def __init__(self, **kwargs):
66
+ self.model = adaboostregressor(**kwargs)
67
+
68
+ def fit(self, X, y):
69
+ self.model.fit(X,y)
70
+
71
+ def predict(self,X):
72
+ self.model.predict(X)
73
+
74
+ class XGBoostRegressionmodel:
75
+ def __init__(self, **kwargs):
76
+ self.model = xgboostregressor(**kwargs)
77
+
78
+ def fit(self, X, y):
79
+ self.model.fit(X,y)
80
+
81
+ def predict(self,X):
82
+ self.model.predict(X)
83
+
84
+ class ElasticNetRegressionmodel:
85
+ def __init__(self, **kwargs):
86
+ self.model = elasticnetregressor(**kwargs)
87
+
88
+ def fit(self, X, y):
89
+ self.model.fit(X,y)
90
+
91
+ def predict(self,X):
92
+ self.model.predict(X)
quicklearnkit/utils.py ADDED
@@ -0,0 +1,39 @@
1
+ import numpy as np
2
+
3
+ def create_random(mean, std, size, random_state=None):
4
+ """
5
+ Generate random data with a specified mean and standard deviation.
6
+
7
+ Parameters:
8
+ mean (float): Desired mean of the data.
9
+ std (float): Desired standard deviation of the data.
10
+ size (int): Length of the data to generate.
11
+ random_state (int, optional): Seed for reproducibility. Defaults to None.
12
+
13
+ Returns:
14
+ dict: A dictionary containing:
15
+ - "data": Random data with the specified mean and standard deviation.
16
+ - "mean": Actual mean of the generated data.
17
+ - "std": Actual standard deviation of the generated data.
18
+
19
+ Raises:
20
+ ValueError: If std is negative or size is not a positive integer.
21
+ """
22
+ if std < 0:
23
+ raise ValueError("Standard deviation must be non-negative.")
24
+ if size <= 0:
25
+ raise ValueError("Size must be a positive integer.")
26
+
27
+ # Create a random number generator instance
28
+ rng = np.random.default_rng(random_state)
29
+
30
+ # Generate random normal data
31
+ x = rng.normal(size=size)
32
+ x1 = (x - np.mean(x)) / np.std(x)
33
+ x2 = (x1 * std) + mean
34
+
35
+ return {
36
+ "data": x2,
37
+ "mean": np.mean(x2),
38
+ "std": np.std(x2)
39
+ }
@@ -0,0 +1,26 @@
1
+ Metadata-Version: 2.4
2
+ Name: quicklearnkit
3
+ Version: 0.0.1
4
+ Summary: A simplified interface for machine learning algorithms.
5
+ Home-page: https://github.com/yourusername/quicklearn
6
+ Author: hazi
7
+ Author-email: hajiafribaba@gmail.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.6
12
+ Description-Content-Type: text/markdown
13
+ Requires-Dist: scikit-learn
14
+ Requires-Dist: pandas
15
+ Requires-Dist: numpy
16
+ Dynamic: author
17
+ Dynamic: author-email
18
+ Dynamic: classifier
19
+ Dynamic: description
20
+ Dynamic: description-content-type
21
+ Dynamic: home-page
22
+ Dynamic: requires-dist
23
+ Dynamic: requires-python
24
+ Dynamic: summary
25
+
26
+ This is an upcoming wrapper library for machine learning beginners and all the enthusisasts out there who want to reduce the time taken for projects, this library works on simple principle and it is gonna save lot of time in upcoming future
@@ -0,0 +1,14 @@
1
+ quicklearn/__init__.py,sha256=JyJhQb2M_RMI4_BtlFhPCWP5OYUCFaU7fNND80ILL7c,61
2
+ quicklearn/classifier.py,sha256=N4gDsxLbzZr8YWNPbwF3OIBVNRi8wmBn1VOPOfwc0ZM,2520
3
+ quicklearn/quickimports.py,sha256=uvzVaZb_rL_M8Za3ThIjZRItny6b8GFa-B9ZCB0l3o0,1744
4
+ quicklearn/regressor.py,sha256=IGwzmjOgyE8dggKg4E6tBJHVqycrHem_fKs4iaN5wmY,2583
5
+ quicklearn/utils.py,sha256=HUjAnphhXOQCRGzk8uyLXmRvDJVk4qSsSK10gUhAuO8,1298
6
+ quicklearnkit/__init__.py,sha256=JyJhQb2M_RMI4_BtlFhPCWP5OYUCFaU7fNND80ILL7c,61
7
+ quicklearnkit/classifier.py,sha256=N4gDsxLbzZr8YWNPbwF3OIBVNRi8wmBn1VOPOfwc0ZM,2520
8
+ quicklearnkit/quickimports.py,sha256=uvzVaZb_rL_M8Za3ThIjZRItny6b8GFa-B9ZCB0l3o0,1744
9
+ quicklearnkit/regressor.py,sha256=IGwzmjOgyE8dggKg4E6tBJHVqycrHem_fKs4iaN5wmY,2583
10
+ quicklearnkit/utils.py,sha256=HUjAnphhXOQCRGzk8uyLXmRvDJVk4qSsSK10gUhAuO8,1298
11
+ quicklearnkit-0.0.1.dist-info/METADATA,sha256=my8HrHPwNzbt0oUYPbMoltOrBQnrOx5S2ZDAlLDaCDg,972
12
+ quicklearnkit-0.0.1.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
13
+ quicklearnkit-0.0.1.dist-info/top_level.txt,sha256=ySd2_K8q0dCUBRMpJo-tbYbfabnkGQZpDjbRQpyh9uw,14
14
+ quicklearnkit-0.0.1.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (80.3.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ quicklearnkit