Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken build #116

Merged
merged 1 commit into from
Feb 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ The DataWig API expects your data as a [pandas DataFrame](https://pandas.pydata.
| SDCards | Best SDCard ever ... | 8GB | Blue |
| Dress | This **yellow** dress | M | **?** |

### Quickstart Example

For most use cases, the `SimpleImputer` class is the best starting point. For convenience there is the function [SimpleImputer.complete](https://datawig.readthedocs.io/en/latest/source/API.html#datawig.simple_imputer.SimpleImputer.complete) that takes a DataFrame and fits an imputation model for each column with missing values, with all other columns as inputs:

```python
Expand All @@ -60,8 +62,10 @@ You can also impute values in specific columns only (called `output_column` belo
import datawig

df = datawig.utils.generate_df_string( num_samples=200,
data_column_name='sentences', label_column_name='label')
data_column_name='sentences',
label_column_name='label')

df_train, df_test = datawig.utils.random_split(df)

#Initialize a SimpleImputer model
imputer = datawig.SimpleImputer(
Expand Down Expand Up @@ -138,4 +142,4 @@ Run tests:
```
./venv/bin/pip install -r requirements/requirements.dev.txt
./venv/bin/python -m pytest
```
```
4 changes: 2 additions & 2 deletions datawig/imputer.py
Original file line number Diff line number Diff line change
Expand Up @@ -819,14 +819,14 @@ def predict(self,
predictions = self.predict_above_precision(data_frame, precision_threshold).items()
for label, imputations in predictions:
imputation_col = label + imputation_suffix
if data_frame.columns.contains(imputation_col):
if imputation_col in data_frame.columns:
raise ColumnOverwriteException(
"DataFrame contains column {}; remove column and try again".format(
imputation_col))

if label not in numerical_outputs:
imputation_proba_col = label + score_suffix
if data_frame.columns.contains(imputation_proba_col):
if imputation_proba_col in data_frame.columns:
raise ColumnOverwriteException(
"DataFrame contains column {}; remove column and try again".format(
imputation_proba_col))
Expand Down
10 changes: 5 additions & 5 deletions requirements/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
numpy>=1.15.0
scikit-learn[alldeps]>=0.20.0
typing>=3.6.6
pandas>=0.22.0
mxnet>=1.3.0
numpy==1.18.0
scikit-learn[alldeps]==0.22.1
typing==3.6.6
pandas==0.25.0
mxnet==1.4.0