Skip to content

Commit

Permalink
Update user guides
Browse files Browse the repository at this point in the history
  • Loading branch information
ZebinYang committed May 18, 2023
1 parent 5347534 commit c1bf14d
Show file tree
Hide file tree
Showing 151 changed files with 4,565 additions and 1,606 deletions.
Binary file not shown.
Binary file not shown.
Binary file modified docs/_build/doctrees/auto_examples/data/plot_2_data_eda.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/guides/data/data_eda.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/guides/data/data_prepare.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/guides/data/data_quality.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/guides/data/data_summary.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/guides/data/feature_select.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/guides/data/twosample_test.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/install.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/modules/generated/piml.Experiment.doctree
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"%matplotlib inline"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -22,7 +33,43 @@
},
"outputs": [],
"source": [
"from piml import Experiment\n\nexp = Experiment()\nexp.data_loader(data=\"BikeSharing\", silent=True)\n\nexp.data_summary(feature_type={},feature_exclude=[])"
"from piml import Experiment\n\nexp = Experiment(highcode_only=True)\nexp.data_loader(data=\"BikeSharing\", silent=True)\n\nexp.data_summary(feature_type={}, feature_exclude=[])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Feature removal\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"exp.data_summary(feature_exclude=[\"yr\", \"mnth\", \"temp\"])"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Change feature types\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"exp.data_summary(feature_type={\"weekday\": \"categorical\"})"
]
}
],
Expand All @@ -42,7 +89,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
"version": "3.9.12"
}
},
"nbformat": 4,
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@

# %%
# correlation heatmap
exp.eda(show='multivariate', multi_type='correlation_heatmap', figsize=(5, 4))
exp.eda(show='multivariate', multi_type='correlation_heatmap', figsize=(6, 5))

# %%
# correlation graph
exp.eda(show='multivariate', multi_type='correlation_graph', figsize=(5, 4))
exp.eda(show='multivariate', multi_type='correlation_graph', figsize=(6, 5))
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@
# Experiment initialization and data preparation
from piml import Experiment

exp = Experiment()
exp = Experiment(highcode_only=True)
exp.data_loader(data="BikeSharing", silent=True)

exp.data_summary(feature_type={},feature_exclude=[])
exp.data_summary(feature_type={}, feature_exclude=[])

#%%
# Feature removal
exp.data_summary(feature_exclude=["yr", "mnth", "temp"])

#%%
# Change feature types
exp.data_summary(feature_type={"weekday": "categorical"})
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
},
"outputs": [],
"source": [
"exp.eda(show='multivariate', multi_type='correlation_heatmap', figsize=(5, 4))"
"exp.eda(show='multivariate', multi_type='correlation_heatmap', figsize=(6, 5))"
]
},
{
Expand All @@ -159,7 +159,7 @@
},
"outputs": [],
"source": [
"exp.eda(show='multivariate', multi_type='correlation_graph', figsize=(5, 4))"
"exp.eda(show='multivariate', multi_type='correlation_graph', figsize=(6, 5))"
]
}
],
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,30 @@

#%%
# Experiment initialization and data preparation
import numpy as np
from piml import Experiment

exp = Experiment()
exp.data_loader(data="BikeSharing", silent=True)

exp.data_prepare(target='cnt', task_type='Regression', sample_weight=None,
#%%
# Random split
exp.data_prepare(target='cnt', task_type='regression', sample_weight=None,
split_method='random', test_ratio=0.2, random_state=0)

import numpy as np
custom_train_idx = np.arange(0,16000)
#%%
# Outer-sample-based split
exp.data_prepare(target='cnt', task_type='regression', sample_weight=None,
split_method='outer-sample', test_ratio=0.2, random_state=0)

#%%
# KMeans-based split
exp.data_prepare(target='cnt', task_type='regression', sample_weight=None,
split_method='kmeans', test_ratio=[0.0, 1.0, 0.0], random_state=0)

#%%
# Custom split
custom_train_idx = np.arange(0, 16000)
custom_test_idx = np.arange(16000, 17379)
exp.data_prepare(train_idx=custom_train_idx, test_idx=custom_test_idx)
exp.data_prepare(target='cnt', task_type='regression', sample_weight=None,
train_idx=custom_train_idx, test_idx=custom_test_idx)
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,79 @@
},
"outputs": [],
"source": [
"from piml import Experiment\n\nexp = Experiment()\nexp.data_loader(data=\"BikeSharing\", silent=True)\n\nexp.data_prepare(target='cnt', task_type='Regression', sample_weight=None,\n split_method='random', test_ratio=0.2, random_state=0)\n\nimport numpy as np\ncustom_train_idx = np.arange(0,16000)\ncustom_test_idx = np.arange(16000, 17379)\nexp.data_prepare(train_idx=custom_train_idx, test_idx=custom_test_idx)"
"import numpy as np\nfrom piml import Experiment\n\nexp = Experiment()\nexp.data_loader(data=\"BikeSharing\", silent=True)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Random split\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"exp.data_prepare(target='cnt', task_type='regression', sample_weight=None,\n split_method='random', test_ratio=0.2, random_state=0)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Outer-sample-based split\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"exp.data_prepare(target='cnt', task_type='regression', sample_weight=None,\n split_method='outer-sample', test_ratio=0.2, random_state=0)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"KMeans-based split\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"exp.data_prepare(target='cnt', task_type='regression', sample_weight=None,\n split_method='kmeans', test_ratio=[0.0, 1.0, 0.0], random_state=0)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Custom split\n\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"custom_train_idx = np.arange(0, 16000)\ncustom_test_idx = np.arange(16000, 17379)\nexp.data_prepare(target='cnt', task_type='regression', sample_weight=None, \n train_idx=custom_train_idx, test_idx=custom_test_idx)"
]
}
],
Expand Down

This file was deleted.

Binary file not shown.
Binary file modified docs/_build/html/_images/sphx_glr_plot_2_data_eda_006.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/_build/html/_images/sphx_glr_plot_2_data_eda_007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c1bf14d

Please sign in to comment.