On 2020-05-08 21:19, joseph pareti wrote:
yet, something is still unclear; in Python you can do things like:
*clf0.fit(X_train,y_train)*
which is not the way I programmed in other languages where a left-hand
side and a right hand side is required.
All it's doing is performing the calculation
yet, something is still unclear; in Python you can do things like:
*clf0.fit(X_train, y_train)*
which is not the way I programmed in other languages where a left-hand side
and a right hand side is required.
Am Fr., 8. Mai 2020 um 21:52 Uhr schrieb joseph pareti <
joeparet...@gmail.com>:
> yes,
yes, it is random forest classifier from scikit learn. Thank you.
Am Fr., 8. Mai 2020 um 21:50 Uhr schrieb MRAB :
> On 2020-05-08 20:02, joseph pareti wrote:
> > In general I prefer doing:
> >
> >
> > X_train, X_test, y_train, y_test = train_test_split(X, y,
> test_size=0.33, random_state=42)
>
On 2020-05-08 20:02, joseph pareti wrote:
In general I prefer doing:
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33,
random_state=42)
>clf = RandomForestClassifier(n_estimators = 100, max_depth=
None) *clf_f = clf.fit(X_train, y_train)* predicted_labels = clf_f.pred
In general I prefer doing:
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.33,
random_state=42) clf = RandomForestClassifier(n_estimators = 100, max_depth=
None) *clf_f = clf.fit(X_train, y_train)* predicted_labels = clf_f.predict(
X_test) score = clf.score(X_test, y_test) s
Jagga Soorma wrote:
> Thanks again Aldwin. This seems to work, guess it is the set that is
> flipping the numbers:
>
> x,y = (output.split())
The parens on the right are superfluous:
>>> a, b = "foo bar".split()
>>> a
'foo'
>>> b
'bar'
> inode_cmd = "/bin/df --output=pcent,ipcent /var| grep -
Thanks again Aldwin. This seems to work, guess it is the set that is
flipping the numbers:
x,y = (output.split())
Much appreciated!
On Wed, Oct 2, 2019 at 9:19 PM Aldwin Pollefeyt
wrote:
>
> Seems to work also:
>
> >>> [x,y] = output.split()
>
> On Thu, Oct 3, 2019 at 12:17 PM Aldwin Pollefeyt
Seems to work also:
>>> [x,y] = output.split()
On Thu, Oct 3, 2019 at 12:17 PM Aldwin Pollefeyt
wrote:
> Oh, sorry .. please try this:
>
> >>> x,y = tuple(output.split())
>
> On Thu, Oct 3, 2019 at 12:11 PM Jagga Soorma wrote:
>
>> Thanks Aldwin that helps but it looks like it is reversing the
Oh, sorry .. please try this:
>>> x,y = tuple(output.split())
On Thu, Oct 3, 2019 at 12:11 PM Jagga Soorma wrote:
> Thanks Aldwin that helps but it looks like it is reversing the numbers
> for some reason:
>
> the df command returns the following:
> 7 2
>
> I used your example and did:
> x,y =
Thanks Aldwin that helps but it looks like it is reversing the numbers
for some reason:
the df command returns the following:
7 2
I used your example and did:
x,y = set(output.split())
My assumption would be that x should be 7 and y should be 2. However,
when I print x and y it seems to be rev
You could use:
>>> x, y = set(output.split())
On Thu, Oct 3, 2019 at 11:44 AM Jagga Soorma wrote:
> Hello,
>
> I am new to python and trying to do some basic things with python. I
> am writing a script that runs a df command and I need parts of that
> output saved in 2 different variables. Is
Hello,
I am new to python and trying to do some basic things with python. I
am writing a script that runs a df command and I need parts of that
output saved in 2 different variables. Is this something that can be
done? I can do this by running multiple df commands but would prefer
to make only
On Apr 27, 5:26 pm, Dennis <[EMAIL PROTECTED]> wrote:
> Dennis wrote:
> > Could anyone tell me how this line of code is working:
>
> > filter(lambda x: x in string.letters, text)
>
> > I understand that it's filtering the contents of the variable text and I
> > know that lambda is a kind of embedde
I didn't give up after posting and managed to grasp this whole lambda
thing! No need to respond now :-) I understood it the moment I tried to
type out, instead of just thinking in my head, what was going on as a
normal function.
Dennis wrote:
Could anyone tell me how this line of code is wor
Could anyone tell me how this line of code is working:
filter(lambda x: x in string.letters, text)
I understand that it's filtering the contents of the variable text and I
know that lambda is a kind of embedded function.
What I'd like to know is how it would be written if it was a normal
fun
jmDesktop wrote:
[...]
> So what is n and x in the first iteration? Sorry. I'm trying.
Somewhat feebly, if you don't mind my saying so, but don't worry.
The usual way to proceed in the face of such ignorance is to insert some
form of output that will tell you the answer to your question.
So:
"jmDesktop" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> So what is n and x in the first iteration? Sorry. I'm trying.
Remember how Python's range operator works. range(n, x) constructs a list
that consists of all elements starting with n and up to, but /not
including/, x.
|So what is n and x in the first iteration? Sorry. I'm trying.
When n == 2, the inner loop executes 0 times (the length of range(2,n)) and
then falls thru to the else clause, printing the correct answer.
--
http://mail.python.org/mailman/listinfo/python-list
jmDesktop schrieb:
> On Apr 9, 4:58 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
>> jmDesktop schrieb:
>>
>>
>>
>>
>>
>>> From the Python.org tutorial:
>> for n in range(2, 10):
>>> ... for x in range(2, n):
>>> ... if n % x == 0:
>>> ... print n, 'equals', x, '*',
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:python-
> [EMAIL PROTECTED] On Behalf Of jmDesktop
> Sent: Wednesday, April 09, 2008 5:04 PM
> To: python-list@python.org
> Subject: Re: basic python question about for loop
>
> >
> > > >>&g
On Apr 9, 4:59 pm, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote:
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:python-
> > [EMAIL PROTECTED] On Behalf Of jmDesktop
> > Sent: Wednesday, April 09, 2008 4:51 PM
> > To: [EMAIL PROTECTED
On Apr 9, 4:58 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote:
> jmDesktop schrieb:
>
>
>
>
>
> > From the Python.org tutorial:
>
> for n in range(2, 10):
> > ... for x in range(2, n):
> > ... if n % x == 0:
> > ... print n, 'equals', x, '*', n/x
> > ... b
jmDesktop wrote:
>>From the Python.org tutorial:
>
for n in range(2, 10):
> ... for x in range(2, n):
> ... if n % x == 0:
> ... print n, 'equals', x, '*', n/x
> ... break
> ... else:
> ... # loop fell through without finding a factor
> ...
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:python-
> [EMAIL PROTECTED] On Behalf Of jmDesktop
> Sent: Wednesday, April 09, 2008 4:51 PM
> To: python-list@python.org
> Subject: basic python question about for loop
>
> >From the Python.org tutorial
jmDesktop schrieb:
> From the Python.org tutorial:
>
for n in range(2, 10):
> ... for x in range(2, n):
> ... if n % x == 0:
> ... print n, 'equals', x, '*', n/x
> ... break
> ... else:
> ... # loop fell through without finding a factor
> ...
>From the Python.org tutorial:
>>> for n in range(2, 10):
... for x in range(2, n):
... if n % x == 0:
... print n, 'equals', x, '*', n/x
... break
... else:
... # loop fell through without finding a factor
... print n, 'is a prime number'
..
26 matches
Mail list logo