My own Linear Regression under the sk.* namespace
Project description
sk.linearregression
🚀 My first Python package on PyPI!
This package provides a simple implementation of Linear Regression along with helpful preprocessing utilities such as handling missing values, scaling data, and splitting into train/test sets.
✨ Features
LinearRegression– Simple regression modelHandleMissingValue– Fill or drop missing valuesMinMaxScaler– Normalize features to a given rangeTrainTestSplit– Split your dataset into training and testing sets
📦 Installation
Install directly from PyPI:
pip install sk.linearregression
# Sample Uses
from sk.linearregression import LinearRegression, HandleMissingValue, TrainTestSplit, MinMaxScaler
import pandas as pd
import matplotlib.pyplot as plt
def main():
df = pd.read_csv("train.csv")
Y = df["SalePrice"]
X = df.drop(columns=["SalePrice", "Id"])
X = HandleMissingValue(X)
X_train, X_test, Y_train, Y_test = TrainTestSplit(X, Y)
X_train = MinMaxScaler(X_train)
X_test = MinMaxScaler(X_test)
obj = LinearRegression(X_train, Y_train)
w, b = obj.regression()
y_pred = obj.predict(X_test.values.astype(float), w, b)
plt.figure(figsize=(10, 5))
plt.plot(Y_test.values[:100], label='Actual', marker='o') # Use .values if it's a Pandas Series
plt.plot(y_pred[:100], label='Predicted', marker='x')
plt.title("Comparison of Actual vs Predicted (First 100 Samples)")
plt.xlabel("Sample Index")
plt.ylabel("Target Value")
plt.legend()
plt.show()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sk_linearregression-0.4.0.tar.gz.
File metadata
- Download URL: sk_linearregression-0.4.0.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50c66b7a7f341149446a8ebce9ccbcc78ffb06ae34ed3fcbe418f32c8f81c460
|
|
| MD5 |
278d8aa01632e98175cef89b021a3269
|
|
| BLAKE2b-256 |
84a146dee9350a8e20f0b728d1970832e66c613ec9f677b3a4700c022da256f1
|
File details
Details for the file sk_linearregression-0.4.0-py3-none-any.whl.
File metadata
- Download URL: sk_linearregression-0.4.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7497bf40569f59a2a67e40ed096814644049b6e8050b9161581c77ef3e2f7430
|
|
| MD5 |
8f1812be9c136d79b7f78ea7072dd95e
|
|
| BLAKE2b-256 |
41a4863dcd33d23595cb40c11a03b5dee1cf39eb1cb8835e004edfced08a3fcd
|