mostlyai 0.4.8__tar.gz → 0.4.10__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.
- mostlyai-0.4.10/PKG-INFO +220 -0
- mostlyai-0.4.10/README.md +184 -0
- mostlyai-0.4.10/mostlyai/__init__.py +4 -0
- {mostlyai-0.4.8 → mostlyai-0.4.10}/mostlyai/model.py +1 -1
- {mostlyai-0.4.8 → mostlyai-0.4.10}/pyproject.toml +25 -16
- mostlyai-0.4.8/PKG-INFO +0 -165
- mostlyai-0.4.8/README.md +0 -139
- mostlyai-0.4.8/mostlyai/__init__.py +0 -4
- {mostlyai-0.4.8 → mostlyai-0.4.10}/LICENSE +0 -0
- {mostlyai-0.4.8 → mostlyai-0.4.10}/mostlyai/api.py +0 -0
- {mostlyai-0.4.8 → mostlyai-0.4.10}/mostlyai/base.py +0 -0
- {mostlyai-0.4.8 → mostlyai-0.4.10}/mostlyai/connectors.py +0 -0
- {mostlyai-0.4.8 → mostlyai-0.4.10}/mostlyai/exceptions.py +0 -0
- {mostlyai-0.4.8 → mostlyai-0.4.10}/mostlyai/generators.py +0 -0
- {mostlyai-0.4.8 → mostlyai-0.4.10}/mostlyai/naming_conventions.py +0 -0
- {mostlyai-0.4.8 → mostlyai-0.4.10}/mostlyai/shares.py +0 -0
- {mostlyai-0.4.8 → mostlyai-0.4.10}/mostlyai/synthetic_datasets.py +0 -0
- {mostlyai-0.4.8 → mostlyai-0.4.10}/mostlyai/utils.py +0 -0
mostlyai-0.4.10/PKG-INFO
ADDED
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: mostlyai
|
|
3
|
+
Version: 0.4.10
|
|
4
|
+
Summary: MOSTLY AI - Python Client
|
|
5
|
+
Home-page: https://app.mostly.ai/
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Author: MOSTLY AI
|
|
8
|
+
Author-email: dev@mostly.ai
|
|
9
|
+
Requires-Python: >=3.9,<4.0
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
13
|
+
Classifier: Intended Audience :: Healthcare Industry
|
|
14
|
+
Classifier: Intended Audience :: Information Technology
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Intended Audience :: Telecommunications Industry
|
|
17
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
25
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
26
|
+
Classifier: Typing :: Typed
|
|
27
|
+
Requires-Dist: httpx (>=0.25.0,<0.28.0)
|
|
28
|
+
Requires-Dist: pandas (>=1.5.3,<3.0.0)
|
|
29
|
+
Requires-Dist: pyarrow (>=14.0.0)
|
|
30
|
+
Requires-Dist: pydantic (>=2.4.2,<3.0.0)
|
|
31
|
+
Requires-Dist: rich (>=13.7.0)
|
|
32
|
+
Project-URL: Documentation, https://mostly-ai.github.io/mostly-python/
|
|
33
|
+
Project-URL: Source, https://github.com/mostly-ai/mostly-python
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
# MOSTLY AI - Python Client 🚀
|
|
37
|
+
|
|
38
|
+
[](https://mostly-ai.github.io/mostly-python/) [](https://pypi.org/project/mostlyai/)   
|
|
39
|
+
|
|
40
|
+
The official Python client for the [MOSTLY AI platform](https://app.mostly.ai/). See the [Platform Documentation](https://mostly.ai/docs) for detailed feature descriptions and Python examples. Check out our [Synthetic Data Tutorials](#synthetic-data-tutorials) for further end-to-end usage demonstrations.
|
|
41
|
+
|
|
42
|
+
## Overview
|
|
43
|
+
|
|
44
|
+
| Intent | Primitive |
|
|
45
|
+
|-------------------------------------------------|------------------------------------------|
|
|
46
|
+
| Train a Generative AI on tabular data | `g = mostly.train(data)` |
|
|
47
|
+
| Generate any number of synthetic data records | `mostly.generate(g, size)` |
|
|
48
|
+
| Prompt the generator for the data that you need | `mostly.generate(g, seed)` |
|
|
49
|
+
| Live probe the generator on demand | `mostly.probe(g, size \| seed)` |
|
|
50
|
+
| Connect to any data source within your org | `mostly.connect(config)` |
|
|
51
|
+
| List the available models | `mostly.models('LANGUAGE' \| 'TABULAR')` |
|
|
52
|
+
| List the available computes | `mostly.computes()` |
|
|
53
|
+
| Info about the current user | `mostly.me()` |
|
|
54
|
+
| Info about the platform | `mostly.about()` |
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
The latest release of `mostlyai` can be installed via pip:
|
|
59
|
+
|
|
60
|
+
```shell
|
|
61
|
+
pip install -U mostlyai
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Quick Start
|
|
65
|
+
|
|
66
|
+
Please obtain your personal API key from your [settings page](https://app.mostly.ai/settings/api-keys).
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
import pandas as pd
|
|
70
|
+
from mostlyai import MostlyAI
|
|
71
|
+
|
|
72
|
+
# initialize client
|
|
73
|
+
mostly = MostlyAI(
|
|
74
|
+
api_key='INSERT_YOUR_API_KEY', # or set env var `MOSTLYAI_API_KEY`
|
|
75
|
+
base_url='https://app.mostly.ai' # or set env var `MOSTLYAI_BASE_URL`
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
# train a generator
|
|
79
|
+
df = pd.read_csv('https://github.com/mostly-ai/public-demo-data/raw/dev/census/census.csv.gz')
|
|
80
|
+
g = mostly.train(data=df)
|
|
81
|
+
|
|
82
|
+
# probe for some samples
|
|
83
|
+
syn = mostly.probe(g, size=10)
|
|
84
|
+
|
|
85
|
+
# generate a synthetic dataset
|
|
86
|
+
sd = mostly.generate(g, size=2_000)
|
|
87
|
+
|
|
88
|
+
# start using it
|
|
89
|
+
sd.data()
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Basic Usage
|
|
93
|
+
|
|
94
|
+
### Generators
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
g = mostly.train(data, config, name, start=True, wait=True)
|
|
98
|
+
|
|
99
|
+
g = mostly.generators.create(config)
|
|
100
|
+
g = mostly.generators.get(id)
|
|
101
|
+
it = mostly.generators.list()
|
|
102
|
+
g = g.update(config)
|
|
103
|
+
config = g.config()
|
|
104
|
+
g.open()
|
|
105
|
+
g.reload()
|
|
106
|
+
g.delete()
|
|
107
|
+
|
|
108
|
+
# training
|
|
109
|
+
g.training.start()
|
|
110
|
+
g.training.progress()
|
|
111
|
+
g.training.cancel()
|
|
112
|
+
g.training.wait()
|
|
113
|
+
|
|
114
|
+
# import / export
|
|
115
|
+
g.export_to_file(file_path)
|
|
116
|
+
mostly.generators.import_from_file(file_path)
|
|
117
|
+
|
|
118
|
+
# clone
|
|
119
|
+
cloned_g = g.clone(training_status="NEW") # clone the generator for new training
|
|
120
|
+
cloned_g = g.clone(training_status="CONTINUE") # clone the generator and reuse its weights for continued training
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Synthetic Datasets
|
|
124
|
+
|
|
125
|
+
```python
|
|
126
|
+
sd = mostly.generate(g, seed=seed)
|
|
127
|
+
sd = mostly.generate(g, size=size)
|
|
128
|
+
sd = mostly.generate(g, config=config)
|
|
129
|
+
|
|
130
|
+
sd = mostly.synthetic_datasets.create(g, config)
|
|
131
|
+
sd = mostly.synthetic_datasets.get(id)
|
|
132
|
+
it = mostly.synthetic_datasets.list()
|
|
133
|
+
config = sd.config()
|
|
134
|
+
sd.open()
|
|
135
|
+
sd.reload()
|
|
136
|
+
sd.delete()
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
sd.generation.start()
|
|
140
|
+
sd.generation.progress()
|
|
141
|
+
sd.generation.cancel()
|
|
142
|
+
sd.generation.wait()
|
|
143
|
+
|
|
144
|
+
sd.data()
|
|
145
|
+
sd.download(file, format)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Synthetic Probes
|
|
149
|
+
|
|
150
|
+
```python
|
|
151
|
+
sp = mostly.probe(g, seed=seed)
|
|
152
|
+
sp = mostly.probe(g, size=size)
|
|
153
|
+
sp = mostly.probe(g, config=config)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Connectors
|
|
157
|
+
|
|
158
|
+
```python
|
|
159
|
+
c = mostly.connect(config)
|
|
160
|
+
|
|
161
|
+
c = mostly.connectors.create(config)
|
|
162
|
+
c = mostly.connectors.get(id)
|
|
163
|
+
it = mostly.connectors.list()
|
|
164
|
+
c = c.update(config)
|
|
165
|
+
ls = c.locations(prefix)
|
|
166
|
+
config = c.config()
|
|
167
|
+
c.open()
|
|
168
|
+
c.reload()
|
|
169
|
+
c.delete()
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Sharing
|
|
173
|
+
|
|
174
|
+
```python
|
|
175
|
+
mostly.share(g | sd | c, email)
|
|
176
|
+
mostly.unshare(g | sd | c, email)
|
|
177
|
+
|
|
178
|
+
g.shares()
|
|
179
|
+
sd.shares()
|
|
180
|
+
c.shares()
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### Job Configuration Info
|
|
184
|
+
|
|
185
|
+
```python
|
|
186
|
+
mostly.models(model_type='TABULAR')
|
|
187
|
+
mostly.models(model_type='LANGUAGE')
|
|
188
|
+
mostly.computes()
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### User Info
|
|
192
|
+
|
|
193
|
+
```python
|
|
194
|
+
mostly.me()
|
|
195
|
+
mostly.about()
|
|
196
|
+
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
## Synthetic Data Tutorials
|
|
200
|
+
|
|
201
|
+
* Validate synthetic data via **Train-Synthetic-Test-Real** [[run on Colab](https://colab.research.google.com/github/mostly-ai/mostly-tutorials/blob/dev/train-synthetic-test-real/TSTR.ipynb)]
|
|
202
|
+
* Explore the **size vs. accuracy trade-off** for synthetic data [[run on Colab](https://colab.research.google.com/github/mostly-ai/mostly-tutorials/blob/dev/size-vs-accuracy/size-vs-accuracy.ipynb)]
|
|
203
|
+
* **Rebalance** synthetic datasets for data augmentation [[run on Colab](https://colab.research.google.com/github/mostly-ai/mostly-tutorials/blob/dev/rebalancing/rebalancing.ipynb)]
|
|
204
|
+
* **Conditionally generate** synthetic (geo) data [[run on Colab](https://colab.research.google.com/github/mostly-ai/mostly-tutorials/blob/dev/conditional-generation/conditional-generation.ipynb)]
|
|
205
|
+
* **Explain AI** with synthetic data [[run on Colab](https://colab.research.google.com/github/mostly-ai/mostly-tutorials/blob/dev/explainable-ai/explainable-ai.ipynb)]
|
|
206
|
+
* Generate **synthetic text** [[run on Colab](https://colab.research.google.com/github/mostly-ai/mostly-tutorials/blob/dev/synthetic-text/synthetic-text.ipynb)]
|
|
207
|
+
* Perform **multi-table synthesis** [[run on Colab](https://colab.research.google.com/github/mostly-ai/mostly-tutorials/blob/dev/multi-table/multi-table.ipynb)]
|
|
208
|
+
* Develop a **fake or real discriminator** with Synthetic Data [[run on Colab](https://colab.research.google.com/github/mostly-ai/mostly-tutorials/blob/dev/fake-or-real/fake-or-real.ipynb)]
|
|
209
|
+
* Close gaps in your data with **Smart Imputation** [[run on Colab](https://colab.research.google.com/github/mostly-ai/mostly-tutorials/blob/dev/smart-imputation/smart-imputation.ipynb)]
|
|
210
|
+
* Calculate accuracy and privacy metrics for **Quality Assurance** [[run on Colab](https://colab.research.google.com/github/mostly-ai/mostly-tutorials/blob/dev/quality-assurance/quality-assurance.ipynb)]
|
|
211
|
+
|
|
212
|
+
## Further Links
|
|
213
|
+
|
|
214
|
+
* [MOSTLY AI Website](https://mostly.ai/)
|
|
215
|
+
* [MOSTLY AI Blog](https://mostly.ai/blog)
|
|
216
|
+
* [Platform Documentation](https://mostly.ai/docs)
|
|
217
|
+
* [OpenAPI Documentation](https://api-docs.mostly.ai/)
|
|
218
|
+
* [MOSTLY AI @ GitHub](https://github.com/mostly-ai/)
|
|
219
|
+
* [Synthetic Data - Quality Assurance](https://github.com/mostly-ai/mostlyai-qa/) `mostlyai-qa`
|
|
220
|
+
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
# MOSTLY AI - Python Client 🚀
|
|
2
|
+
|
|
3
|
+
[](https://mostly-ai.github.io/mostly-python/) [](https://pypi.org/project/mostlyai/)   
|
|
4
|
+
|
|
5
|
+
The official Python client for the [MOSTLY AI platform](https://app.mostly.ai/). See the [Platform Documentation](https://mostly.ai/docs) for detailed feature descriptions and Python examples. Check out our [Synthetic Data Tutorials](#synthetic-data-tutorials) for further end-to-end usage demonstrations.
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
| Intent | Primitive |
|
|
10
|
+
|-------------------------------------------------|------------------------------------------|
|
|
11
|
+
| Train a Generative AI on tabular data | `g = mostly.train(data)` |
|
|
12
|
+
| Generate any number of synthetic data records | `mostly.generate(g, size)` |
|
|
13
|
+
| Prompt the generator for the data that you need | `mostly.generate(g, seed)` |
|
|
14
|
+
| Live probe the generator on demand | `mostly.probe(g, size \| seed)` |
|
|
15
|
+
| Connect to any data source within your org | `mostly.connect(config)` |
|
|
16
|
+
| List the available models | `mostly.models('LANGUAGE' \| 'TABULAR')` |
|
|
17
|
+
| List the available computes | `mostly.computes()` |
|
|
18
|
+
| Info about the current user | `mostly.me()` |
|
|
19
|
+
| Info about the platform | `mostly.about()` |
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
The latest release of `mostlyai` can be installed via pip:
|
|
24
|
+
|
|
25
|
+
```shell
|
|
26
|
+
pip install -U mostlyai
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
Please obtain your personal API key from your [settings page](https://app.mostly.ai/settings/api-keys).
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
import pandas as pd
|
|
35
|
+
from mostlyai import MostlyAI
|
|
36
|
+
|
|
37
|
+
# initialize client
|
|
38
|
+
mostly = MostlyAI(
|
|
39
|
+
api_key='INSERT_YOUR_API_KEY', # or set env var `MOSTLYAI_API_KEY`
|
|
40
|
+
base_url='https://app.mostly.ai' # or set env var `MOSTLYAI_BASE_URL`
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
# train a generator
|
|
44
|
+
df = pd.read_csv('https://github.com/mostly-ai/public-demo-data/raw/dev/census/census.csv.gz')
|
|
45
|
+
g = mostly.train(data=df)
|
|
46
|
+
|
|
47
|
+
# probe for some samples
|
|
48
|
+
syn = mostly.probe(g, size=10)
|
|
49
|
+
|
|
50
|
+
# generate a synthetic dataset
|
|
51
|
+
sd = mostly.generate(g, size=2_000)
|
|
52
|
+
|
|
53
|
+
# start using it
|
|
54
|
+
sd.data()
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Basic Usage
|
|
58
|
+
|
|
59
|
+
### Generators
|
|
60
|
+
|
|
61
|
+
```python
|
|
62
|
+
g = mostly.train(data, config, name, start=True, wait=True)
|
|
63
|
+
|
|
64
|
+
g = mostly.generators.create(config)
|
|
65
|
+
g = mostly.generators.get(id)
|
|
66
|
+
it = mostly.generators.list()
|
|
67
|
+
g = g.update(config)
|
|
68
|
+
config = g.config()
|
|
69
|
+
g.open()
|
|
70
|
+
g.reload()
|
|
71
|
+
g.delete()
|
|
72
|
+
|
|
73
|
+
# training
|
|
74
|
+
g.training.start()
|
|
75
|
+
g.training.progress()
|
|
76
|
+
g.training.cancel()
|
|
77
|
+
g.training.wait()
|
|
78
|
+
|
|
79
|
+
# import / export
|
|
80
|
+
g.export_to_file(file_path)
|
|
81
|
+
mostly.generators.import_from_file(file_path)
|
|
82
|
+
|
|
83
|
+
# clone
|
|
84
|
+
cloned_g = g.clone(training_status="NEW") # clone the generator for new training
|
|
85
|
+
cloned_g = g.clone(training_status="CONTINUE") # clone the generator and reuse its weights for continued training
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Synthetic Datasets
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
sd = mostly.generate(g, seed=seed)
|
|
92
|
+
sd = mostly.generate(g, size=size)
|
|
93
|
+
sd = mostly.generate(g, config=config)
|
|
94
|
+
|
|
95
|
+
sd = mostly.synthetic_datasets.create(g, config)
|
|
96
|
+
sd = mostly.synthetic_datasets.get(id)
|
|
97
|
+
it = mostly.synthetic_datasets.list()
|
|
98
|
+
config = sd.config()
|
|
99
|
+
sd.open()
|
|
100
|
+
sd.reload()
|
|
101
|
+
sd.delete()
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
sd.generation.start()
|
|
105
|
+
sd.generation.progress()
|
|
106
|
+
sd.generation.cancel()
|
|
107
|
+
sd.generation.wait()
|
|
108
|
+
|
|
109
|
+
sd.data()
|
|
110
|
+
sd.download(file, format)
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Synthetic Probes
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
sp = mostly.probe(g, seed=seed)
|
|
117
|
+
sp = mostly.probe(g, size=size)
|
|
118
|
+
sp = mostly.probe(g, config=config)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Connectors
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
c = mostly.connect(config)
|
|
125
|
+
|
|
126
|
+
c = mostly.connectors.create(config)
|
|
127
|
+
c = mostly.connectors.get(id)
|
|
128
|
+
it = mostly.connectors.list()
|
|
129
|
+
c = c.update(config)
|
|
130
|
+
ls = c.locations(prefix)
|
|
131
|
+
config = c.config()
|
|
132
|
+
c.open()
|
|
133
|
+
c.reload()
|
|
134
|
+
c.delete()
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Sharing
|
|
138
|
+
|
|
139
|
+
```python
|
|
140
|
+
mostly.share(g | sd | c, email)
|
|
141
|
+
mostly.unshare(g | sd | c, email)
|
|
142
|
+
|
|
143
|
+
g.shares()
|
|
144
|
+
sd.shares()
|
|
145
|
+
c.shares()
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Job Configuration Info
|
|
149
|
+
|
|
150
|
+
```python
|
|
151
|
+
mostly.models(model_type='TABULAR')
|
|
152
|
+
mostly.models(model_type='LANGUAGE')
|
|
153
|
+
mostly.computes()
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### User Info
|
|
157
|
+
|
|
158
|
+
```python
|
|
159
|
+
mostly.me()
|
|
160
|
+
mostly.about()
|
|
161
|
+
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Synthetic Data Tutorials
|
|
165
|
+
|
|
166
|
+
* Validate synthetic data via **Train-Synthetic-Test-Real** [[run on Colab](https://colab.research.google.com/github/mostly-ai/mostly-tutorials/blob/dev/train-synthetic-test-real/TSTR.ipynb)]
|
|
167
|
+
* Explore the **size vs. accuracy trade-off** for synthetic data [[run on Colab](https://colab.research.google.com/github/mostly-ai/mostly-tutorials/blob/dev/size-vs-accuracy/size-vs-accuracy.ipynb)]
|
|
168
|
+
* **Rebalance** synthetic datasets for data augmentation [[run on Colab](https://colab.research.google.com/github/mostly-ai/mostly-tutorials/blob/dev/rebalancing/rebalancing.ipynb)]
|
|
169
|
+
* **Conditionally generate** synthetic (geo) data [[run on Colab](https://colab.research.google.com/github/mostly-ai/mostly-tutorials/blob/dev/conditional-generation/conditional-generation.ipynb)]
|
|
170
|
+
* **Explain AI** with synthetic data [[run on Colab](https://colab.research.google.com/github/mostly-ai/mostly-tutorials/blob/dev/explainable-ai/explainable-ai.ipynb)]
|
|
171
|
+
* Generate **synthetic text** [[run on Colab](https://colab.research.google.com/github/mostly-ai/mostly-tutorials/blob/dev/synthetic-text/synthetic-text.ipynb)]
|
|
172
|
+
* Perform **multi-table synthesis** [[run on Colab](https://colab.research.google.com/github/mostly-ai/mostly-tutorials/blob/dev/multi-table/multi-table.ipynb)]
|
|
173
|
+
* Develop a **fake or real discriminator** with Synthetic Data [[run on Colab](https://colab.research.google.com/github/mostly-ai/mostly-tutorials/blob/dev/fake-or-real/fake-or-real.ipynb)]
|
|
174
|
+
* Close gaps in your data with **Smart Imputation** [[run on Colab](https://colab.research.google.com/github/mostly-ai/mostly-tutorials/blob/dev/smart-imputation/smart-imputation.ipynb)]
|
|
175
|
+
* Calculate accuracy and privacy metrics for **Quality Assurance** [[run on Colab](https://colab.research.google.com/github/mostly-ai/mostly-tutorials/blob/dev/quality-assurance/quality-assurance.ipynb)]
|
|
176
|
+
|
|
177
|
+
## Further Links
|
|
178
|
+
|
|
179
|
+
* [MOSTLY AI Website](https://mostly.ai/)
|
|
180
|
+
* [MOSTLY AI Blog](https://mostly.ai/blog)
|
|
181
|
+
* [Platform Documentation](https://mostly.ai/docs)
|
|
182
|
+
* [OpenAPI Documentation](https://api-docs.mostly.ai/)
|
|
183
|
+
* [MOSTLY AI @ GitHub](https://github.com/mostly-ai/)
|
|
184
|
+
* [Synthetic Data - Quality Assurance](https://github.com/mostly-ai/mostlyai-qa/) `mostlyai-qa`
|
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "mostlyai"
|
|
3
|
-
version = "0.4.
|
|
4
|
-
description = "
|
|
3
|
+
version = "0.4.10"
|
|
4
|
+
description = "MOSTLY AI - Python Client"
|
|
5
5
|
homepage = "https://app.mostly.ai/"
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
license = "Apache-2.0"
|
|
7
|
+
authors = ["MOSTLY AI <dev@mostly.ai>"]
|
|
8
8
|
readme = "README.md"
|
|
9
9
|
packages = [
|
|
10
10
|
{ include = "mostlyai" }
|
|
11
11
|
]
|
|
12
12
|
exclude = ["tools/", "tools/**/*"]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 5 - Production/Stable",
|
|
15
|
+
"Intended Audience :: Developers",
|
|
16
|
+
"Intended Audience :: Science/Research",
|
|
17
|
+
"Intended Audience :: Information Technology",
|
|
18
|
+
"Intended Audience :: Financial and Insurance Industry",
|
|
19
|
+
"Intended Audience :: Healthcare Industry",
|
|
20
|
+
"Intended Audience :: Telecommunications Industry",
|
|
21
|
+
"License :: OSI Approved :: Apache Software License",
|
|
22
|
+
"Operating System :: OS Independent",
|
|
23
|
+
"Topic :: Software Development :: Libraries",
|
|
24
|
+
"Typing :: Typed",
|
|
25
|
+
]
|
|
13
26
|
|
|
14
27
|
[tool.poetry.urls]
|
|
15
28
|
"Homepage" = "https://app.mostly.ai/"
|
|
@@ -19,7 +32,7 @@ exclude = ["tools/", "tools/**/*"]
|
|
|
19
32
|
[tool.poetry.dependencies]
|
|
20
33
|
python = "^3.9"
|
|
21
34
|
pydantic = "^2.4.2"
|
|
22
|
-
httpx = ">=0.25.0"
|
|
35
|
+
httpx = ">=0.25.0,<0.28.0" # frozen until https://github.com/lundberg/respx/issues/277 is resolved
|
|
23
36
|
pandas = ">=1.5.3,<2.0.0 || ^2.0.0"
|
|
24
37
|
pyarrow = ">=14.0.0"
|
|
25
38
|
rich = ">=13.7.0"
|
|
@@ -32,19 +45,15 @@ vcrpy = "^5.1.0"
|
|
|
32
45
|
ruff = "0.4.4"
|
|
33
46
|
respx = "^0.20.2"
|
|
34
47
|
twine = "^5.0.0"
|
|
35
|
-
commitizen = "^3.18.0"
|
|
36
|
-
mkdocs = "^1.5.3"
|
|
37
|
-
mkdocstrings = { version = "^0.24.1", extras = ["crystal", "python"] }
|
|
38
|
-
mkdocs-material = "^9.5.13"
|
|
39
48
|
poetry-bumpversion = "^0.3.2"
|
|
49
|
+
# docs
|
|
50
|
+
mkdocs = ">=1.5.3"
|
|
51
|
+
mkdocstrings = { version = "^0.27.0", extras = ["crystal", "python"] }
|
|
52
|
+
mkdocs-material = "^9.0.0"
|
|
53
|
+
griffe = "^1.0.0"
|
|
54
|
+
pymdown-extensions = "^10.0.0"
|
|
55
|
+
griffe-fieldz = "^0.2.0"
|
|
40
56
|
|
|
41
|
-
[tool.commitizen]
|
|
42
|
-
name = "cz_conventional_commits"
|
|
43
|
-
tag_format = "$version"
|
|
44
|
-
version_scheme = "pep440"
|
|
45
|
-
version_provider = "poetry"
|
|
46
|
-
update_changelog_on_bump = true
|
|
47
|
-
major_version_zero = true
|
|
48
57
|
|
|
49
58
|
[[tool.poetry_bumpversion.replacements]]
|
|
50
59
|
files = ["mostlyai/__init__.py"]
|
mostlyai-0.4.8/PKG-INFO
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: mostlyai
|
|
3
|
-
Version: 0.4.8
|
|
4
|
-
Summary: The official Python client for the MOSTLY AI platform.
|
|
5
|
-
Home-page: https://app.mostly.ai/
|
|
6
|
-
License: Proprietary
|
|
7
|
-
Author: MOSTLY AI
|
|
8
|
-
Author-email: office@mostly.ai
|
|
9
|
-
Requires-Python: >=3.9,<4.0
|
|
10
|
-
Classifier: License :: Other/Proprietary License
|
|
11
|
-
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
-
Requires-Dist: httpx (>=0.25.0)
|
|
18
|
-
Requires-Dist: pandas (>=1.5.3,<3.0.0)
|
|
19
|
-
Requires-Dist: pyarrow (>=14.0.0)
|
|
20
|
-
Requires-Dist: pydantic (>=2.4.2,<3.0.0)
|
|
21
|
-
Requires-Dist: rich (>=13.7.0)
|
|
22
|
-
Project-URL: Documentation, https://mostly-ai.github.io/mostly-python/
|
|
23
|
-
Project-URL: Source, https://github.com/mostly-ai/mostly-python
|
|
24
|
-
Description-Content-Type: text/markdown
|
|
25
|
-
|
|
26
|
-
# MOSTLY AI - GenAI for Tabular Data
|
|
27
|
-
|
|
28
|
-
A Python wrapper for the MOSTLY AI platform (https://app.mostly.ai/).
|
|
29
|
-
|
|
30
|
-
| Intent | Primitive |
|
|
31
|
-
|-------------------------------------------------|----------------------------------|
|
|
32
|
-
| Train a Generative AI on tabular data | `g = mostly.train(data)` |
|
|
33
|
-
| Empower your team with safe synthetic data | `mostly.share(g, email)` |
|
|
34
|
-
| Generate any number of synthetic data records | `mostly.generate(g, size)` |
|
|
35
|
-
| Prompt the generator for the data that you need | `mostly.generate(g, seed)` |
|
|
36
|
-
| Live probe the generator on demand | `mostly.probe(g, size \| seed)` |
|
|
37
|
-
| Connect to any data source within your org | `mostly.connect(config)` |
|
|
38
|
-
| List the available models | `mostly.models(model_type)` |
|
|
39
|
-
| List the available computes | `mostly.computes()` |
|
|
40
|
-
| Info about the current user | `mostly.me()` |
|
|
41
|
-
| Info about the platform | `mostly.about()` |
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
## Installation
|
|
46
|
-
|
|
47
|
-
```shell
|
|
48
|
-
pip install -U mostlyai
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## Basic Usage
|
|
52
|
-
```python
|
|
53
|
-
from mostlyai import MostlyAI
|
|
54
|
-
mostly = MostlyAI(api_key='your_api_key')
|
|
55
|
-
g = mostly.train(data) # train a generator on your data
|
|
56
|
-
mostly.share(g, email) # share the generator with your team
|
|
57
|
-
sd = mostly.generate(g) # use the generator to create a synthetic dataset
|
|
58
|
-
syn = sd.data() # consume the synthetic data as pandas DataFrame(s)
|
|
59
|
-
mostly.probe(g, size=100) # generate few samples on demand
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
## Supported Methods
|
|
63
|
-
|
|
64
|
-
### Connectors
|
|
65
|
-
|
|
66
|
-
```python
|
|
67
|
-
c = mostly.connect(config)
|
|
68
|
-
|
|
69
|
-
c = mostly.connectors.create(config)
|
|
70
|
-
c = mostly.connectors.get(id)
|
|
71
|
-
it = mostly.connectors.list()
|
|
72
|
-
c = c.update(config)
|
|
73
|
-
ls = c.locations(prefix)
|
|
74
|
-
config = c.config()
|
|
75
|
-
c.open()
|
|
76
|
-
c.reload()
|
|
77
|
-
c.delete()
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### Generators
|
|
81
|
-
|
|
82
|
-
```python
|
|
83
|
-
g = mostly.train(data, config, name, start=True, wait=True)
|
|
84
|
-
|
|
85
|
-
g = mostly.generators.create(config)
|
|
86
|
-
g = mostly.generators.get(id)
|
|
87
|
-
it = mostly.generators.list()
|
|
88
|
-
g = g.update(config)
|
|
89
|
-
config = g.config()
|
|
90
|
-
g.open()
|
|
91
|
-
g.reload()
|
|
92
|
-
g.delete()
|
|
93
|
-
|
|
94
|
-
# training
|
|
95
|
-
g.training.start()
|
|
96
|
-
g.training.progress()
|
|
97
|
-
g.training.cancel()
|
|
98
|
-
g.training.wait()
|
|
99
|
-
|
|
100
|
-
# import / export
|
|
101
|
-
g.export_to_file(file_path)
|
|
102
|
-
mostly.generators.import_from_file(file_path)
|
|
103
|
-
|
|
104
|
-
# clone
|
|
105
|
-
cloned_g = g.clone(training_status="NEW") # clone the generator for new training
|
|
106
|
-
cloned_g = g.clone(training_status="CONTINUE") # clone the generator and reuse its weights for continued training
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Synthetic Datasets
|
|
110
|
-
|
|
111
|
-
```python
|
|
112
|
-
sd = mostly.generate(g, seed=seed)
|
|
113
|
-
sd = mostly.generate(g, size=size)
|
|
114
|
-
sd = mostly.generate(g, config=config)
|
|
115
|
-
|
|
116
|
-
sd = mostly.synthetic_datasets.create(g, config)
|
|
117
|
-
sd = mostly.synthetic_datasets.get(id)
|
|
118
|
-
it = mostly.synthetic_datasets.list()
|
|
119
|
-
config = sd.config()
|
|
120
|
-
sd.open()
|
|
121
|
-
sd.reload()
|
|
122
|
-
sd.delete()
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
sd.generation.start()
|
|
126
|
-
sd.generation.progress()
|
|
127
|
-
sd.generation.cancel()
|
|
128
|
-
sd.generation.wait()
|
|
129
|
-
|
|
130
|
-
sd.data()
|
|
131
|
-
sd.download(file, format)
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### Synthetic Probes
|
|
135
|
-
```python
|
|
136
|
-
sp = mostly.probe(g, seed=seed)
|
|
137
|
-
sp = mostly.probe(g, size=size)
|
|
138
|
-
sp = mostly.probe(g, config=config)
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### Sharing
|
|
142
|
-
|
|
143
|
-
```python
|
|
144
|
-
mostly.share(g | sd | c, email)
|
|
145
|
-
mostly.unshare(g | sd | c, email)
|
|
146
|
-
|
|
147
|
-
g.shares()
|
|
148
|
-
sd.shares()
|
|
149
|
-
c.shares()
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### Job Configuration Info
|
|
153
|
-
```python
|
|
154
|
-
mostly.models(model_type)
|
|
155
|
-
mostly.computes()
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### User Info
|
|
159
|
-
|
|
160
|
-
```python
|
|
161
|
-
mostly.me()
|
|
162
|
-
mostly.about()
|
|
163
|
-
|
|
164
|
-
```
|
|
165
|
-
|
mostlyai-0.4.8/README.md
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
# MOSTLY AI - GenAI for Tabular Data
|
|
2
|
-
|
|
3
|
-
A Python wrapper for the MOSTLY AI platform (https://app.mostly.ai/).
|
|
4
|
-
|
|
5
|
-
| Intent | Primitive |
|
|
6
|
-
|-------------------------------------------------|----------------------------------|
|
|
7
|
-
| Train a Generative AI on tabular data | `g = mostly.train(data)` |
|
|
8
|
-
| Empower your team with safe synthetic data | `mostly.share(g, email)` |
|
|
9
|
-
| Generate any number of synthetic data records | `mostly.generate(g, size)` |
|
|
10
|
-
| Prompt the generator for the data that you need | `mostly.generate(g, seed)` |
|
|
11
|
-
| Live probe the generator on demand | `mostly.probe(g, size \| seed)` |
|
|
12
|
-
| Connect to any data source within your org | `mostly.connect(config)` |
|
|
13
|
-
| List the available models | `mostly.models(model_type)` |
|
|
14
|
-
| List the available computes | `mostly.computes()` |
|
|
15
|
-
| Info about the current user | `mostly.me()` |
|
|
16
|
-
| Info about the platform | `mostly.about()` |
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
## Installation
|
|
21
|
-
|
|
22
|
-
```shell
|
|
23
|
-
pip install -U mostlyai
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
## Basic Usage
|
|
27
|
-
```python
|
|
28
|
-
from mostlyai import MostlyAI
|
|
29
|
-
mostly = MostlyAI(api_key='your_api_key')
|
|
30
|
-
g = mostly.train(data) # train a generator on your data
|
|
31
|
-
mostly.share(g, email) # share the generator with your team
|
|
32
|
-
sd = mostly.generate(g) # use the generator to create a synthetic dataset
|
|
33
|
-
syn = sd.data() # consume the synthetic data as pandas DataFrame(s)
|
|
34
|
-
mostly.probe(g, size=100) # generate few samples on demand
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
## Supported Methods
|
|
38
|
-
|
|
39
|
-
### Connectors
|
|
40
|
-
|
|
41
|
-
```python
|
|
42
|
-
c = mostly.connect(config)
|
|
43
|
-
|
|
44
|
-
c = mostly.connectors.create(config)
|
|
45
|
-
c = mostly.connectors.get(id)
|
|
46
|
-
it = mostly.connectors.list()
|
|
47
|
-
c = c.update(config)
|
|
48
|
-
ls = c.locations(prefix)
|
|
49
|
-
config = c.config()
|
|
50
|
-
c.open()
|
|
51
|
-
c.reload()
|
|
52
|
-
c.delete()
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### Generators
|
|
56
|
-
|
|
57
|
-
```python
|
|
58
|
-
g = mostly.train(data, config, name, start=True, wait=True)
|
|
59
|
-
|
|
60
|
-
g = mostly.generators.create(config)
|
|
61
|
-
g = mostly.generators.get(id)
|
|
62
|
-
it = mostly.generators.list()
|
|
63
|
-
g = g.update(config)
|
|
64
|
-
config = g.config()
|
|
65
|
-
g.open()
|
|
66
|
-
g.reload()
|
|
67
|
-
g.delete()
|
|
68
|
-
|
|
69
|
-
# training
|
|
70
|
-
g.training.start()
|
|
71
|
-
g.training.progress()
|
|
72
|
-
g.training.cancel()
|
|
73
|
-
g.training.wait()
|
|
74
|
-
|
|
75
|
-
# import / export
|
|
76
|
-
g.export_to_file(file_path)
|
|
77
|
-
mostly.generators.import_from_file(file_path)
|
|
78
|
-
|
|
79
|
-
# clone
|
|
80
|
-
cloned_g = g.clone(training_status="NEW") # clone the generator for new training
|
|
81
|
-
cloned_g = g.clone(training_status="CONTINUE") # clone the generator and reuse its weights for continued training
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
### Synthetic Datasets
|
|
85
|
-
|
|
86
|
-
```python
|
|
87
|
-
sd = mostly.generate(g, seed=seed)
|
|
88
|
-
sd = mostly.generate(g, size=size)
|
|
89
|
-
sd = mostly.generate(g, config=config)
|
|
90
|
-
|
|
91
|
-
sd = mostly.synthetic_datasets.create(g, config)
|
|
92
|
-
sd = mostly.synthetic_datasets.get(id)
|
|
93
|
-
it = mostly.synthetic_datasets.list()
|
|
94
|
-
config = sd.config()
|
|
95
|
-
sd.open()
|
|
96
|
-
sd.reload()
|
|
97
|
-
sd.delete()
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
sd.generation.start()
|
|
101
|
-
sd.generation.progress()
|
|
102
|
-
sd.generation.cancel()
|
|
103
|
-
sd.generation.wait()
|
|
104
|
-
|
|
105
|
-
sd.data()
|
|
106
|
-
sd.download(file, format)
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Synthetic Probes
|
|
110
|
-
```python
|
|
111
|
-
sp = mostly.probe(g, seed=seed)
|
|
112
|
-
sp = mostly.probe(g, size=size)
|
|
113
|
-
sp = mostly.probe(g, config=config)
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### Sharing
|
|
117
|
-
|
|
118
|
-
```python
|
|
119
|
-
mostly.share(g | sd | c, email)
|
|
120
|
-
mostly.unshare(g | sd | c, email)
|
|
121
|
-
|
|
122
|
-
g.shares()
|
|
123
|
-
sd.shares()
|
|
124
|
-
c.shares()
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
### Job Configuration Info
|
|
128
|
-
```python
|
|
129
|
-
mostly.models(model_type)
|
|
130
|
-
mostly.computes()
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### User Info
|
|
134
|
-
|
|
135
|
-
```python
|
|
136
|
-
mostly.me()
|
|
137
|
-
mostly.about()
|
|
138
|
-
|
|
139
|
-
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|