regression-model-ibrahim 0.1.0__tar.gz

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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Belhamri Ibrahim
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,62 @@
1
+ Metadata-Version: 2.4
2
+ Name: regression-model-ibrahim
3
+ Version: 0.1.0
4
+ Summary: A simple linear regression model
5
+ Description-Content-Type: text/markdown
6
+ License-File: LICENSE.txt
7
+ Dynamic: description
8
+ Dynamic: description-content-type
9
+ Dynamic: license-file
10
+ Dynamic: summary
11
+
12
+ # Simple Linear Regression
13
+
14
+ A lightweight Python package that implements simple linear regression without external dependencies.
15
+
16
+ ## Features
17
+
18
+ - Train a linear regression model using `fit()`.
19
+ - Predict values using `predict()`.
20
+ - Estimate the slope and intercept of the best-fit line.
21
+
22
+ ## Installation
23
+
24
+ ```bash
25
+ pip install regression-model-ibrahim
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ ```python
31
+ from regression_model import SimpleLinearRegression
32
+
33
+ model = SimpleLinearRegression()
34
+
35
+ # Training data
36
+ X = [1, 2, 3]
37
+ y = [2, 4, 6]
38
+
39
+ # Train the model
40
+ model.fit(X, y)
41
+
42
+ # Make predictions
43
+ predictions = model.predict([4, 5])
44
+
45
+ print(predictions)
46
+ # [8.0, 10.0]
47
+ ```
48
+
49
+ ## How it works
50
+
51
+ The model learns the slope and intercept of the least-squares regression line:
52
+
53
+ \[
54
+ \hat{y} = b_0 + b_1x
55
+ \]
56
+
57
+ - `fit(X, y)`: estimates the model parameters.
58
+ - `predict(X)`: predicts outputs for new input values.
59
+
60
+ ## License
61
+
62
+ MIT
@@ -0,0 +1,51 @@
1
+ # Simple Linear Regression
2
+
3
+ A lightweight Python package that implements simple linear regression without external dependencies.
4
+
5
+ ## Features
6
+
7
+ - Train a linear regression model using `fit()`.
8
+ - Predict values using `predict()`.
9
+ - Estimate the slope and intercept of the best-fit line.
10
+
11
+ ## Installation
12
+
13
+ ```bash
14
+ pip install regression-model-ibrahim
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ```python
20
+ from regression_model import SimpleLinearRegression
21
+
22
+ model = SimpleLinearRegression()
23
+
24
+ # Training data
25
+ X = [1, 2, 3]
26
+ y = [2, 4, 6]
27
+
28
+ # Train the model
29
+ model.fit(X, y)
30
+
31
+ # Make predictions
32
+ predictions = model.predict([4, 5])
33
+
34
+ print(predictions)
35
+ # [8.0, 10.0]
36
+ ```
37
+
38
+ ## How it works
39
+
40
+ The model learns the slope and intercept of the least-squares regression line:
41
+
42
+ \[
43
+ \hat{y} = b_0 + b_1x
44
+ \]
45
+
46
+ - `fit(X, y)`: estimates the model parameters.
47
+ - `predict(X)`: predicts outputs for new input values.
48
+
49
+ ## License
50
+
51
+ MIT
@@ -0,0 +1 @@
1
+ from .model import SimpleLinearRegression
@@ -0,0 +1,31 @@
1
+
2
+ class SimpleLinearRegression:
3
+ def __init__(self):
4
+ self.slope = 0
5
+ self.intercept = 0
6
+
7
+ def fit(self, X, y):
8
+ n = len(X)
9
+
10
+ x_mean = sum(X) / n
11
+ y_mean = sum(y) / n
12
+
13
+ numerator = sum(
14
+ (X[i] - x_mean) * (y[i] - y_mean)
15
+ for i in range(n)
16
+ )
17
+ denominator = sum(
18
+ (x - x_mean) ** 2 for x in X
19
+ )
20
+
21
+ if denominator == 0:
22
+ raise ValueError("All X values cannot be identical.")
23
+
24
+ self.slope = numerator / denominator
25
+ self.intercept = y_mean - self.slope * x_mean
26
+
27
+ def predict(self, X):
28
+ return [
29
+ self.intercept + self.slope * x
30
+ for x in X
31
+ ]
@@ -0,0 +1,62 @@
1
+ Metadata-Version: 2.4
2
+ Name: regression-model-ibrahim
3
+ Version: 0.1.0
4
+ Summary: A simple linear regression model
5
+ Description-Content-Type: text/markdown
6
+ License-File: LICENSE.txt
7
+ Dynamic: description
8
+ Dynamic: description-content-type
9
+ Dynamic: license-file
10
+ Dynamic: summary
11
+
12
+ # Simple Linear Regression
13
+
14
+ A lightweight Python package that implements simple linear regression without external dependencies.
15
+
16
+ ## Features
17
+
18
+ - Train a linear regression model using `fit()`.
19
+ - Predict values using `predict()`.
20
+ - Estimate the slope and intercept of the best-fit line.
21
+
22
+ ## Installation
23
+
24
+ ```bash
25
+ pip install regression-model-ibrahim
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ ```python
31
+ from regression_model import SimpleLinearRegression
32
+
33
+ model = SimpleLinearRegression()
34
+
35
+ # Training data
36
+ X = [1, 2, 3]
37
+ y = [2, 4, 6]
38
+
39
+ # Train the model
40
+ model.fit(X, y)
41
+
42
+ # Make predictions
43
+ predictions = model.predict([4, 5])
44
+
45
+ print(predictions)
46
+ # [8.0, 10.0]
47
+ ```
48
+
49
+ ## How it works
50
+
51
+ The model learns the slope and intercept of the least-squares regression line:
52
+
53
+ \[
54
+ \hat{y} = b_0 + b_1x
55
+ \]
56
+
57
+ - `fit(X, y)`: estimates the model parameters.
58
+ - `predict(X)`: predicts outputs for new input values.
59
+
60
+ ## License
61
+
62
+ MIT
@@ -0,0 +1,9 @@
1
+ LICENSE.txt
2
+ README.md
3
+ setup.py
4
+ regression_model/__init__.py
5
+ regression_model/model.py
6
+ regression_model_ibrahim.egg-info/PKG-INFO
7
+ regression_model_ibrahim.egg-info/SOURCES.txt
8
+ regression_model_ibrahim.egg-info/dependency_links.txt
9
+ regression_model_ibrahim.egg-info/top_level.txt
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,12 @@
1
+
2
+ from setuptools import setup, find_packages
3
+ from pathlib import Path
4
+
5
+ setup(
6
+ name="regression-model-ibrahim",
7
+ version="0.1.0",
8
+ description="A simple linear regression model",
9
+ long_description=Path("README.md").read_text(encoding="utf-8"),
10
+ long_description_content_type="text/markdown",
11
+ packages=find_packages(),
12
+ )