outdatedLabs 0.1.0__tar.gz → 0.1.1__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.
- {outdatedlabs-0.1.0 → outdatedlabs-0.1.1}/PKG-INFO +34 -42
- outdatedlabs-0.1.1/README.md +75 -0
- {outdatedlabs-0.1.0 → outdatedlabs-0.1.1}/setup.py +1 -1
- {outdatedlabs-0.1.0 → outdatedlabs-0.1.1}/src/outdatedLabs/secure_model.py +50 -16
- {outdatedlabs-0.1.0 → outdatedlabs-0.1.1}/src/outdatedLabs.egg-info/PKG-INFO +34 -42
- outdatedlabs-0.1.0/README.md +0 -83
- {outdatedlabs-0.1.0 → outdatedlabs-0.1.1}/pyproject.toml +0 -0
- {outdatedlabs-0.1.0 → outdatedlabs-0.1.1}/setup.cfg +0 -0
- {outdatedlabs-0.1.0 → outdatedlabs-0.1.1}/src/outdatedLabs/__init__.py +0 -0
- {outdatedlabs-0.1.0 → outdatedlabs-0.1.1}/src/outdatedLabs.egg-info/SOURCES.txt +0 -0
- {outdatedlabs-0.1.0 → outdatedlabs-0.1.1}/src/outdatedLabs.egg-info/dependency_links.txt +0 -0
- {outdatedlabs-0.1.0 → outdatedlabs-0.1.1}/src/outdatedLabs.egg-info/requires.txt +0 -0
- {outdatedlabs-0.1.0 → outdatedlabs-0.1.1}/src/outdatedLabs.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: outdatedLabs
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.1
|
4
4
|
Summary: A secure package for training machine learning models
|
5
5
|
Home-page: https://github.com/Mouli51ch/OutDated
|
6
6
|
Author: OutDated Team
|
@@ -30,9 +30,9 @@ Dynamic: requires-dist
|
|
30
30
|
Dynamic: requires-python
|
31
31
|
Dynamic: summary
|
32
32
|
|
33
|
-
#
|
33
|
+
# OutdatedLabs - Secure Machine Learning Training Package
|
34
34
|
|
35
|
-
A
|
35
|
+
A secure and easy-to-use package for training machine learning models with remote server support.
|
36
36
|
|
37
37
|
## Installation
|
38
38
|
|
@@ -42,73 +42,65 @@ pip install outdatedLabs
|
|
42
42
|
|
43
43
|
## Quick Start
|
44
44
|
|
45
|
+
1. Start the ML training server:
|
46
|
+
```bash
|
47
|
+
cd mlTrainingServer
|
48
|
+
uv run main.py
|
49
|
+
```
|
50
|
+
|
51
|
+
2. Use the package in your code:
|
45
52
|
```python
|
46
53
|
from outdatedLabs import SecureModel
|
47
54
|
|
48
55
|
# Create a linear regression model
|
49
56
|
model = SecureModel.linearRegression()
|
50
57
|
|
51
|
-
# Optionally set a custom server URL
|
52
|
-
model.set_server_url("http://your-server:8000")
|
53
|
-
|
54
58
|
# Train the model
|
55
|
-
model.
|
59
|
+
model.train(
|
56
60
|
dataset_hash="your_dataset_hash",
|
57
61
|
features=["feature1", "feature2"],
|
58
62
|
target="target_column"
|
59
63
|
)
|
60
64
|
|
61
|
-
# Make predictions
|
62
|
-
predictions = model.predict(X)
|
63
|
-
|
64
65
|
# Get training metrics
|
65
66
|
metrics = model.get_metrics()
|
66
67
|
print(metrics)
|
68
|
+
|
69
|
+
# Download and load the trained model
|
70
|
+
model.download_model()
|
71
|
+
loaded_model = model.load_model()
|
67
72
|
```
|
68
73
|
|
69
74
|
## Features
|
70
75
|
|
71
|
-
- Secure model training
|
72
|
-
-
|
76
|
+
- Secure model training with remote server support
|
77
|
+
- Automatic dataset download and cleanup
|
73
78
|
- Progress tracking with tqdm
|
74
|
-
- Comprehensive error handling
|
75
|
-
-
|
76
|
-
-
|
79
|
+
- Comprehensive error handling
|
80
|
+
- Detailed logging
|
81
|
+
- Support for multiple algorithms (currently Linear Regression)
|
82
|
+
|
83
|
+
## Configuration
|
84
|
+
|
85
|
+
The package connects to a local ML training server by default at `http://localhost:3000`. You can change the server URL when creating a model:
|
86
|
+
|
87
|
+
```python
|
88
|
+
model = SecureModel.linearRegression(server_url="http://your-server:3000")
|
89
|
+
```
|
77
90
|
|
78
91
|
## API Reference
|
79
92
|
|
80
93
|
### SecureModel
|
81
94
|
|
82
|
-
The main class for
|
95
|
+
The main class for model training and management.
|
83
96
|
|
84
97
|
#### Methods
|
85
98
|
|
86
|
-
- `linearRegression(server_url: str = "http://localhost:
|
87
|
-
|
88
|
-
|
89
|
-
- `
|
90
|
-
|
91
|
-
|
92
|
-
- `fit(dataset_hash: str, features: List[str] = None, target: str = None, params: Dict[str, Any] = None) -> SecureModel`
|
93
|
-
- Train the model using the specified dataset
|
94
|
-
|
95
|
-
- `predict(X: Union[pd.DataFrame, List[List[float]]]) -> List[float]`
|
96
|
-
- Make predictions using the trained model
|
97
|
-
|
98
|
-
- `score(X: Union[pd.DataFrame, List[List[float]]], y: List[float]) -> Dict[str, float]`
|
99
|
-
- Calculate model performance metrics
|
100
|
-
|
101
|
-
- `get_metrics() -> Dict[str, Any]`
|
102
|
-
- Get training metrics
|
103
|
-
|
104
|
-
## Requirements
|
105
|
-
|
106
|
-
- Python 3.7+
|
107
|
-
- requests
|
108
|
-
- joblib
|
109
|
-
- pandas
|
110
|
-
- scikit-learn
|
111
|
-
- tqdm
|
99
|
+
- `linearRegression(server_url: str = "http://localhost:3000")`: Create a Linear Regression model
|
100
|
+
- `train(dataset_hash: str, features: List[str], target: str)`: Train the model
|
101
|
+
- `get_metrics() -> Dict`: Get training metrics
|
102
|
+
- `download_model() -> str`: Download the trained model
|
103
|
+
- `load_model() -> Any`: Load the trained model
|
112
104
|
|
113
105
|
## License
|
114
106
|
|
@@ -0,0 +1,75 @@
|
|
1
|
+
# OutdatedLabs - Secure Machine Learning Training Package
|
2
|
+
|
3
|
+
A secure and easy-to-use package for training machine learning models with remote server support.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
```bash
|
8
|
+
pip install outdatedLabs
|
9
|
+
```
|
10
|
+
|
11
|
+
## Quick Start
|
12
|
+
|
13
|
+
1. Start the ML training server:
|
14
|
+
```bash
|
15
|
+
cd mlTrainingServer
|
16
|
+
uv run main.py
|
17
|
+
```
|
18
|
+
|
19
|
+
2. Use the package in your code:
|
20
|
+
```python
|
21
|
+
from outdatedLabs import SecureModel
|
22
|
+
|
23
|
+
# Create a linear regression model
|
24
|
+
model = SecureModel.linearRegression()
|
25
|
+
|
26
|
+
# Train the model
|
27
|
+
model.train(
|
28
|
+
dataset_hash="your_dataset_hash",
|
29
|
+
features=["feature1", "feature2"],
|
30
|
+
target="target_column"
|
31
|
+
)
|
32
|
+
|
33
|
+
# Get training metrics
|
34
|
+
metrics = model.get_metrics()
|
35
|
+
print(metrics)
|
36
|
+
|
37
|
+
# Download and load the trained model
|
38
|
+
model.download_model()
|
39
|
+
loaded_model = model.load_model()
|
40
|
+
```
|
41
|
+
|
42
|
+
## Features
|
43
|
+
|
44
|
+
- Secure model training with remote server support
|
45
|
+
- Automatic dataset download and cleanup
|
46
|
+
- Progress tracking with tqdm
|
47
|
+
- Comprehensive error handling
|
48
|
+
- Detailed logging
|
49
|
+
- Support for multiple algorithms (currently Linear Regression)
|
50
|
+
|
51
|
+
## Configuration
|
52
|
+
|
53
|
+
The package connects to a local ML training server by default at `http://localhost:3000`. You can change the server URL when creating a model:
|
54
|
+
|
55
|
+
```python
|
56
|
+
model = SecureModel.linearRegression(server_url="http://your-server:3000")
|
57
|
+
```
|
58
|
+
|
59
|
+
## API Reference
|
60
|
+
|
61
|
+
### SecureModel
|
62
|
+
|
63
|
+
The main class for model training and management.
|
64
|
+
|
65
|
+
#### Methods
|
66
|
+
|
67
|
+
- `linearRegression(server_url: str = "http://localhost:3000")`: Create a Linear Regression model
|
68
|
+
- `train(dataset_hash: str, features: List[str], target: str)`: Train the model
|
69
|
+
- `get_metrics() -> Dict`: Get training metrics
|
70
|
+
- `download_model() -> str`: Download the trained model
|
71
|
+
- `load_model() -> Any`: Load the trained model
|
72
|
+
|
73
|
+
## License
|
74
|
+
|
75
|
+
MIT License
|
@@ -23,7 +23,7 @@ logger = logging.getLogger(__name__)
|
|
23
23
|
class SecureModel:
|
24
24
|
"""Secure Model Training Class"""
|
25
25
|
|
26
|
-
def __init__(self, server_url: str = "http://localhost:
|
26
|
+
def __init__(self, server_url: str = "http://localhost:3000"):
|
27
27
|
"""
|
28
28
|
Initialize the SecureModel.
|
29
29
|
|
@@ -35,6 +35,18 @@ class SecureModel:
|
|
35
35
|
self.model = None
|
36
36
|
self.metrics = None
|
37
37
|
|
38
|
+
# Test server connection
|
39
|
+
try:
|
40
|
+
response = requests.get(f"{self.server_url}/health")
|
41
|
+
response.raise_for_status()
|
42
|
+
logger.info(f"Successfully connected to server at {self.server_url}")
|
43
|
+
except requests.exceptions.ConnectionError:
|
44
|
+
logger.error(f"Could not connect to server at {self.server_url}. Please ensure the server is running.")
|
45
|
+
raise
|
46
|
+
except requests.exceptions.RequestException as e:
|
47
|
+
logger.error(f"Error connecting to server: {str(e)}")
|
48
|
+
raise
|
49
|
+
|
38
50
|
def set_server_url(self, server_url: str) -> 'SecureModel':
|
39
51
|
"""
|
40
52
|
Set the training server URL.
|
@@ -47,10 +59,23 @@ class SecureModel:
|
|
47
59
|
"""
|
48
60
|
self.server_url = server_url.rstrip('/')
|
49
61
|
logger.info(f"Server URL set to: {self.server_url}")
|
62
|
+
|
63
|
+
# Test new server connection
|
64
|
+
try:
|
65
|
+
response = requests.get(f"{self.server_url}/health")
|
66
|
+
response.raise_for_status()
|
67
|
+
logger.info(f"Successfully connected to new server at {self.server_url}")
|
68
|
+
except requests.exceptions.ConnectionError:
|
69
|
+
logger.error(f"Could not connect to server at {self.server_url}. Please ensure the server is running.")
|
70
|
+
raise
|
71
|
+
except requests.exceptions.RequestException as e:
|
72
|
+
logger.error(f"Error connecting to server: {str(e)}")
|
73
|
+
raise
|
74
|
+
|
50
75
|
return self
|
51
76
|
|
52
77
|
@classmethod
|
53
|
-
def linearRegression(cls, server_url: str = "http://localhost:
|
78
|
+
def linearRegression(cls, server_url: str = "http://localhost:3000") -> 'SecureModel':
|
54
79
|
"""
|
55
80
|
Create a Linear Regression model.
|
56
81
|
|
@@ -124,20 +149,29 @@ class SecureModel:
|
|
124
149
|
"""Wait for the training job to complete."""
|
125
150
|
with tqdm(desc="Training", unit="s") as pbar:
|
126
151
|
while True:
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
152
|
+
try:
|
153
|
+
response = requests.get(f"{self.server_url}/train/{self.job_id}/status")
|
154
|
+
response.raise_for_status()
|
155
|
+
status = response.json()
|
156
|
+
|
157
|
+
# Convert status to uppercase for case-insensitive comparison
|
158
|
+
current_status = status["status"].upper()
|
159
|
+
|
160
|
+
if current_status == "COMPLETE":
|
161
|
+
logger.info("Training completed successfully")
|
162
|
+
self.metrics = requests.get(f"{self.server_url}/train/{self.job_id}/metrics").json()
|
163
|
+
pbar.close()
|
164
|
+
return
|
165
|
+
elif current_status == "FAILED":
|
166
|
+
error = status.get("error", "Unknown error")
|
167
|
+
pbar.close()
|
168
|
+
raise Exception(f"Training failed: {error}")
|
169
|
+
|
170
|
+
time.sleep(check_interval)
|
171
|
+
pbar.update(check_interval)
|
172
|
+
except Exception as e:
|
173
|
+
pbar.close()
|
174
|
+
raise Exception(f"Error checking training status: {str(e)}")
|
141
175
|
|
142
176
|
def _download_model(self) -> None:
|
143
177
|
"""Download the trained model."""
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: outdatedLabs
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.1
|
4
4
|
Summary: A secure package for training machine learning models
|
5
5
|
Home-page: https://github.com/Mouli51ch/OutDated
|
6
6
|
Author: OutDated Team
|
@@ -30,9 +30,9 @@ Dynamic: requires-dist
|
|
30
30
|
Dynamic: requires-python
|
31
31
|
Dynamic: summary
|
32
32
|
|
33
|
-
#
|
33
|
+
# OutdatedLabs - Secure Machine Learning Training Package
|
34
34
|
|
35
|
-
A
|
35
|
+
A secure and easy-to-use package for training machine learning models with remote server support.
|
36
36
|
|
37
37
|
## Installation
|
38
38
|
|
@@ -42,73 +42,65 @@ pip install outdatedLabs
|
|
42
42
|
|
43
43
|
## Quick Start
|
44
44
|
|
45
|
+
1. Start the ML training server:
|
46
|
+
```bash
|
47
|
+
cd mlTrainingServer
|
48
|
+
uv run main.py
|
49
|
+
```
|
50
|
+
|
51
|
+
2. Use the package in your code:
|
45
52
|
```python
|
46
53
|
from outdatedLabs import SecureModel
|
47
54
|
|
48
55
|
# Create a linear regression model
|
49
56
|
model = SecureModel.linearRegression()
|
50
57
|
|
51
|
-
# Optionally set a custom server URL
|
52
|
-
model.set_server_url("http://your-server:8000")
|
53
|
-
|
54
58
|
# Train the model
|
55
|
-
model.
|
59
|
+
model.train(
|
56
60
|
dataset_hash="your_dataset_hash",
|
57
61
|
features=["feature1", "feature2"],
|
58
62
|
target="target_column"
|
59
63
|
)
|
60
64
|
|
61
|
-
# Make predictions
|
62
|
-
predictions = model.predict(X)
|
63
|
-
|
64
65
|
# Get training metrics
|
65
66
|
metrics = model.get_metrics()
|
66
67
|
print(metrics)
|
68
|
+
|
69
|
+
# Download and load the trained model
|
70
|
+
model.download_model()
|
71
|
+
loaded_model = model.load_model()
|
67
72
|
```
|
68
73
|
|
69
74
|
## Features
|
70
75
|
|
71
|
-
- Secure model training
|
72
|
-
-
|
76
|
+
- Secure model training with remote server support
|
77
|
+
- Automatic dataset download and cleanup
|
73
78
|
- Progress tracking with tqdm
|
74
|
-
- Comprehensive error handling
|
75
|
-
-
|
76
|
-
-
|
79
|
+
- Comprehensive error handling
|
80
|
+
- Detailed logging
|
81
|
+
- Support for multiple algorithms (currently Linear Regression)
|
82
|
+
|
83
|
+
## Configuration
|
84
|
+
|
85
|
+
The package connects to a local ML training server by default at `http://localhost:3000`. You can change the server URL when creating a model:
|
86
|
+
|
87
|
+
```python
|
88
|
+
model = SecureModel.linearRegression(server_url="http://your-server:3000")
|
89
|
+
```
|
77
90
|
|
78
91
|
## API Reference
|
79
92
|
|
80
93
|
### SecureModel
|
81
94
|
|
82
|
-
The main class for
|
95
|
+
The main class for model training and management.
|
83
96
|
|
84
97
|
#### Methods
|
85
98
|
|
86
|
-
- `linearRegression(server_url: str = "http://localhost:
|
87
|
-
|
88
|
-
|
89
|
-
- `
|
90
|
-
|
91
|
-
|
92
|
-
- `fit(dataset_hash: str, features: List[str] = None, target: str = None, params: Dict[str, Any] = None) -> SecureModel`
|
93
|
-
- Train the model using the specified dataset
|
94
|
-
|
95
|
-
- `predict(X: Union[pd.DataFrame, List[List[float]]]) -> List[float]`
|
96
|
-
- Make predictions using the trained model
|
97
|
-
|
98
|
-
- `score(X: Union[pd.DataFrame, List[List[float]]], y: List[float]) -> Dict[str, float]`
|
99
|
-
- Calculate model performance metrics
|
100
|
-
|
101
|
-
- `get_metrics() -> Dict[str, Any]`
|
102
|
-
- Get training metrics
|
103
|
-
|
104
|
-
## Requirements
|
105
|
-
|
106
|
-
- Python 3.7+
|
107
|
-
- requests
|
108
|
-
- joblib
|
109
|
-
- pandas
|
110
|
-
- scikit-learn
|
111
|
-
- tqdm
|
99
|
+
- `linearRegression(server_url: str = "http://localhost:3000")`: Create a Linear Regression model
|
100
|
+
- `train(dataset_hash: str, features: List[str], target: str)`: Train the model
|
101
|
+
- `get_metrics() -> Dict`: Get training metrics
|
102
|
+
- `download_model() -> str`: Download the trained model
|
103
|
+
- `load_model() -> Any`: Load the trained model
|
112
104
|
|
113
105
|
## License
|
114
106
|
|
outdatedlabs-0.1.0/README.md
DELETED
@@ -1,83 +0,0 @@
|
|
1
|
-
# OutDatedLabs - Secure Machine Learning Training Package
|
2
|
-
|
3
|
-
A Python package for secure machine learning model training using the ML training server.
|
4
|
-
|
5
|
-
## Installation
|
6
|
-
|
7
|
-
```bash
|
8
|
-
pip install outdatedLabs
|
9
|
-
```
|
10
|
-
|
11
|
-
## Quick Start
|
12
|
-
|
13
|
-
```python
|
14
|
-
from outdatedLabs import SecureModel
|
15
|
-
|
16
|
-
# Create a linear regression model
|
17
|
-
model = SecureModel.linearRegression()
|
18
|
-
|
19
|
-
# Optionally set a custom server URL
|
20
|
-
model.set_server_url("http://your-server:8000")
|
21
|
-
|
22
|
-
# Train the model
|
23
|
-
model.fit(
|
24
|
-
dataset_hash="your_dataset_hash",
|
25
|
-
features=["feature1", "feature2"],
|
26
|
-
target="target_column"
|
27
|
-
)
|
28
|
-
|
29
|
-
# Make predictions
|
30
|
-
predictions = model.predict(X)
|
31
|
-
|
32
|
-
# Get training metrics
|
33
|
-
metrics = model.get_metrics()
|
34
|
-
print(metrics)
|
35
|
-
```
|
36
|
-
|
37
|
-
## Features
|
38
|
-
|
39
|
-
- Secure model training using encrypted datasets
|
40
|
-
- Support for linear regression models
|
41
|
-
- Progress tracking with tqdm
|
42
|
-
- Comprehensive error handling and logging
|
43
|
-
- Easy-to-use interface
|
44
|
-
- Configurable server URL
|
45
|
-
|
46
|
-
## API Reference
|
47
|
-
|
48
|
-
### SecureModel
|
49
|
-
|
50
|
-
The main class for secure model training.
|
51
|
-
|
52
|
-
#### Methods
|
53
|
-
|
54
|
-
- `linearRegression(server_url: str = "http://localhost:8000") -> SecureModel`
|
55
|
-
- Create a new linear regression model instance
|
56
|
-
|
57
|
-
- `set_server_url(server_url: str) -> SecureModel`
|
58
|
-
- Set a custom URL for the ML training server
|
59
|
-
|
60
|
-
- `fit(dataset_hash: str, features: List[str] = None, target: str = None, params: Dict[str, Any] = None) -> SecureModel`
|
61
|
-
- Train the model using the specified dataset
|
62
|
-
|
63
|
-
- `predict(X: Union[pd.DataFrame, List[List[float]]]) -> List[float]`
|
64
|
-
- Make predictions using the trained model
|
65
|
-
|
66
|
-
- `score(X: Union[pd.DataFrame, List[List[float]]], y: List[float]) -> Dict[str, float]`
|
67
|
-
- Calculate model performance metrics
|
68
|
-
|
69
|
-
- `get_metrics() -> Dict[str, Any]`
|
70
|
-
- Get training metrics
|
71
|
-
|
72
|
-
## Requirements
|
73
|
-
|
74
|
-
- Python 3.7+
|
75
|
-
- requests
|
76
|
-
- joblib
|
77
|
-
- pandas
|
78
|
-
- scikit-learn
|
79
|
-
- tqdm
|
80
|
-
|
81
|
-
## License
|
82
|
-
|
83
|
-
MIT License
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|