Skip to content

Commit

Permalink
Merge pull request #1201 from mindsdb/fix/type_infer_0018
Browse files Browse the repository at this point in the history
fix: add compatibility for type-infer==0.0.18
  • Loading branch information
paxcema authored Dec 25, 2023
2 parents b3fd4c4 + e4e5344 commit 5409551
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,10 @@
}
],
"source": [
"from type_infer.infer import infer_types\n",
"from type_infer.api import infer_types\n",
"from type_infer.base import TypeInformation\n",
"\n",
"type_information = infer_types(df, problem_definition.pct_invalid)\n",
"type_information = infer_types(df, config={'engine': 'rule_based', 'pct_invalid': problem_definition.pct_invalid})\n",
"\n",
"{field.name for field in fields(TypeInformation)} # show the fields this dataclass has"
]
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__ = '23.12.2.0'
__version__ = '23.12.4.0'
__description__ = "Lightwood is a toolkit for automatic machine learning model building"
__email__ = "[email protected]"
__author__ = 'MindsDB Inc'
Expand Down
4 changes: 2 additions & 2 deletions lightwood/api/high_level.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pandas as pd
from lightwood.api.types import JsonAI, ProblemDefinition
from dataprep_ml.insights import statistical_analysis
from type_infer.infer import infer_types
from type_infer.api import infer_types
from lightwood.api.predictor import PredictorInterface
from lightwood.api.json_ai import generate_json_ai
from lightwood.helpers.codegen import code_from_json_ai as _code_from_json_ai, _module_from_code, _predictor_from_code
Expand Down Expand Up @@ -65,7 +65,7 @@ def json_ai_from_problem(df: pd.DataFrame, problem_definition: Union[ProblemDefi
log.info(f'Dropping features: {problem_definition.ignore_features}')
df = df.drop(columns=problem_definition.ignore_features)

type_information = infer_types(df, problem_definition.pct_invalid)
type_information = infer_types(df, config={'engine': 'rule_based', 'pct_invalid': problem_definition.pct_invalid})
stats = statistical_analysis(
df, type_information.dtypes, problem_definition.to_dict(), type_information.identifiers)

Expand Down
2 changes: 1 addition & 1 deletion lightwood/encoder/text/short.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import torch
from lightwood.encoder import BaseEncoder
from lightwood.encoder.categorical import CategoricalAutoEncoder
from type_infer.helpers import tokenize_text
from type_infer.rule_based.helpers import tokenize_text
from lightwood.helpers.torch import concat_vectors_and_pad, average_vectors
import pandas as pd

Expand Down
2 changes: 1 addition & 1 deletion tests/unit_tests/encoder/text/test_short.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import random
import unittest
from lightwood.encoder.text.short import ShortTextEncoder
from type_infer.helpers import tokenize_text
from type_infer.rule_based.helpers import tokenize_text
import torch

VOCAB = [
Expand Down

0 comments on commit 5409551

Please sign in to comment.