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
from joblib import Parallel, delayed | |
import functools | |
import pandas as pd | |
def parallel_apply(partition_col=None, n_partitions=None): | |
""" | |
This decorator wraps any transformer function that takes in a pandas dataframe as some keyword argument, "data", | |
and returns a pandas dataframe. | |
Signature must be: |
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
from sklearn.linear_model import LogisticRegression | |
import numpy as np | |
import scipy.stats as stat | |
from scipy.sparse import issparse | |
class ActiveLearningLogisticRegression(LogisticRegression): | |
""" Wrapper class for scikit-learn's Logistic Regression classifier. | |
New Attributes: | |
--------------- |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
from sklearn import linear_model | |
import numpy as np | |
import scipy.stats as stat | |
class LogisticReg: | |
""" | |
Wrapper Class for Logistic Regression which has the usual sklearn instance | |
in an attribute self.model, and pvalues, z scores and estimated | |
errors for each coefficient in | |
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
# test |