Re: [amibroker] Re: Machine Learning: my first system

 


What is the interpretation for the "Classification" XYPlot?
- Green = correctly predicted positives?
- Red = correctly predicted negatives?
- Black = misclassified?
Correct.

On 3/31/2016 7:31 AM, richpach2@yahoo.com [amibroker] wrote:
Does the LogisticRegression function accept more than two feature columns or do we have to adjust the code for that?

Yes it does, and here is how you prepare the feature and target vectors within AB for the selected range in exploration
ploy ( x , degree ) will create additional features based on input matrix "x"

bi = BarIndex ();

n = 4; // num features ;
ftr0 = 1;
ftr1 = RSI(2) ;
ftr2 = MACD();
setForeign ( "^ViX" );
ftr3 = ROC ( C, 1 ) ;
RestorePriceArrays ();


Filter = 1;
target = Ref ( Close , 1 ) / Close > 1  ;

nulls = NullCount ( target );
for( j = 0; j < n ; j ++ )
{
    ftr = VarGet( "ftr" + j )  ;
    nulls = Max ( nulls , NullCount ( ftr ));
    AddColumn ( ftr, "ftr" + j );
}

x = Matrix ( BarCount, n );
y = Matrix ( BarCount , 1 ) ;
for( j = 0; j < n ; j ++ )
{
    ftr = VarGet( "ftr" + j )  ;
    ftr = IIf ( bi < nulls , Null , ftr );
    AddColumn ( ftr, "ftr" + j );
    x = MxSetBlock ( x, 0, BarCount -1 , j , j , ftr );
}
target = IIf ( bi < nulls , Null , target );
y = MxSetBlock ( y, 0, BarCount -1 , 0 , 0 , target );


fbr = Status ( "firstbarinrange" ) ;
lbr = Status ( "lastbarinrange" ) ;
fb = LastValue ( ValueWhen ( fbr, bi ));
lb = LastValue ( ValueWhen ( lbr, bi ));

x = MxGetBlock ( x, fb, lb , 0 , n -1 );
y = MxGetBlock ( y, fb, lb , 0 , 0);

// x = poly ( x , 5 );
// x = scale ( x ) ;

_tracef ( MxToString ( x ) );
_tracef ( MxToString ( y ) );

//.....

__._,_.___

Posted by: Aron Pipa <aron@myafl.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (15)

Check out the automatic photo album with 5 photo(s) from this topic.
fjafgajd.png eaecfife.png fbabehaj.png bajgjgce.png ehjjccei.png

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? The Yahoo Mail app is fast, beautiful and intuitive. Try it today!

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/


.

__,_._,___


EmoticonEmoticon