This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Make edits in the dataframe. | |
| d3.edge_properties | |
| # label x y ... stroke opacity tooltip | |
| # 0 acc 0.796433 0.745925 ... #000000 0.8 acc <br /> Survival: 44.5 | |
| # 1 acc 0.795550 0.739818 ... #000000 0.8 acc <br /> Survival: 55.0 | |
| # 2 acc 0.793272 0.739995 ... #000000 0.8 acc <br /> Survival: 63.8 | |
| # 3 acc 0.803293 0.747982 ... #000000 0.8 acc <br /> Survival: 11.9 | |
| # 4 acc 0.793152 0.725707 ... #000000 0.8 acc <br /> Survival: 79.7 | |
| # ... ... ... ... ... ... ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Load library | |
| from d3blocks import D3Blocks | |
| # Initialize | |
| d3 = D3Blocks(frame=True) | |
| # Import example | |
| df = d3.import_example('cancer') | |
| # Setup the tooltip | |
| tooltip=df['labels'].values + ' <br /> Survival: ' + df['survival_months'].astype(str).str[0:4].values |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Create interactive scatter plot | |
| from d3blocks import D3Blocks | |
| # Initialize | |
| d3 = D3Blocks() | |
| # Make scatter | |
| d3.scatter(map_pca[:,0], | |
| map_pca[:,1], | |
| x1=map_tsne[:,0], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Import library | |
| from d3blocks import D3Blocks | |
| # Initialize | |
| d3 = D3Blocks() | |
| # Make particles | |
| d3.particles('D3Blocks', collision=0.05, spacing=10, figsize=[1200, 500]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Import library | |
| from d3blocks import D3Blocks | |
| # Initialize | |
| d3 = D3Blocks() | |
| # import example | |
| df = d3.import_example('cancer') | |
| # Tooltip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ########################################## | |
| # Import Titanc dataset and preprocessing. | |
| ########################################## | |
| df = hgb.import_example(data='titanic') | |
| print(df) | |
| # PassengerId Survived Pclass ... Fare Cabin Embarked | |
| # 0 1 0 3 ... 7.2500 NaN S | |
| # 1 2 1 1 ... 71.2833 C85 C |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ####################################################### | |
| # Import Titanic dataset, and preprocessing | |
| ####################################################### | |
| # Import the Titanic dataset | |
| df = hgb.import_example(data='titanic') | |
| print(df) | |
| # PassengerId Survived Pclass ... Fare Cabin Embarked | |
| # 0 1 0 3 ... 7.2500 NaN S | |
| # 1 2 1 1 ... 71.2833 C85 C |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Import library | |
| from hgboost import hgboost | |
| # Initialize with default settings. | |
| hgb = hgboost() | |
| # hgb = hgboost(max_eval=250, threshold=0.5, cv=5, test_size=0.2, val_size=0.2, top_cv_evals=10, random_state=1, verbose=3) | |
| # Load example Titanic Dataset | |
| df = hgb.import_example() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas as pd | |
| # Create example dataset | |
| df = pd.DataFrame() | |
| df['source']= ['A', 'A', 'B', 'C', 'D'] | |
| df['target']= ['F', 'C', 'E', 'D', 'E'] | |
| df['weight']= [1, 1, 1, 1, 1] | |
| print(df) | |
| # source target weight |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Import library | |
| from d3blocks import D3Blocks | |
| # Initialize | |
| d3 = D3Blocks() | |
| # Import example | |
| df = d3.import_example('energy') | |
| # Input parameters. |
NewerOlder