Browse Source

Update README.md

Former-commit-id: 3dc11aff62 [formerly 885cd9fd87] [formerly 70bcb418c5 [formerly 6f1ecc3116]] [formerly 632d2093f1 [formerly 65cf1e39f8] [formerly 6da842be90 [formerly 88b7ba05d1]]] [formerly 63ce699b1d [formerly e401c67b61] [formerly 1efd82a5a2 [formerly e6342194c2]] [formerly 0919f2ebc0 [formerly 68a203c7a6] [formerly 8d1103ec6e [formerly 02e6721509]]]] [formerly 7c9346966d [formerly fe3d76b3c6] [formerly bbc46f8211 [formerly 8b82c68cb7]] [formerly 9022b9e224 [formerly 38580b9aae] [formerly fa7c2b15e1 [formerly 8b46a19bd7]]] [formerly a8ef6b2f6c [formerly 071416a333] [formerly d048b90437 [formerly be128065fe]] [formerly c770aafdb1 [formerly 892716760d] [formerly 01e2f1ef2b [formerly 34a3c5737a]]]]] [formerly 07a0b718c2 [formerly b47bc41325] [formerly e61955af69 [formerly 8dba8ec6fd]] [formerly 7ae60683e8 [formerly df01a2f85d] [formerly c57e4c4292 [formerly b8a2bfebbf]]] [formerly b8d0f92f02 [formerly baa0d6d1d0] [formerly 0550bfb88e [formerly 5bf4535573]] [formerly f03c106fb3 [formerly 8480413a3b] [formerly 4cf1e6f5e1 [formerly a3a82ec846]]]] [formerly bf985d9133 [formerly 65e46f6711] [formerly 93c431033b [formerly c4fe560920]] [formerly 9e2ee3b321 [formerly 9220380024] [formerly 7e1615d943 [formerly 27bff5bba5]]] [formerly 90084704ea [formerly c3efc03245] [formerly cb4f4ca549 [formerly d7cf1a7617]] [formerly 45b76f5435 [formerly 69ee9205dc] [formerly 3a41a43299 [formerly 9c8e8ad68f]]]]]]
Former-commit-id: f964876a1d [formerly 547762d080] [formerly 7b9818cc93 [formerly d304e7cc88]] [formerly a4fa3fad37 [formerly d3c9d2540c] [formerly d1275fa452 [formerly 0716a9a739]]] [formerly e168bce1be [formerly bb03a20ed0] [formerly 48b2bb7c3c [formerly 77a2706c9a]] [formerly 67388b7f18 [formerly c81801b28c] [formerly c4fb0dc902 [formerly 66f9b46b5b]]]] [formerly fa7398c0a8 [formerly 89d7de7249] [formerly a4b3d896bf [formerly a42f7a8ebf]] [formerly cb3457867d [formerly 66dc161eb4] [formerly 916b83641b [formerly ea044f3ce1]]] [formerly 6bd59cde6a [formerly 4c3603efe1] [formerly 0d7c78691a [formerly c7bf2527c3]] [formerly 6925543571 [formerly 59ed38e4be] [formerly 3a41a43299]]]]
Former-commit-id: 479cbc7d75 [formerly 3f60cb47c5] [formerly 3b6f0bf000 [formerly e762b04258]] [formerly 2ebdf6014e [formerly 01932fcd00] [formerly f27b39b244 [formerly 7b7254009c]]] [formerly 4d76f898c3 [formerly 8df5ea343d] [formerly 103ee9cc55 [formerly 1fea8556e1]] [formerly 81cc775b50 [formerly d7cbc21c34] [formerly 97e3a2d1d6 [formerly 64cd991b89]]]]
Former-commit-id: 5b47cf1fac [formerly 25afa07d82] [formerly 950f13ddb9 [formerly d308d5fcaa]] [formerly 504a5475b4 [formerly 0efed40321] [formerly 27059566d2 [formerly d2fada4f0b]]]
Former-commit-id: efc758f343 [formerly e40f37c4a3] [formerly 42b370222a [formerly 59530c92ac]]
Former-commit-id: 9eba285d8f [formerly 30a704f1f7]
Former-commit-id: d0aca01729
master
Daochen Zha GitHub 4 years ago
parent
commit
8107402657
1 changed files with 11 additions and 16 deletions
  1. +11
    -16
      README.md

+ 11
- 16
README.md View File

@@ -24,24 +24,22 @@ Examples are available in [/examples](examples/). For basic usage, you can evalu
import pandas as pd

from tods import schemas as schemas_utils
from tods.utils import generate_dataset_problem, evaluate_pipeline
from tods import generate_dataset, evaluate_pipeline

table_path = 'datasets/yahoo_sub_5.csv'
target_index = 6 # what column is the target
#table_path = 'datasets/NAB/realTweets/labeled_Twitter_volume_IBM.csv' # The path of the dataset
time_limit = 30 # How many seconds you wanna search
#metric = 'F1' # F1 on label 1
metric = 'F1_MACRO' # F1 on both label 0 and 1

# Read data and generate dataset and problem
# Read data and generate dataset
df = pd.read_csv(table_path)
dataset, problem_description = generate_dataset_problem(df, target_index=target_index, metric=metric)
dataset = generate_dataset(df, target_index)

# Load the default pipeline
pipeline = schemas_utils.load_default_pipeline()

# Run the pipeline
pipeline_result = evaluate_pipeline(problem_description, dataset, pipeline)
pipeline_result = evaluate_pipeline(dataset, pipeline, metric)
print(pipeline_result)
```
We also provide AutoML support to help you automatically find a good pipeline for a your data.
```python
@@ -49,29 +47,26 @@ import pandas as pd

from axolotl.backend.simple import SimpleRunner

from tods.utils import generate_dataset_problem
from tods.search import BruteForceSearch
from tods import generate_dataset, generate_problem
from tods.searcher import BruteForceSearch

# Some information
#table_path = 'datasets/NAB/realTweets/labeled_Twitter_volume_GOOG.csv' # The path of the dataset
#target_index = 2 # what column is the target

table_path = 'datasets/yahoo_sub_5.csv'
target_index = 6 # what column is the target
#table_path = 'datasets/NAB/realTweets/labeled_Twitter_volume_IBM.csv' # The path of the dataset
time_limit = 30 # How many seconds you wanna search
#metric = 'F1' # F1 on label 1
metric = 'F1_MACRO' # F1 on both label 0 and 1

# Read data and generate dataset and problem
df = pd.read_csv(table_path)
dataset, problem_description = generate_dataset_problem(df, target_index=target_index, metric=metric)
dataset = generate_dataset(df, target_index=target_index)
problem_description = generate_problem(dataset, metric)

# Start backend
backend = SimpleRunner(random_seed=0)

# Start search algorithm
search = BruteForceSearch(problem_description=problem_description, backend=backend)
search = BruteForceSearch(problem_description=problem_description,
backend=backend)

# Find the best pipeline
best_runtime, best_pipeline_result = search.search_fit(input_data=[dataset], time_limit=time_limit)


Loading…
Cancel
Save