Accuracy Vs Generalization

Apr 15, 2006

Hi!

So sorry for posting yet another one of my silly posts about the correct way of doing things!



I am using Stored Procedures to do various things in my database (inserting/deleting/updating) and using SQL Server 2000 SP4



The current situation is that I have a stored procedure which checks certain user details and returns either -1 or 1 as a success indicator to the caller.



Now, obviously if we executed several queries in this stored procedure, performance will be an issue.

However, I have no idea how to balance up the whole "more useful information" vs "general information". What I mean is this:

if we are checking 3 items in a table, I want to return the success value back to the caller - in this case, we could do an IF statement to see if the record exists, if it does, set the return value to 1, else, -1.



But then you may want to be more informative to the user, specifically stating what part of the information they entered is incorrect/invalid. So having this in mind, we would then need to execute, say, 3 queries to return a more specific "error" value.



What should I do in this case?

I want to check the username, password and if the account is activated.

Currently I have this query going on:



IF EXISTS (SELECT [ID] FROM Users WHERE username = @un AND [password] = @pw AND activate = 1)

SET @theResult = 1

ELSE

SET @theResult = -1



firstly, is that the good way of doing things? if not - then what is the better way?

secondly, if we decide that we want a specific detailed return value/error message, it would mean I have to check the results I want using a couple more queries, such as one query to check username, one query to check password and another to check if the account is active or not and then return the appropriate value back to the caller.



is this a good way of doing things? I am confused and stuck!



Many thanks for your valuable response :)

View 3 Replies


ADVERTISEMENT

Generalization/specialization

Aug 2, 2007



I have a db design which includes generalization/specialization. How can I implement this in sql server?
thanks so much!

View 4 Replies View Related

SQL For Modeling Generalization Hierarchies

Jul 20, 2005

Is there a good approach to modelling many heterogeneous entity typeswith that have some attributes in common?Say I have entities "employees" which share some attibutes (e.g.firstname, lastname, dateofbirth) but some subsets of employees (e.g.physicians, janitors, nurses, ambulance drivers) may have additionalattributes that do not apply to all employees. Physicians may haveattributes specialty and date of board certification, ambulancedrivers may have a drivers license id, janitors may havepreferredbroomtype and so on.There are many employee subtypes and more can be dynamically addedafter the application is deployed so it's obviously no good to keepadding attributes to the employees table because most attributes willbe NULL (since janitors are never doctors at the same time).The only solution I found for this is a generalization hiearchy whereyou have the employee table with all generic attributes and then youadd tables for each new employee subtype as necessary. The subtypetables share the primary key of the employee table. The employee tablehas a "discriminator" field that allows you to figure out whichsubtype table to load for a particular entity.This solution does not seem to scale since for each value of"discriminator" I need to perform a join with a different table. Whatif I need to retrieve 1,000 employees at once?Is that possible to obtain a single ResultSet with one SQL statementSQL?Or do you I need to iterate look at the discriminator and thenperform the appropriate join? If this kind of iteration is necessarythen obviously this generalization hierarchy approach does not work inpracticesince it would be painfully slow.Is there a better approach to modelling these kind of heterogeneousentities with shared attributes that does not involve creating a tablefor each new employee type or having sparce tables (mostly filled withNULLS)I guess another approach would be to use name/value pairs but thatwould make reporting really ugly.Seems like a very common problem. Any ideas? Is this a fundamentallimitation of SQL?Thanks!- robert

View 13 Replies View Related

Please, How To Realize Generalization In Sql Server Database

Dec 12, 2006

please help, I need professional approach how to realize generalization(parent_table <- child_table) idea in sql server databse?in my Oracle db I can have PK of child_table as FK from parent_table: let'shave shop with shoes, selling shoes, and foosd as well. Example of keys inmy tables:Product (=parent_table)-------------12345Food (=child_table)-------------234Shoes (=child_table)-------------15Is that good idea, or not, and may I have the same in SQLServer (2005) ?(and, what about administrative aspects (likeperformance/concurency/updating ..) of generalization in RDMS?)regards

View 1 Replies View Related

Prediction Accuracy

Mar 5, 2007

Hi ,
I am a novice Data Mining Programmer.
I am using Time series algorithm for forecasting.
We are Quite concerned about the accuracy of Prediction output.
For Example Our Data is like this

StudId Date Perf
001 01/01/2001 90
001 02/01/2001 89
001 03/01/2001 87
002 01/01/2001 59
002 02/01/2001 70
003 03/01/2001 47

If I write my Prediction Query to predict for 100 th time step.Its giving me out put like

Date Perf
03/01/2015 47.000000115

We are not sure about the accuracy of the values. Is it possible to use trend information as input to my model and make my prediction based on that.
I don€™t know how to do that? Can anyone help?

Thanks,
Karthik.

View 1 Replies View Related

Prediction Accuracy

Dec 8, 2006

hi,

I am using time series agorithm.I need standard deviation in %. I am using SELECT StudID, PREDICTSTDEV([Perf]) FROM [Stud_Model].This one is giving me the standard deviation like this

StudID stDev

001 2.891298978779

002 2.797288978779.

But I need like this

StudID stDev

001 +50%

002 +51%(From The Previous) like that.

Is it Possible.

Thanks,

Karthik.

View 1 Replies View Related

Error On Mining Accuracy Tab

Jan 25, 2007

Hi All
I have installed SP2 for SQL server 2005, i just want to try datamining like in the tutorial, i found error if i click "Mining Accuracy Chart" for comparing model with error

"TITLE: Microsoft Visual Studio
An error prevented the view from loading.
ADDITIONAL INFORMATION:
Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)) (System.Windows.Forms)
"
any body can help.

thanks

View 3 Replies View Related

Mining Models Accuracy

May 10, 2007

Hello

I've created models with Decision Tree and Neural Network algorithms that predict continous target. But I don't know how to interpret scores that occure under scatter accuracy plot. How should I interpret scores under scatter accuracy plot?
How can I estimate occuracy of model created with Time Series? How can I compare accuracy of model created with Time Series with models created with Decision Trees and Neural Network algorithms?

Thanks in advance.

View 5 Replies View Related

Testing Stored Procedure For Accuracy

May 14, 2008

I am given a task to test a complex stored procedure that has been recently modified for performance. The stored procedure runs 2 processes based on different parameters provided to it in real time. The procedure has been modified to incresease its performance from 22hours to just 1 minute. One of the two processes that this SP handels have been tested and is thus very accurate. The testing of 2nd process is given to me and I am looking for some great help in how to go about testing it step by step. I can provide more info on the SP and how we increased its performance, if you are interested.
I know its a lot to ask but I really need some help. I have limited knowledge in SQL.

View 10 Replies View Related

Error In Mining Accuracy Chart

Dec 15, 2006

I ran a decision tree, clustering and neural network mining model across a dataset of about 200,000 records. I am trying to evaluate the accuracy of each of my models but I can't view the results.

I get the following error:

Failed to execute the query due to the following error:

XML for Analysis parser: The XML for Analysis request timed out before it was completed.
Execution of the managed stored procedure GenerateLiftTableUsingDatasource failed with the following error: Exception has been thrown by the target of an invocation.Microsoft::AnalysisServices::AdomdServer::AdomdException.

View 1 Replies View Related

Infromation About Accuracy Of The Mining Model Problem

Dec 23, 2005

Hello!

I have a problem getting information about accuracy (percentage of the right predictions) of the model using DMX. Is it possible to get information about accuracy of the model using DMX? I didn't find any useful function... My second idea was to build and process the model. And then compare states of the predictable columns of the test data to states that the model predicts on the same data. And count them. That would be the way to get percantage of the right predictions... The problem is that usage of the function COUNT is not allowed??? I tried:SELECT COUNT(*) FROM [My Model Name].Cases and it didn't work like in standard SQL...
Is it possible to count rows in DMX? Any idea how to get accuracy (percentage) of the model? I would need this information in my application...
Thanx for any idea,
Ziga

View 7 Replies View Related

Mining Accuracy Chart, Predictable Column In Nested Tables

Oct 27, 2006

In the Mining Accuracy Chart, the predictable columns of nested tables does not show up in the "Select predictable mining model columns to show in the lift chart" table. The "Predictable column name" is empty.

Predictable columns in the case table shows up, but not the predictable columns in the nested table. What am I missing?

-Young K

View 1 Replies View Related

Mining Structure Has To Contain At Least 2 Mining Models To See Their Accuracy Charts?

Nov 27, 2006

Hi ,all here,

Thank you very much for your kind attention.

I just found that I am not able to view the accuracy chart for my mining model. The error message is: no mining models are selected for comparision. Which is quite strange.

Any guidance? thank you very much.

With best regards,

Yours sincerely,

View 5 Replies View Related

How Get The Lift Chart In Datamining.i Am Not Geeting Mining Accuracy Chart And Mining Model Prediction

Sep 14, 2007



Hi,
I am not getting Mining Accuracy Chart and Min ing Model Prediction
Plz tel me how to do.And how to use the filter input data used to generate the lift chart and
select predictable mining model columns to show in the lift chart

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved