Showing posts with label value. Show all posts
Showing posts with label value. Show all posts

Monday, March 19, 2012

How manipulate the color property of a table cell

Hi

I am trying to change the colour of table cell if it's value is less than zero.

I know how to use IIF and have it working fine elsewhere.

My challenge is that I want to set the IIF in the color property of one cell of a table.

I can not seem to get to the property window for a cell. I can get to it for a row or a column or a group but not an individual cell. Any one know how I can do this?

The reason I need to do this is that the the column of interest has a group and a detail and I need to set the IIF expression at detail and group level. The detail works fine but the group needs the IIF with SUM and I need to set it at that level.

Thanks

e.g I want:

-60


-40

-20

but get:

-60


-40

-20

Just select the individual textbox in the table cell and look at the properties window (usually in the right bottom corner of the VS environment). You can set the color expression directly there.

-- Robert

Friday, March 9, 2012

How is the 'Score' value derived in the Lift chart/Mining legend for Data Mining Models?

Hi,

I have just run a simple data set through a model to predict a simple true or false value (i.e. binary output)

The Lift Chart/Mining Legend in Analysis Services shows three results – Score, Population Correct (%), and Predict Probability (%)

Population Correct I beleive is the percentage of predictions it got right out of the total number of predictions it tried to make. Is this correct?

However, I can’t work out how the other two are derived in particular the 'SCORE'. To give a live example the scores were as follows:

Model Score Pop Correct Pred Probability

Decision Trees 0.83 76.59% 54.28%

Neural Network 0.75 67.63% 50.05%

Ideal Model 100.00%

Can anyone help with this and give a detailed explanation?

Many thanks,

S Rajput

Hi

The Predict Probability is the probability of the most popular prediction state for the model.

The Score is the log scatter score for a scatter plot of (x=Actual Value,y=Predicted Value) where each point has an associated probability. There are a lot of examples on the mathematical series for this calculation which you can look up.

Hope this helps.

Shuvro

|||

So does a larger score mean a better fit for the model? How is a scatter score calculated?

|||

Here're some more details about the scatter score calculation:

This score is the (geometric) mean score of all the points constituting the scatter plot.

Here is how it works.

0) Each point on a scatter plot corresponds to a test case and has the form (a,b(M)), where a is the actual attribute value for the case and b(M) is the value predicted using the model M;

1) First define the score(a,b(M)) for *one* individual scatter point; to do this compare the (a,b(M)) to the best prediction we can do without using any model; that prediction is of course marginalMean; so

score(a,b(M)) = likelihood ( b(M), given a, given M) / likelihood( marginalMean, given a)

2) Then average out all the scores across the entire scatter plot;

Technically is was simpler to average them out as

score = ( Product[ score(a,b) | forall (a,b) in the scatter plot])^(1/n), where n is the number of points in the scatter plot.

So that’s how it is currently done.

Details:

The statistical meaning of the individual point score is the predictive lift for the model M measured at that point. It is essentially the same notion as the Predict Likelihood fraction for the case contributed by the continuous attribute for which the scatter plot has been built.

The specific formula for this is score(a,b) = pdf( N(a, predictStdev), b) / pdf( N(a, marginalStdev), marginalMean)

where N(mu, sigma) is the normal distribution with mean of mu and Stdev sigma and

pdf(N(mu, sigma), x) is its probability density function described by exp((x-mu)^2/(2*sigma))/sqrt(2Pi)/sigma.

Wednesday, March 7, 2012

How is the 'Score' value derived in the Lift chart/Mining legend for Data Mining Model

Hi,

I have just run a simple data set through a model to predict a simple true or false value (i.e. binary output)

The Lift Chart/Mining Legend in Analysis Services shows three results – Score, Population Correct (%), and Predict Probability (%)

Population Correct I beleive is the percentage of predictions it got right out of the total number of predictions it tried to make. Is this correct?

However, I can’t work out how the other two are derived in particular the 'SCORE'. To give a live example the scores were as follows:

Model Score Pop Correct Pred Probability

Decision Trees 0.83 76.59% 54.28%

Neural Network 0.75 67.63% 50.05%

Ideal Model 100.00%

Can anyone help with this and give a detailed explanation?

Many thanks,

S Rajput

Hi

The Predict Probability is the probability of the most popular prediction state for the model.

The Score is the log scatter score for a scatter plot of (x=Actual Value,y=Predicted Value) where each point has an associated probability. There are a lot of examples on the mathematical series for this calculation which you can look up.

Hope this helps.

Shuvro

|||

So does a larger score mean a better fit for the model? How is a scatter score calculated?

|||

Here're some more details about the scatter score calculation:

This score is the (geometric) mean score of all the points constituting the scatter plot.

Here is how it works.

0) Each point on a scatter plot corresponds to a test case and has the form (a,b(M)), where a is the actual attribute value for the case and b(M) is the value predicted using the model M;

1) First define the score(a,b(M)) for *one* individual scatter point; to do this compare the (a,b(M)) to the best prediction we can do without using any model; that prediction is of course marginalMean; so

score(a,b(M)) = likelihood ( b(M), given a, given M) / likelihood( marginalMean, given a)

2) Then average out all the scores across the entire scatter plot;

Technically is was simpler to average them out as

score = ( Product[ score(a,b) | forall (a,b) in the scatter plot])^(1/n), where n is the number of points in the scatter plot.

So that’s how it is currently done.

Details:

The statistical meaning of the individual point score is the predictive lift for the model M measured at that point. It is essentially the same notion as the Predict Likelihood fraction for the case contributed by the continuous attribute for which the scatter plot has been built.

The specific formula for this is score(a,b) = pdf( N(a, predictStdev), b) / pdf( N(a, marginalStdev), marginalMean)

where N(mu, sigma) is the normal distribution with mean of mu and Stdev sigma and

pdf(N(mu, sigma), x) is its probability density function described by exp((x-mu)^2/(2*sigma))/sqrt(2Pi)/sigma.

How is 'change' defined ?

Can anyone tell me how a change is defined when replicating ? in particular, if an update is done to an existing row, but the value is actually the same as it was originally, does this count as a change and will the replication attempt to update/resolve
it or not ?
I am working in a scenario where it is quite important to minimise the time/quantity of replication so want to minimise any unnecessary replicating. Are there any techniques I can use to help with this ?
any change is replicated.
|||Bother!
But thanks
|||Sarah wrote:
> Can anyone tell me how a change is defined when replicating ? in particular, if an update is done to an existing row, but the value is actually the same as it was originally, does this count as a change and will the replication attempt to update/resolv
e it or not ?
> I am working in a scenario where it is quite important to minimise the time/quantity of replication so want to minimise any unnecessary replicating. Are there any techniques I can use to help with this ?
Basically the log is replicated. So any action that will make a commited
change in the log will be replicated.
Furthermore, if you are doing updated, there is a possiblity that
inserts/deletes are replicated instead.
Typically, if you have a table with a unique index and you make an
update which update this index, sql server will replace your update by
an insert/delete and this is what will be sent to subscribers
|||Hi Sarah,
If you have a lot of updates that are setting columns to the same value
repeatedly, you can minimize the the replication volume by adding additional
"where" criteria to your update statements. For example, if you have a
statement (psuedo-code)
set @.val1 = 'XXX'
set @.tblKey = '123'
update TABLEX set fieldA = @.val1 where tblKey= @.tblKey
and you execute this 100 times, it will generate 100 updates, and 100
replication transactions.
If you add a where clause like so
update TABLEX set fieldA = @.val1 where tblKey= @.tblKey and fieldA <> @.val1
ii will not update the row after the first time. This type of clause
generally doesn't add much overhead to the transaction.
Ed
"Sarah" <anonymous@.discussions.microsoft.com> wrote in message
news:A8B78B80-4AF0-43FE-B3A8-8678C072C3E2@.microsoft.com...
> Can anyone tell me how a change is defined when replicating ? in
particular, if an update is done to an existing row, but the value is
actually the same as it was originally, does this count as a change and
will the replication attempt to update/resolve it or not ?
> I am working in a scenario where it is quite important to minimise the
time/quantity of replication so want to minimise any unnecessary
replicating. Are there any techniques I can use to help with this ?

Friday, February 24, 2012

How I get time value:

I have value '1/1/2005 12:53:10' (smalldatetime). I wanna get time value of
it. So I will get '12:53:10'. How to get? and what type suitable for this
problem?CONVERT(CHAR(8), your_small_date_time, 8)
Jacco Schalkwijk
SQL Server MVP
"Bpk. Adi Wira Kusuma" <adi_wira_kusuma@.yahoo.com.sg> wrote in message
news:ud9QH43lFHA.3656@.TK2MSFTNGP09.phx.gbl...
>I have value '1/1/2005 12:53:10' (smalldatetime). I wanna get time value of
> it. So I will get '12:53:10'. How to get? and what type suitable for this
> problem?
>|||hi
hope this will give u an idea
select CONVERT(CHAR(8), getdate(), 8)
best Regards,
Chandra
http://chanduas.blogspot.com/
http://groups.msn.com/SQLResource/
---
"Bpk. Adi Wira Kusuma" wrote:

> I have value '1/1/2005 12:53:10' (smalldatetime). I wanna get time value o
f
> it. So I will get '12:53:10'. How to get? and what type suitable for this
> problem?
>
>

Sunday, February 19, 2012

How get one value from one column from sqldatasource?

Hi, a few days i am trying to get one value from one column from database and put in one local variable (INT)......

i trying this:

protectedvoid SqlDataSource1_Load(object sender,EventArgs e)protectedvoid SqlDataSource1_Load(object sender,EventArgs e)

{

Int32 status;

SqlDataSource1.SelectCommand="SELECT status FROM users WHERE Username='" +Membership.GetUser() +"'";status = SqlDataSource1.Select(DataSourceSelectArguments.Empty);

}

"status" is the variable in question...

anyone can help me?

tank-you.

Prefered way would be ExcuteScalar

protected void ExecuteScalarDemo ( ) {
// specify the data source
SqlConnection myConn = new SqlConnection (
"server=( local )\\NetSDK; trusted_connection=yes; database=pubs" );

// define the command query
string query = "SELECT status FROM usersWHERE Username='" +Membership.GetUser() +"'";

// initialize command object with the specified query and connection
SqlCommand myCommand = new SqlCommand ( query, myConn );

// open the data connection
myConn.Open ( );

// execute the command
intstatus = ( int ) myCommand.ExecuteScalar ( );

// close the data connection
myConn.Close ( );
}

How get Fist Value of tabale

How get Fist Value of tabale

I know how to get min, max value of table I wont Fist Value of tabale PL Help Me

Did you try the First function in Reporting Services ?

ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/rptsrvr9/html/da44d746-c75d-465a-81ea-20bc0fb3c74f.htm

Jens k. Suessmeyer.

http://www.sqlserver2005.de