@@ -77,9 +77,9 @@ def __init__(
7777 ** kwargs ,
7878 ):
7979 self .recommendation_transformer = None
80- if not isinstance ( shape , Tuple ) :
80+ if shape is None :
8181 shape = df .shape
82- if not isinstance ( sampled_df , pd . DataFrame ) :
82+ if sampled_df is None :
8383 sampled_df = generate_sample (
8484 df ,
8585 shape [0 ],
@@ -161,7 +161,7 @@ def __init__(
161161 cols .insert (0 , cols .pop (cols .index (target )))
162162 self .sampled_df = self .sampled_df [[* cols ]]
163163
164- if not isinstance ( target_type , TypedFeature ) :
164+ if target_type is None :
165165 target_type = get_target_type (target , sampled_df , ** kwargs )
166166 self .target = TargetVariable (self , target , target_type )
167167
@@ -192,7 +192,7 @@ def from_dataframe(
192192 from ads .dataset .forecasting_dataset import ForecastingDataset
193193 from ads .dataset .regression_dataset import RegressionDataset
194194
195- if not isinstance ( sampled_df , pd . DataFrame ) :
195+ if sampled_df is None :
196196 sampled_df = generate_sample (
197197 df ,
198198 (shape or df .shape )[0 ],
@@ -201,7 +201,7 @@ def from_dataframe(
201201 ** init_kwargs ,
202202 )
203203
204- if not isinstance ( target_type , TypedFeature ) :
204+ if target_type is None :
205205 target_type = get_target_type (target , sampled_df , ** init_kwargs )
206206
207207 if len (df [target ].dropna ()) == 0 :
0 commit comments