Skip to content

Commit

Permalink
move sklearn multi datatype model build scripts to docs
Browse files Browse the repository at this point in the history
Signed-off-by: Suresh Nakkeran <suresh.n@ideas2it.com>
  • Loading branch information
Suresh-Nakkeran committed Jan 11, 2022
1 parent 933c06d commit 572e60d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 3 deletions.
Empty file.
@@ -0,0 +1,11 @@
import pandas as pd
from sklearn.base import TransformerMixin


class DictToDFTransformer(TransformerMixin):

def transform(self, X, y=None):
return pd.DataFrame(X)

def fit(self, X, y=None):
return self
Binary file not shown.
Expand Up @@ -119,7 +119,7 @@
"data": {
"text/plain": [
"Pipeline(steps=[('dicttodf',\n",
" <custom_transformer.custom_transformer.DictToDFTransformer object at 0x7fe5618c9d30>),\n",
" <custom_transformer.DictToDFTransformer object at 0x7fa5120c8e20>),\n",
" ('preprocess',\n",
" ColumnTransformer(transformers=[('numerical',\n",
" Pipeline(steps=[('simpleimputer',\n",
Expand Down Expand Up @@ -160,7 +160,7 @@
{
"data": {
"text/plain": [
"['./example_models/multi_datatype/model/model.joblib']"
"['model.joblib']"
]
},
"execution_count": 8,
Expand All @@ -169,7 +169,7 @@
}
],
"source": [
"joblib.dump(model, \"./example_models/multi_datatype/model/model.joblib\")"
"joblib.dump(model, \"model.joblib\")"
]
},
{
Expand Down
Binary file not shown.

0 comments on commit 572e60d

Please sign in to comment.