Skip to content

Commit

Permalink
Merge pull request #856 from mindsdb/staging
Browse files Browse the repository at this point in the history
Release 22.4.1.0
  • Loading branch information
paxcema authored Apr 1, 2022
2 parents b05e8b4 + fee7201 commit 732eade
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
16 changes: 5 additions & 11 deletions .github/workflows/ligthtwood.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,12 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
os: [ubuntu-latest, windows-latest]
python-version: [3.7,3.8,3.9]
exclude:
# exclude combination due to #849
- os: windows-latest
python-version: 3.9
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -28,16 +32,6 @@ jobs:
pip install -r requirements_image.txt
pip install flake8
pip install -r tests/requirements.txt
echo "$DATABASE_CREDENTIALS" > ~/.mindsdb_credentials.json
sudo chmod 644 ~/.mindsdb_credentials.json
- name: Install dependencies Windows
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
pip install torch==1.7.0+cpu torchvision==0.8.1+cpu -f https://download.pytorch.org/whl/torch_stable.html;
fi
shell: bash
env:
CHECK_FOR_UPDATES: False
- name: Install dependencies OSX
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
Expand Down
2 changes: 1 addition & 1 deletion lightwood/__about__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
__title__ = 'lightwood'
__package_name__ = 'lightwood'
__version__ = '22.2.3.0'
__version__ = '22.4.1.0'
__description__ = "Lightwood is a toolkit for automatic machine learning model building"
__email__ = "[email protected]"
__author__ = 'MindsDB Inc'
Expand Down
6 changes: 5 additions & 1 deletion lightwood/api/json_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ def code_from_json_ai(json_ai: JsonAI) -> str:
trained_mixers = []
for mixer in self.mixers:
try:
mixer.fit(encoded_train_data, encoded_dev_data)
self.fit_mixer(mixer, encoded_train_data, encoded_dev_data)
trained_mixers.append(mixer)
except Exception as e:
log.warning(f'Exception: {{e}} when training mixer: {{mixer}}')
Expand Down Expand Up @@ -1115,6 +1115,10 @@ def fit(self, enc_data: Dict[str, pd.DataFrame]) -> None:
# Fit predictors to estimate target
{fit_body}
@timed
def fit_mixer(self, mixer, encoded_train_data, encoded_dev_data) -> None:
mixer.fit(encoded_train_data, encoded_dev_data)
@timed
def analyze_ensemble(self, enc_data: Dict[str, pd.DataFrame]) -> None:
# Evaluate quality of fit for the ensemble of mixers
Expand Down
3 changes: 2 additions & 1 deletion lightwood/mixer/neural.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@ def __call__(self, ds: EncodedDs,
ydf = pd.DataFrame({'prediction': decoded_predictions})

if args.predict_proba and self.supports_proba:
raw_predictions = np.array(all_probs).squeeze()
raw_predictions = np.array(all_probs).squeeze(axis=1)

for idx, label in enumerate(rev_map.values()):
ydf[f'__mdb_proba_{label}'] = raw_predictions[:, idx]

Expand Down
3 changes: 1 addition & 2 deletions tests/unit_tests/encoder/text/test_pretrained.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,9 @@ def test_encode_and_decode(self):

encoder_accuracy = accuracy_score(test_labels, pred_labels)

# Should be non-random since models have primed associations to sentiment
print(f'Categorial encoder accuracy for: {encoder_accuracy} on testing dataset')

assert(encoder_accuracy > 0.5) # Should be non-random since models have primed associations to sentiment

def test_embed_mode(self):
"""
Test if embed-mode is triggered when flagged.
Expand Down

0 comments on commit 732eade

Please sign in to comment.