@@ -77,9 +77,9 @@ def __init__(
77
77
** kwargs ,
78
78
):
79
79
self .recommendation_transformer = None
80
- if not isinstance ( shape , Tuple ) :
80
+ if shape is None :
81
81
shape = df .shape
82
- if not isinstance ( sampled_df , pd . DataFrame ) :
82
+ if sampled_df is None :
83
83
sampled_df = generate_sample (
84
84
df ,
85
85
shape [0 ],
@@ -161,7 +161,7 @@ def __init__(
161
161
cols .insert (0 , cols .pop (cols .index (target )))
162
162
self .sampled_df = self .sampled_df [[* cols ]]
163
163
164
- if not isinstance ( target_type , TypedFeature ) :
164
+ if target_type is None :
165
165
target_type = get_target_type (target , sampled_df , ** kwargs )
166
166
self .target = TargetVariable (self , target , target_type )
167
167
@@ -192,7 +192,7 @@ def from_dataframe(
192
192
from ads .dataset .forecasting_dataset import ForecastingDataset
193
193
from ads .dataset .regression_dataset import RegressionDataset
194
194
195
- if not isinstance ( sampled_df , pd . DataFrame ) :
195
+ if sampled_df is None :
196
196
sampled_df = generate_sample (
197
197
df ,
198
198
(shape or df .shape )[0 ],
@@ -201,7 +201,7 @@ def from_dataframe(
201
201
** init_kwargs ,
202
202
)
203
203
204
- if not isinstance ( target_type , TypedFeature ) :
204
+ if target_type is None :
205
205
target_type = get_target_type (target , sampled_df , ** init_kwargs )
206
206
207
207
if len (df [target ].dropna ()) == 0 :
0 commit comments