Skip to content

Commit 932c58a

Browse files
add deepnote link
1 parent 82047f7 commit 932c58a

File tree

35 files changed

+5161
-1384
lines changed

35 files changed

+5161
-1384
lines changed

data_science_tools/Datapane_new_features/analyzing_articles.ipynb

Lines changed: 65 additions & 65 deletions
Large diffs are not rendered by default.

data_science_tools/Datapane_new_features/iris_project.ipynb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"deepnote_cell_type": "code"
2323
},
2424
"source": "!pip install datapane",
25-
"execution_count": null,
26-
"outputs": []
25+
"outputs": [],
26+
"execution_count": null
2727
},
2828
{
2929
"cell_type": "code",
@@ -40,8 +40,8 @@
4040
"deepnote_cell_type": "code"
4141
},
4242
"source": "from sklearn.datasets import load_iris\nimport plotly.express as px \nimport datapane as dp ",
43-
"execution_count": null,
44-
"outputs": []
43+
"outputs": [],
44+
"execution_count": null
4545
},
4646
{
4747
"cell_type": "code",
@@ -55,7 +55,6 @@
5555
"deepnote_cell_type": "code"
5656
},
5757
"source": "import os\n\nTOKEN = os.environ[\"DATAPANE_TOKEN\"]\ndp.login(TOKEN)",
58-
"execution_count": null,
5958
"outputs": [
6059
{
6160
"name": "stdout",
@@ -70,7 +69,8 @@
7069
},
7170
"metadata": {}
7271
}
73-
]
72+
],
73+
"execution_count": null
7474
},
7575
{
7676
"cell_type": "code",
@@ -87,7 +87,6 @@
8787
"deepnote_cell_type": "code"
8888
},
8989
"source": "X, y = load_iris(as_frame=True, return_X_y=True)\nX.head(10)",
90-
"execution_count": null,
9190
"outputs": [
9291
{
9392
"output_type": "execute_result",
@@ -429,7 +428,8 @@
429428
},
430429
"metadata": {}
431430
}
432-
]
431+
],
432+
"execution_count": null
433433
},
434434
{
435435
"cell_type": "code",
@@ -446,8 +446,8 @@
446446
"deepnote_cell_type": "code"
447447
},
448448
"source": "fig = px.scatter(data_frame=X,\n x='sepal length (cm)',\n y='sepal width (cm)')",
449-
"execution_count": null,
450-
"outputs": []
449+
"outputs": [],
450+
"execution_count": null
451451
},
452452
{
453453
"cell_type": "code",
@@ -465,8 +465,8 @@
465465
"deepnote_cell_type": "code"
466466
},
467467
"source": "table = dp.DataTable(X)\nplot = dp.Plot(fig)",
468-
"execution_count": null,
469-
"outputs": []
468+
"outputs": [],
469+
"execution_count": null
470470
},
471471
{
472472
"cell_type": "code",
@@ -479,8 +479,8 @@
479479
"deepnote_cell_type": "code"
480480
},
481481
"source": "group = dp.Group(table, plot,\n columns=2)",
482-
"execution_count": null,
483-
"outputs": []
482+
"outputs": [],
483+
"execution_count": null
484484
},
485485
{
486486
"cell_type": "code",
@@ -493,14 +493,14 @@
493493
"deepnote_cell_type": "code"
494494
},
495495
"source": "dp.Report(group).publish(name='Iris', description='Show Iris data')",
496-
"execution_count": null,
497496
"outputs": [
498497
{
499498
"name": "stdout",
500499
"output_type": "stream",
501500
"text": "Publishing report and associated data - please wait..\nReport successfully published at https://datapane.com/u/khuyentran1401/reports/iris/\n"
502501
}
503-
]
502+
],
503+
"execution_count": null
504504
},
505505
{
506506
"cell_type": "markdown",

data_science_tools/Hyperdash.ipynb

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
"tags": [],
88
"cell_id": "00000-0d62bc9e-286e-448d-8d2b-486fa48f69e4",
99
"deepnote_cell_type": "markdown"
10-
},
11-
"outputs": [],
12-
"execution_count": null
10+
}
1311
},
1412
{
1513
"cell_type": "markdown",
@@ -30,8 +28,8 @@
3028
"deepnote_cell_type": "code"
3129
},
3230
"source": "!pip install --upgrade pip && pip install hyperdash",
33-
"execution_count": null,
34-
"outputs": []
31+
"outputs": [],
32+
"execution_count": null
3533
},
3634
{
3735
"cell_type": "code",
@@ -40,8 +38,8 @@
4038
"deepnote_cell_type": "code"
4139
},
4240
"source": "!hd signup",
43-
"execution_count": null,
44-
"outputs": []
41+
"outputs": [],
42+
"execution_count": null
4543
},
4644
{
4745
"cell_type": "code",
@@ -50,8 +48,8 @@
5048
"deepnote_cell_type": "code"
5149
},
5250
"source": "!hyperdash login",
53-
"execution_count": null,
54-
"outputs": []
51+
"outputs": [],
52+
"execution_count": null
5553
},
5654
{
5755
"cell_type": "markdown",
@@ -68,8 +66,8 @@
6866
"deepnote_cell_type": "code"
6967
},
7068
"source": "import numpy as np \nimport pandas as pd \n\ndisease = pd.read_csv('heart.csv')\ndisease.describe()\n\n#Split the data into train and test set\nfrom sklearn.model_selection import train_test_split\n\ntrain, test = train_test_split(disease, test_size = 0.2, random_state = 1)\n\nX_train = train.drop(['target','fbs'],axis=1)\ny_train = train['target']\n\nX_test = train.drop(['target','fbs'],axis=1)\ny_test = train['target']",
71-
"execution_count": null,
72-
"outputs": []
69+
"outputs": [],
70+
"execution_count": null
7371
},
7472
{
7573
"cell_type": "code",
@@ -78,8 +76,8 @@
7876
"deepnote_cell_type": "code"
7977
},
8078
"source": "from hyperdash import Experiment\nfrom sklearn.linear_model import SGDClassifier\nfrom sklearn.model_selection import cross_val_predict\nfrom sklearn.metrics import confusion_matrix\n\n#Declare your Experiment object each run\nexp = Experiment('SGDClassifier')\n\n#Record the value of the hyperparameter alpha\nalpha = exp.param('alpha', 0.01)\n\nsgd_model = SGDClassifier(random_state=1, alpha = alpha)\nsgd_model.fit(X_train, y_train)\n\n#Evaluate with cross validation score\nfrom sklearn.model_selection import cross_val_score\n\nscore = cross_val_score(sgd_model, X_train, y_train).mean()\nexp.metric('Accuracy', score)\n\n#Evaluate with confusion matrix\n\nsgd_predictions = cross_val_predict(sgd_model, X_train, y_train)\ntn, fp, fn, tp = confusion_matrix(y_train, sgd_predictions).ravel()\n\nexp.metric('True Negative', tn)\nexp.metric('False Positive', fp)\nexp.metric('False Negative', fn)\nexp.metric('True Positive', tp) \n\nexp.end()\n",
81-
"execution_count": null,
82-
"outputs": []
79+
"outputs": [],
80+
"execution_count": null
8381
},
8482
{
8583
"cell_type": "markdown",
@@ -96,8 +94,8 @@
9694
"deepnote_cell_type": "code"
9795
},
9896
"source": "from sklearn.ensemble import RandomForestClassifier\nfrom sklearn import metrics\nfrom hyperdash import monitor\n\n@monitor('RandomForestClassifier')\ndef random_forest(exp):\n \n n_estimators = 100\n forest_clf = RandomForestClassifier(random_state=1, n_estimators= n_estimators)\n forest_predictions = cross_val_predict(forest_clf, X_train, y_train )\n f1 = metrics.f1_score\n exp.metric('f1', f1)",
99-
"execution_count": null,
100-
"outputs": []
97+
"outputs": [],
98+
"execution_count": null
10199
},
102100
{
103101
"cell_type": "markdown",
@@ -114,8 +112,8 @@
114112
"deepnote_cell_type": "code"
115113
},
116114
"source": "from hyperdash import Experiment\nexp = Experiment(\"Dogs vs. Cats\")\n\n# Parameters\nestimators = exp.param(\"Estimators\", 500)\nepochs = exp.param(\"Epochs\", 5)\nbatch = exp.param(\"Batch Size\", 64)\n\nfor epoch in xrange(1, epochs + 1):\n accuracy = 1. - 1./epoch\n loss = float(epochs - epoch)/epochs\n print(\"Training model (epoch {})\".format(epoch))\n time.sleep(1)\n\n # Metrics\n exp.metric(\"Accuracy\", accuracy)\n exp.metric(\"Loss\", loss)\n\nexp.end()",
117-
"execution_count": null,
118-
"outputs": []
115+
"outputs": [],
116+
"execution_count": null
119117
},
120118
{
121119
"cell_type": "markdown",

0 commit comments

Comments
 (0)