Skip to content

Instantly share code, notes, and snippets.

View xordux's full-sized avatar
💭
How do you eat an elephant?

Rohit Rawat xordux

💭
How do you eat an elephant?
View GitHub Profile
from sklearn.base import TransformerMixin
class DataTransformer(TransformerMixin):
def fit(self, X, y=None):
return self
def transform(self, X, y=None):
return X
from sklearn.base import TransformerMixin
class DataTransformer(TransformerMixin):
def fit(self, X, y=None):
return self
def transform(self, X, y=None):
return X
import pandas as pd
from sklearn.base import TransformerMixin
from xgboost import XGBClassifier
from sklearn.pipeline import Pipeline
from sklearn import metrics
class DataTransformer(TransformerMixin):
def fit(self, X, y=None):
assert isinstance(X, pd.DataFrame)
import pandas as pd
from sklearn.base import TransformerMixin
from xgboost import XGBClassifier
from sklearn.pipeline import Pipeline
from sklearn import metrics
class DataTransformer(TransformerMixin):
def cabin(self, val):
if type(val) != str or val == "":
@xordux
xordux / Pandas_describe.py
Last active December 26, 2019 14:17
Explaining use of pandas.describe
import pandas as pd
# using Kaggle's famous Titanic Dataset below
data = pd.read_csv("train.csv")
print(data.describe(include = 'all'))
import pandas as pd
# using Kaggle's famous Titanic Dataset below
data = pd.read_csv("train.csv")
profile = data.profile_report(title='Titanic Dataset Profile')
profile.to_file(output_file="output.html")