How to use jupyter - 10 common examples

To help you get started, we’ve selected a few jupyter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ZupIT / ritchie-formulas / jupyter / create / ml_template / src / formula / notebook_template.py View on Github external
from enum import Enum


class Estimator(Enum):
    SVC = "SVC"
    KNeighborsClassifier = "KNeighborsClassifier"
    RandomForestClassifier = "RandomForestClassifier"
    SGDClassifier = "SGDClassifier"
    SGDRegressor = "SGDRegressor"
    SVR = "SVR"
    MiniBatchKMeans = "MiniBatchKMeans"
    KMeans = "KMeans"


content = {}
content[Estimator.SVC.value] = {
    "import": "from sklearn.svm import SVC",
    "doc_link": "https://scikit-learn.org/stable\
    /modules/generated/sklearn.svm.SVC.html#sklearn.svm.SVC",
    "evaluation": "classification",
}
content[Estimator.KNeighborsClassifier.value] = {
    "import": "from sklearn.neighbors import KNeighborsClassifier",
    "doc_link": "https://scikit-learn.org/stable/modules/neighbors.html",
    "evaluation": "classification",
}
content[Estimator.RandomForestClassifier.value] = {
    "import": "from sklearn.ensemble import RandomForestClassifier",
    "doc_link": "https://scikit-learn.org/stable\
    /modules/generated/sklearn.ensemble.Random\
    ForestClassifier.html#sklearn.ensemble.RandomForestClassifier",
    "evaluation": "classification",
github ZupIT / ritchie-formulas / jupyter / create / ml_template / src / formula / notebook_template.py View on Github external
"evaluation": "regression",
}
content[Estimator.SVR.value] = {
    "import": "from sklearn.svm import SVR",
    "doc_link": "https://scikit-learn.org/\
    stable/modules/generated/sklearn.svm.\
    SVR.html#sklearn.svm.SVR",
    "evaluation": "regression",
}
content[Estimator.MiniBatchKMeans.value] = {
    "import": "from sklearn.cluster import MiniBatchKMeans",
    "doc_link": "https://scikit-learn.org/\
    stable/modules/clustering.html#mini-batch-k-means",
    "evaluation": "classification",
}
content[Estimator.KMeans.value] = {
    "import": "from sklearn.cluster import KMeans",
    "doc_link": "https://scikit-learn.org/\
    stable/modules/clustering.html#k-means",
    "evaluation": "clustering",
}


metrics = {
    "regression": [
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "## Regression Evaluation Metrics\n",
                "\n",
                "\n",
github ZupIT / ritchie-formulas / jupyter / create / ml_template / src / formula / notebook_template.py View on Github external
content[Estimator.RandomForestClassifier.value] = {
    "import": "from sklearn.ensemble import RandomForestClassifier",
    "doc_link": "https://scikit-learn.org/stable\
    /modules/generated/sklearn.ensemble.Random\
    ForestClassifier.html#sklearn.ensemble.RandomForestClassifier",
    "evaluation": "classification",
}
content[Estimator.SGDClassifier.value] = {
    "import": "from sklearn.linear_model import SGDClassifier",
    "doc_link": "https://scikit-learn.org/\
    stable/modules/generated/sklearn.linear\
    _model.SGDClassifier.html#sklearn.\
    linear_model.SGDClassifier",
    "evaluation": "classification",
}
content[Estimator.SGDRegressor.value] = {
    "import": "from sklearn.linear_model import SGDRegressor",
    "doc_link": "https://scikit-learn.org\
    /stable/modules/generated/sklearn.linear\
    _model.SGDRegressor.html#sklearn.linear_model.SGDRegressor",
    "evaluation": "regression",
}
content[Estimator.SVR.value] = {
    "import": "from sklearn.svm import SVR",
    "doc_link": "https://scikit-learn.org/\
    stable/modules/generated/sklearn.svm.\
    SVR.html#sklearn.svm.SVR",
    "evaluation": "regression",
}
content[Estimator.MiniBatchKMeans.value] = {
    "import": "from sklearn.cluster import MiniBatchKMeans",
    "doc_link": "https://scikit-learn.org/\
github ZupIT / ritchie-formulas / jupyter / create / ml_template / src / formula / notebook_template.py View on Github external
RandomForestClassifier = "RandomForestClassifier"
    SGDClassifier = "SGDClassifier"
    SGDRegressor = "SGDRegressor"
    SVR = "SVR"
    MiniBatchKMeans = "MiniBatchKMeans"
    KMeans = "KMeans"


content = {}
content[Estimator.SVC.value] = {
    "import": "from sklearn.svm import SVC",
    "doc_link": "https://scikit-learn.org/stable\
    /modules/generated/sklearn.svm.SVC.html#sklearn.svm.SVC",
    "evaluation": "classification",
}
content[Estimator.KNeighborsClassifier.value] = {
    "import": "from sklearn.neighbors import KNeighborsClassifier",
    "doc_link": "https://scikit-learn.org/stable/modules/neighbors.html",
    "evaluation": "classification",
}
content[Estimator.RandomForestClassifier.value] = {
    "import": "from sklearn.ensemble import RandomForestClassifier",
    "doc_link": "https://scikit-learn.org/stable\
    /modules/generated/sklearn.ensemble.Random\
    ForestClassifier.html#sklearn.ensemble.RandomForestClassifier",
    "evaluation": "classification",
}
content[Estimator.SGDClassifier.value] = {
    "import": "from sklearn.linear_model import SGDClassifier",
    "doc_link": "https://scikit-learn.org/\
    stable/modules/generated/sklearn.linear\
    _model.SGDClassifier.html#sklearn.\
github ZupIT / ritchie-formulas / jupyter / create / ml_template / src / formula / notebook_template.py View on Github external
def grid_search(estimator):
    if estimator not in [Estimator.SVC.value, Estimator.SVR.value]:
        return []

    return [
        {
            "cell_type": "markdown",
            "metadata": {},
            "source": [
                "# Gridsearch\n",
                "\n",
                "Finding the right parameters (like what C or gamma values to use) \
                is a tricky task. We can adopt a trial and error approach to \
                find the best fit. Through GridSearch, we can try different \
                combinations of parameters and roll with the best option. \
                You just need to feed a dictionary with possible parameters \
                and Scikit-learn will use the one with \
                the best score on the next train fit!",
github ZupIT / ritchie-formulas / jupyter / create / ml_template / src / formula / notebook_template.py View on Github external
}
content[Estimator.SGDRegressor.value] = {
    "import": "from sklearn.linear_model import SGDRegressor",
    "doc_link": "https://scikit-learn.org\
    /stable/modules/generated/sklearn.linear\
    _model.SGDRegressor.html#sklearn.linear_model.SGDRegressor",
    "evaluation": "regression",
}
content[Estimator.SVR.value] = {
    "import": "from sklearn.svm import SVR",
    "doc_link": "https://scikit-learn.org/\
    stable/modules/generated/sklearn.svm.\
    SVR.html#sklearn.svm.SVR",
    "evaluation": "regression",
}
content[Estimator.MiniBatchKMeans.value] = {
    "import": "from sklearn.cluster import MiniBatchKMeans",
    "doc_link": "https://scikit-learn.org/\
    stable/modules/clustering.html#mini-batch-k-means",
    "evaluation": "classification",
}
content[Estimator.KMeans.value] = {
    "import": "from sklearn.cluster import KMeans",
    "doc_link": "https://scikit-learn.org/\
    stable/modules/clustering.html#k-means",
    "evaluation": "clustering",
}


metrics = {
    "regression": [
        {
github ZupIT / ritchie-formulas / jupyter / create / ml_template / src / formula / notebook_template.py View on Github external
/modules/generated/sklearn.svm.SVC.html#sklearn.svm.SVC",
    "evaluation": "classification",
}
content[Estimator.KNeighborsClassifier.value] = {
    "import": "from sklearn.neighbors import KNeighborsClassifier",
    "doc_link": "https://scikit-learn.org/stable/modules/neighbors.html",
    "evaluation": "classification",
}
content[Estimator.RandomForestClassifier.value] = {
    "import": "from sklearn.ensemble import RandomForestClassifier",
    "doc_link": "https://scikit-learn.org/stable\
    /modules/generated/sklearn.ensemble.Random\
    ForestClassifier.html#sklearn.ensemble.RandomForestClassifier",
    "evaluation": "classification",
}
content[Estimator.SGDClassifier.value] = {
    "import": "from sklearn.linear_model import SGDClassifier",
    "doc_link": "https://scikit-learn.org/\
    stable/modules/generated/sklearn.linear\
    _model.SGDClassifier.html#sklearn.\
    linear_model.SGDClassifier",
    "evaluation": "classification",
}
content[Estimator.SGDRegressor.value] = {
    "import": "from sklearn.linear_model import SGDRegressor",
    "doc_link": "https://scikit-learn.org\
    /stable/modules/generated/sklearn.linear\
    _model.SGDRegressor.html#sklearn.linear_model.SGDRegressor",
    "evaluation": "regression",
}
content[Estimator.SVR.value] = {
    "import": "from sklearn.svm import SVR",
github ZupIT / ritchie-formulas / jupyter / create / ml_template / src / formula / notebook_template.py View on Github external
KMeans = "KMeans"


content = {}
content[Estimator.SVC.value] = {
    "import": "from sklearn.svm import SVC",
    "doc_link": "https://scikit-learn.org/stable\
    /modules/generated/sklearn.svm.SVC.html#sklearn.svm.SVC",
    "evaluation": "classification",
}
content[Estimator.KNeighborsClassifier.value] = {
    "import": "from sklearn.neighbors import KNeighborsClassifier",
    "doc_link": "https://scikit-learn.org/stable/modules/neighbors.html",
    "evaluation": "classification",
}
content[Estimator.RandomForestClassifier.value] = {
    "import": "from sklearn.ensemble import RandomForestClassifier",
    "doc_link": "https://scikit-learn.org/stable\
    /modules/generated/sklearn.ensemble.Random\
    ForestClassifier.html#sklearn.ensemble.RandomForestClassifier",
    "evaluation": "classification",
}
content[Estimator.SGDClassifier.value] = {
    "import": "from sklearn.linear_model import SGDClassifier",
    "doc_link": "https://scikit-learn.org/\
    stable/modules/generated/sklearn.linear\
    _model.SGDClassifier.html#sklearn.\
    linear_model.SGDClassifier",
    "evaluation": "classification",
}
content[Estimator.SGDRegressor.value] = {
    "import": "from sklearn.linear_model import SGDRegressor",
github ZupIT / ritchie-formulas / jupyter / create / ml_template / src / ml_template / notebook_template.py View on Github external
content[Estimator.SVC.value] = {
 "import": "from sklearn.svm import SVC",
 "doc_link": "https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html#sklearn.svm.SVC",
 "evaluation": "classification"
}
content[Estimator.KNeighborsClassifier.value] = {
 "import": "from sklearn.neighbors import KNeighborsClassifier",
 "doc_link": "https://scikit-learn.org/stable/modules/neighbors.html",
 "evaluation": "classification"
}
content[Estimator.RandomForestClassifier.value] = {
 "import": "from sklearn.ensemble import RandomForestClassifier",
 "doc_link": "https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.RandomForestClassifier.html#sklearn.ensemble.RandomForestClassifier",
 "evaluation": "classification"
}
content[Estimator.SGDClassifier.value] = {
 "import": "from sklearn.linear_model import SGDClassifier",
 "doc_link": "https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.SGDClassifier.html#sklearn.linear_model.SGDClassifier",
 "evaluation": "classification"
}
content[Estimator.SGDRegressor.value] = {
 "import": "from sklearn.linear_model import SGDRegressor",
 "doc_link": "https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.SGDRegressor.html#sklearn.linear_model.SGDRegressor",
 "evaluation": "regression"
}
content[Estimator.SVR.value] = {
 "import": "from sklearn.svm import SVR",
 "doc_link": "https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVR.html#sklearn.svm.SVR",
 "evaluation": "regression"
}
content[Estimator.MiniBatchKMeans.value] = {
 "import": "from sklearn.cluster import MiniBatchKMeans",
github ZupIT / ritchie-formulas / jupyter / create / ml_template / src / ml_template / notebook_template.py View on Github external
content[Estimator.SGDClassifier.value] = {
 "import": "from sklearn.linear_model import SGDClassifier",
 "doc_link": "https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.SGDClassifier.html#sklearn.linear_model.SGDClassifier",
 "evaluation": "classification"
}
content[Estimator.SGDRegressor.value] = {
 "import": "from sklearn.linear_model import SGDRegressor",
 "doc_link": "https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.SGDRegressor.html#sklearn.linear_model.SGDRegressor",
 "evaluation": "regression"
}
content[Estimator.SVR.value] = {
 "import": "from sklearn.svm import SVR",
 "doc_link": "https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVR.html#sklearn.svm.SVR",
 "evaluation": "regression"
}
content[Estimator.MiniBatchKMeans.value] = {
 "import": "from sklearn.cluster import MiniBatchKMeans",
 "doc_link": "https://scikit-learn.org/stable/modules/clustering.html#mini-batch-k-means",
 "evaluation": "classification"
}
content[Estimator.KMeans.value] = {
 "import": "from sklearn.cluster import KMeans",
 "doc_link": "https://scikit-learn.org/stable/modules/clustering.html#k-means",
 "evaluation": "clustering"
}


metrics = {
 "regression": [
  {
    "cell_type": "markdown",
    "metadata": {},