You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to implement my own dataset, but keep running into issues when using everwhereml.
I've implemented a decision tree approach using normal SKLearn and works fine.
Example using Standard Sklearn
data=pd.read_csv(config.get('Datasets', 'Minime'), delimiter=',')
# use Decision tree to classify Minime if it is good or bad
#drop first row
data = data[['Time', 'Flag']]
data['Time'] = data['Time'].str.replace(':', '')
data['Time'] = data['Time'].str.replace('.', '')
X = data.drop('Flag', axis=1)
y = data['Flag']
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.20)
classifier = DecisionTreeClassifier()
classifier.fit(X_train, y_train)
Example using everywhereml SKlearn
data=pd.read_csv(config.get('Datasets', 'Minime'), delimiter=',')
data = data[['Time', 'Flag']]
data['Time'] = data['Time'].str.replace(':', '')
data['Time'] = data['Time'].str.replace('.', '')
X = data.drop('Flag', axis=1)
y = data['Flag']
#X, y = make_blobs(n_samples=100, centers=3, n_features=2, random_state=0)
clf = DecisionTreeClassifier()
clf.fit(X, y)
Gives out this error in python3.9
Traceback (most recent call last):
File "/home/vasilisieropoulos/gitstuff/IoT-Ai/Machine Learning/thefinish.py", line 32, in <module>
clf.fit(X, y)
File "/home/vasilisieropoulos/anaconda3/lib/python3.9/site-packages/everywhereml/sklearn/SklearnBaseClassifier.py", line 95, in fit
self.dataset = Dataset.from_XY(X, y)
File "/home/vasilisieropoulos/anaconda3/lib/python3.9/site-packages/everywhereml/data/Dataset.py", line 39, in from_XY
return Dataset(
File "/home/vasilisieropoulos/anaconda3/lib/python3.9/site-packages/everywhereml/data/Dataset.py", line 124, in __init__
self.replace(X=X, y=y, feature_names=feature_names, target_names=target_names)
File "/home/vasilisieropoulos/anaconda3/lib/python3.9/site-packages/everywhereml/data/Dataset.py", line 195, in replace
self._update_df()
File "/home/vasilisieropoulos/anaconda3/lib/python3.9/site-packages/everywhereml/data/Dataset.py", line 285, in _update_df
data = np.hstack((self.X, self.y.reshape((-1, 1))))
File "/home/vasilisieropoulos/anaconda3/lib/python3.9/site-packages/pandas/core/generic.py", line 5575, in __getattr__
return object.__getattribute__(self, name)
AttributeError: 'Series' object has no attribute 'reshape'
Is this due to the python version or something else ? I can't get this to work in python3.10 since the Iterable abstract class was removed from collections in Python 3.10.
The text was updated successfully, but these errors were encountered:
I've been trying to implement my own dataset, but keep running into issues when using everwhereml.
I've implemented a decision tree approach using normal SKLearn and works fine.
Example using Standard Sklearn
Example using everywhereml SKlearn
Gives out this error in python3.9
Is this due to the python version or something else ? I can't get this to work in python3.10 since the Iterable abstract class was removed from collections in Python 3.10.
The text was updated successfully, but these errors were encountered: