All classifiers are locked in weka - weka

I want to start text classifying a database and all classifiers are locked and i can't use any of them, i've used stringtowordVector filter for them to open and they're still locked and this is my arff file
#relation emails
#attribute email string
#attribute class {normal,spam}
#data
"Hi, How are you I wish you are fine, would you fill this" normal
"buy this awesome shirt and get a free one" normal
"this is our bestselling product" normal
"hi, we just wanted to inform you that you had been fired" normal
"what's wrong with you are you crazy! Answer me now" spam
"Are you free now? I want to call you" spam
"reset your password now" normal
"your subscription is about to expire" normal
"what the hell is this, you are awesome" spam
"this is just a reminder, don't forget your assignment" normal
"you are a stupid manager" spam
"I just wanted to inform you that you are a silly man" spam
"hi, thanks for your interest in our platform, kindly pay" normal
"confirm your email to get started" normal
"your course had been withdrawed, see you later" normal
"you are my best friend" normal
"why didn't you came!" spam
"hi doctor, I didn't make any assignment, what should I do" spam

After applying the StringToWordVector, ensure that you select the correct attribute (class in your case) on the Classify tab. By default, the Explorer selects the last one. However, the StringToWordVector filter moves any class attribute to the start and therefore a word attribute, which is most likely numeric, will be selected automatically as the class.

Related

How to insert and update the inserted row in Oracle APEX?

I want my "Create" button to insert a row on a table and once inserted to update that row. The reason I need to insert that row first and then update is because some columns that I want to update depend on the value being there in the first place. For example I would like to update the "Gross Margin" column but the "Gross Margin" = Payrate + something else. If I don't have the value in "Payrate" column, well there is no way I can update "Gross Margin" since it depends on it.
What I have tried:
) Create a Dynamic Action that triggers if "create" button is clicked. If its clicked is true then run the 2 true actions of type "Execute server side code" which is the Insert statement and the other is the Update statement. I made sure that Insert has the first sequence(It runs first) then the update(It runs second). Please see below picture of the settings of the "Create" button.
Please see below picture of the settings of the "Dynamic action"
See below settings of the "Insert Action"
Below settings of the "Update Action"
2.) I have also tried by creating a "Process" that is binded to the "Create" button when clicked but it did not worked.
I am open to all suggestions and thank you in advance!
I created a workspace on apex.oracle.com to illustrate my answer:
workspace: SO_HELP, username: so_68399404, pwd: so_68399404
App 22384 (Demonstration - EMP / DEPT) is an app generated on the standard emp/dept sample dataset. In the report "Employees", there is a "create" button but employees can also be edited with the edit icon. Both the "create" button and the "edit" link point to the same form (page 4). The salary is depends on the job. If the job is MANAGER then salary is set to 5000 else salary is increased by 1. Similar to your requirement. I did this with an after submit computation with code
CASE WHEN :P4_JOB = 'MANAGER' THEN 5000 ELSE :P4_SAL + 1 END
No other code needed. No dynamic actions, no custom processes. All updates are handled by the process of type "Automatic Row Processing - DML". Login with the credentials above and have a look. If it is not what you need, please explain exactly what is different in this app - or create a new form/report on that data to illustrate your issue.
May I suggest you ask your questions this way ? Extract your problem out of your code and illustrate it with the sample dataset. No one knows your actual data, everyone knows the emp/dept schema. That can avoid endless discussions in the comments.

AppleScript:IF command doesn't execute

I am a beginner at AppleScript so I really don't know a lot. I have been trying to make the user select from a list of situations and then based on what they choose have an appropriate response. However, I have run into a few problems:
The script runs but doesn't display the notification.
Is there a better way than just chaining a lot of IF statements?
PS: I am nowhere near finishing this whole script.
on run
choose from list {"Thunderstorm", "Flood", "Heatwave", "Hazmat"} with prompt "Please select one of the emergency situations below" without multiple selections allowed and empty selection allowed
return the result as string
if string is Thunderstorm then display notification "hello"
end run
You made some pretty good guesses about what the sample code you were looking at does; but some of those guesses were wrong. With time you’ll get a better feel for how AppleScript works.
You have the situation names entered correctly as strings in the choose from list line, by surrounding their text with quotes. But in the check to see whether it’s a thunderstorm, you do not surround that text with quotes. AppleScript is looking in a variable called Thunderstorm for its contents, not looking at the string of text “Thunderstorm”.
return the result as string does not create a variable called string but rather ends the handler called run, returning the result to whatever code called run, as a string of text. To assign the result of choose from list to a variable, use something like set theSituation to the result as string.
Here’s an example of how your code might work better:
on run
--get the situation we're dealing with
choose from list {"Thunderstorm", "Flood", "Heatwave", "Hazmat"} with prompt "Please select one of the emergency situations below" without multiple selections allowed and empty selection allowed
copy the result as string to theSituation
--Thunderstorms require that the user be immediately notified
if theSituation is "Thunderstorm" then display notification "hello"
end run
Since you have this as a run handler, you probably don’t want to return any result, as you rarely call run handlers. But if you do need to return the result, the last line of the handler (just before end run) would be:
return theSituation
You might look around for an AppleScript tutorial that fits your needs. Apple has their Introduction to AppleScript Language Guide.
IF statements can be chained using if/else if/else if:
on run
--get the situation we're dealing with
choose from list {"Thunderstorm", "Flood", "Heatwave", "Hazmat"} with prompt "Please select one of the emergency situations below" without multiple selections allowed and empty selection allowed
copy the result as string to theSituation
--Thunderstorms require that the user be immediately notified
if theSituation is "Thunderstorm" then
display notification "hello"
else if theSituation is "Flood" then
display notification "hike pants"
else if theSituation is "Heatwave" then
display notification "Play Bing Crosby"
else if theSituation is "Hazmat" then
display notification "Use highway 183"
end if
end run
There is no switch/case control structure in AppleScript.

How to give a specific intent response in Amazon Lex based on an earlier response?

I have an initial intent used to classify the user ie Intent1 "I Need help" with a 1 slot (Slot 1) asking "what type of user are you? " The options are "userType1", "UserType2" and UserType3".
following this, with Amazon connect I have a a GetUserInput with multiple inputs. i.e. "What do you need help with?", with lots of intents new intents e.g Intent 2 "Shoes", Intent 3 "socks" Intent 4 "sandals.
Within Intent 2, I want to give a specific text response, Based on the answer to Slot1. the intents are different?
You have to manage context of the conversation to be able to take actions based on previous responses.
https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html
Basically in the first intent, based on the slot value you have to store it in session attributes, in the next intent you will check the value and generate the response.
Do check the OrderFlowers Blueprint Lambda function and this link. Notice that once the user gives the slot value of FlowerType it sets the price as session attribute.
Hope it helps, let me know if you have further doubts

osCommerce: custom price based on user input

I am writing a simple JavaScript which will update my price automatically (I know there are addons but they dont work with the nature of my products) when the user enters amount, size etc etc. I want to know how do I override the product price before/after it is sent to the shopping cart?
Example: The product price is 10€. The user select some variatons and then the price is 22,40€. I want to send that price to the checkout instead of the 10€.
So far I have written my JavaScript which updates the price based on user input and selections. I just need to know how to pass that new price variable and more important WHERE.
Any tips or help would be appreciated.
You mention "variations". Are you using attributes? If so, you can simply attach a price adjustment to each option value. That would be the quickest and most proper way to handle variation-specific pricing.

Track inventory feature with dynamic created "add to cart button"?

i have actually use form code to auto-generate information and etc.
I was wondering if i can implement the "track inventory qunatity" using dynamic generated buttons , just like in the website?
If this is not possible, how do i actually counter check with my own item quantity everytime a user press "add to cart" and it will minus off 1 quantity from my database.
And when they cancel the checkout , i would get the "-ed 1" back to my database?
Thanks alot, this is my first time working with paypal and have totally no clue
you would most likely handle that in your database with a stored procedure