Please I am working on AdultDataset for a classification task
I found out: from dataset import AdultDataset
is giving the error below:
ImportError: cannot import name 'AdultDataset' from 'dataset'
Import Relevant Libraries
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.preprocessing import LabelEncoder
from sklearn.model_selection import train_test_split
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torch.utils.data import DataLoader
from dataset import AdultDataset
So when I am trying to create a 3 layer Feed Forward Neural network
using pytorch that takes as input the a dataset entries and classifies
if the individuals gains more or less than 50K (i.e., the fnlwgt label)
starting with the code below I get an error
train_dataset = AdultDataset(X_train, y_train)
test_dataset = AdultDataset(X_test, y_test)
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-49-4ab31bdb6258> in <module>
1 # Using norm_D01
2
----> 3 train_dataset = AdultDataset(X_train, y_train)
4 test_dataset = AdultDataset(X_test, y_test)
5
NameError: name 'AdultDataset' is not defined
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…