Skip to content

SVMSentimentAnalysis_Spark throwing error help needed please.......... #18

@mskarthi96

Description

@mskarthi96

ubuntu:~/Documents/deepsenti/Code/Spark$ python SVMSentimentAnalysis_Spark.py
2018-03-29 12:25:19 WARN Utils:66 - Your hostname, ubuntu resolves to a loopback address: 127.0.1.1; using 192.168.153.129 instead (on interface ens33)
2018-03-29 12:25:19 WARN Utils:66 - Set SPARK_LOCAL_IP if you need to bind to another address
2018-03-29 12:25:20 WARN NativeCodeLoader:62 - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
Setting default log level to "WARN".
To adjust logging level use sc.setLogLevel(newLevel). For SparkR, use setLogLevel(newLevel).
Traceback (most recent call last):
File "/usr/lib/python2.7/logging/init.py", line 861, in emit
msg = self.format(record)
File "/usr/lib/python2.7/logging/init.py", line 734, in format
return fmt.format(record)
File "/usr/lib/python2.7/logging/init.py", line 465, in format
record.message = record.getMessage()
File "/usr/lib/python2.7/logging/init.py", line 329, in getMessage
msg = msg % self.args
TypeError: not all arguments converted during string formatting
Logged from file SVMSentimentAnalysis_Spark.py, line 88
DEBUG:root:Starting Text to Integer Conversion
DEBUG:root:Starting Text to Integer Conversion
DEBUG:root:Starting Text to Integer Conversion
DEBUG:root:Starting Text to Integer Conversion
DEBUG:root:Max Features::0
DEBUG:root:Max Features::0
DEBUG:root:Max Features::0
DEBUG:root:Max Features::0
DEBUG:root:Balance Dataset
DEBUG:root:Balance Dataset
Traceback (most recent call last):
File "SVMSentimentAnalysis_Spark.py", line 221, in
print main("/home/mskarthi96/Documents/deepsenti/Code/Spark/Data/005051808404.txt",True,10,"","","","")
File "SVMSentimentAnalysis_Spark.py", line 189, in main
model.fit(Xtrain,Ytrain)
File "/usr/local/lib/python2.7/dist-packages/sklearn/multiclass.py", line 277, in fit
Y = self.label_binarizer_.fit_transform(y)
File "/usr/local/lib/python2.7/dist-packages/sklearn/base.py", line 455, in fit_transform
return self.fit(X, **fit_params).transform(X)
File "/usr/local/lib/python2.7/dist-packages/sklearn/preprocessing/label.py", line 305, in fit
raise ValueError('y has 0 samples: %r' % y)
ValueError: y has 0 samples: array([], dtype=float64)

how can i overcome this error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions