Source code for preprocessing.utils.unfold
"""
unfolds merges dataframes into a big feature matrix
All the features are labeled with a date and two keys for identification
Better explainations and schemas can be found on the repo wiki
"""
import numpy as np
import pandas as pd
from scipy.sparse import csr_matrix
from multiprocessing.pool import Pool
from sklearn.base import BaseEstimator
[docs]class Unfolder(BaseEstimator):
"""
Takes a dataframe[key1, key2, feature, value, date] to build a matrix of
the parameters grouped by [key1, key2, date]
This object is to be used after a timeframe of the feature has been build to
group them into a feature matrix.
The idea is to facilitate the data preparation for a sequential learning
task.
Parameters
----------
key1 : str
primary key
key2 : str
secondary key
feature : str
name of the feature
value : float
value of the feature `feature`
date : datetime
date at which `feature` was measured
n_jobs : int
number of CPUs to use for computation. If -1, all the available cores
are used
"""
def __init__(self, key1, key2, feature, value, date, n_jobs=1):
self.key1 = key1
self.key2 = key2
self.feature = feature
self.value = value
self.date = date
self.n_jobs = n_jobs
self.df_ = None
[docs] def fit(self, df):
""" saves dataframe for multiprocessing convenience
Parameters
----------
df : pandas.DataFrame
Returns
-------
self
"""
self.df_ = df
return self
[docs] def unfold(self):
""" performs the unfolding transformation
Returns
-------
pandas.DataFrame
The dataframe that contains the added feature columns
Rows are ordered by [key1, key2, date] for convenience
"""
df_res = self.df_.loc[:, [self.key1, self.key2, self.date]]
if self.n_jobs == -1:
pool = Pool()
else:
pool = Pool(self.n_jobs)
unique_features = self.df_[self.feature].unique()
new_cols = pool.map(self.add_columns, unique_features)
df_res.reset_index(drop=True, inplace=True)
df_res = pd.concat([df_res] + [new_col for new_col in new_cols],
axis=1)
# aggregation function for group by
agg_dic = {key: 'mean' for key in unique_features}
df_grouped = df_res.groupby(by=[self.key1, self.key2, self.date],
sort=False,
as_index=False).agg(agg_dic)
return df_grouped
[docs] def add_columns(self, feature_name):
""" adds a column of a given feature
This auxiliary function is to ease the use of multiprocess.pool.Pool
Parameters
----------
feature_name : str
name of the feature we are adding to the dataframe
Returns
-------
pandas.DataFrame
contains a single column `feature_name` that contains values
or NaN depending on the presence of the feature for each row
"""
new_col = []
for i in self.df_.index:
if self.df_.at[i, self.feature] == feature_name:
new_col.append(self.df_.at[i, self.value])
else:
new_col.append(np.nan)
return pd.DataFrame(new_col, columns=[feature_name])
[docs]def transform_and_label(df, key1, key2, date, feature, value,
estimator, return_estimator=False,
**kwargs):
""" Takes dataframe as input, applies transformation on value column and
returns df with a new columns of the transformed feature
The transformation returns a copy of the input dataframe
Only implements unsupervised transformation
Parameters
----------
df : pandas.DataFrame
should contain only one unique value in its `feature` column
feature : str
features names column
value : str
features values column
estimator : sklearn.BaseEstimator
sklearn compatible transformer that implements .fit() and
.fold() methods
return_estimator : bool
if true, returns the trained estimator
**kwargs : additional keyword arguments for estimator object
Returns
-------
pandas.DataFrame
same as df with additional rows for the transformed feature
"""
# unsupervised transformation
old_col = df[value].values
transformer = estimator(**kwargs).fit(old_col)
new_col = transformer.transform(old_col)
# converts to numpy.ndarray
if type(new_col) in [pd.DataFrame, pd.Series]:
new_col = new_col.values
elif type(new_col) == csr_matrix:
new_col = new_col.todense()
else:
new_col = new_col
df_res = pd.DataFrame(None, columns=df.columns)
# filling new rows
for i in range(new_col.shape[0]):
for j in range(new_col.shape[1]):
row = {key1: df.at[i, key1],
key2: df.at[i, key2],
feature: df.at[i, feature] + '_{}'.format(j),
value: new_col[i, j],
date: df.at[i, date]}
df_res = df_res.append(row, ignore_index=True)
if return_estimator:
return df_res, estimator
else:
return df_res


THE BAD LIEUTENANT A film review by Max Hoffmann Copyright 1993 Max Hoffmann
Rating: NC-17 Max Reax = 0 on scale of 0 --- 10 ^ ^ | | sux must see
Avoid this film at all costs (even eventual cable/video rental) because it is an overinflated, crashing bore! Roger Ebert gave it "highest rating," and the "little man" in the Chronicle is falling out of his chair. Ironically, it's playing at the 438-seat Gateway in San Francisco, where ridiculous reviews are causing long lines, and sell-outs, adding to the myth that this is a real find. (Hey, it fooled me!)
 Fortunately, teenagers won't be subjected to the same eyelid-tugging snooze-pusher that I went through. There is also the controversy of a nun being raped on an altar, and the "F"-word in grafitti on the altar.
Why is this film a bore? 80% of it is watching Harvey Kietel snort coke in a variety of locations, or shooting up junk and going comatose. We never learn his, or most of the characters' names. I think the film could have been more interesting or worthwhile if it were set earlier in the Lieutenant's addiction cycle when there were enough brain cells for him to show some character development or motivation. Neither are present in this film. What Ebert lauded as Keitel's "performance of a lifetime" amounts to a convincing portrayal of a junkie cop trying to stay upright, negotiate walking down stairs, driving a car, and supposedly acting "normal" enough to keep his job.
It is inconceivable that non-addicted cops would entrust tens of thousands of dollars in World Series bets to anyone in Kietel's medical condition.
What about the "nun" thing? Unless you are a vitriolic "recovering Catholic," (who gets off on seeing sacred icons violated) or a "good Catholic" (who can't go to this film anyway,) you'll probably "feel" absolutely nothing during the violation of the nun on the altar. It is incredibly stagy, and has the suspicious look of gratuitous sex tossed in to keep the crowd awake. The nun and her violators are made to look way too appealing, and due to colored filters and moody, jumpy photography, you get the eerie feeling you just turned on one of Cinemax's softcore 1 AM epics. One of the rapists has the same kind of muscled nude back you see on the cover of many Romance Novels. (Maybe they're trying for a title like "Love's Burning Chalice"?)
The nun's refusal to identify her attackers (who are students from her class whom she recognized) is supposedly the crux of the film and its denouement. Unfortunately, the actress who plays the nun (we don't find out her character's name either) is merely gorgeous and can't act. Her "Jesus would have seen it this way," stance is about as believable as Harvey Kietel escaping the notice of internal affairs. Harvey Kietel's "big moment" is when he completely "loses it," has a mental breakdown in church, and while supplicant on his knees actually "sees" Jesus and starts swearing at him (another reason for the NC-17, I suppose.) Unfortunately, you have to repress the urge to laugh because it's nearly a carbon copy of Patty Duke's overblown final scene as "Neely O'Hare" in VALLEY OF THE DOLLS where she falls to her knees in the alley and cries "God? God? Is that *you*?" (VALLEY is coming to San Francisco's Castro Monday January 11 and to the Sashmill in Santa Cruz Sunday January 31.)
I think this film falls into the same class as LAST TANGO IN PARIS" an overated bore of a film that might provide enough prurient interest for some middle-aged critics to "get off on," but for the rest of us, tune into Cinemax at 1 AM and you get a whole lot more of the same thing and at least the bodies are worth looking at. (P.S. That really is Harvey Kietel's body on the poster/movie ad, unfortunately its attached to Harvey Kietel's face!)
If this is the director's way of therapizing as a recovering Catholic, we can only wish that he had taken Sinead O'Conner's route, which was a lot quicker, and like jerking a Band-Aid off a hairy arm, a lot less painful than this tepid, two-hour tug.
-- Max Hoffmann .
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


These are basic tests for the button control
| Themes (themes should look correct) |
|
| Disabled (all buttons should be disabled) |
|
| Margin/Padding Test on native element |
|
| Enable/Disable Actions | |
| Horizontal layout (should flow left to right) |
|
| Click testing |
|
| Button in a panel |
|
| Button with padding and margin around it |
|
| Button in a modal panel |
|
| Buttons in a border layout |
|


Alternatively, click anywhere to continue in windowed mode
Exit from this Level?
Final Time:
Qualify Time:
Gold Time:
Elapsed Time:
Bonus Time:
Best Times:
Congratulations!
Changelog
Best Times:
Online Leaderboard:
Loading scores...
Not Qualified!
New!
Overview
Roll your marble through a rich cartoon landscape of moving platforms and dangerous hazards. Along the way find power ups to increase your speed, jumping ability or flight power, and use them to collect the hidden gems and race to the finish for the fastest time.
Basic Controls
The marble can be moved forward, back, left and right by pressing , , and , respectively. Pressing causes the marble to jump, and pressing uses whatever powerup you currently have available. All movement is relative to view direction.
Camera Controls
The camera direction can be changed by moving the mouse or by pressing , , or . In order to look up and down freely with the mouse, hold down . You can turn free look on always from the Mouse pane of the Control Options screen.
Goals
Start Pad - this is where you start the level.
End Pad - roll your marble here to end the level.
Gems - if a level has gems, you must pick them all up before you can exit.
Bonus Items (1/2)
Super Speed PowerUp - gives you a burst of speed.

Shock Absorber PowerUp - absorbs bounce impacts.
Super Bounce PowerUp - makes you bounce higher.
Bonus Items (2/2)
Gyrocopter PowerUp - slows your fall in the air.
Time Travel - takes some time off the clock.
Gravity Modifier - Changes the direction of "down" - the new down is in the direction of the arrow.
Hazards (1/2)
Duct Fan - be careful this doesn't blow you away!
Tornado - it'll pull you in and spit you out.
Trap Door - keep moving when you're rolling over one of these.
Hazards (2/2)
Bumper - this'll bounce you if you touch it.
Land Mine - Warning! Explodes on contact!
Oil Slick - you won't have much traction on these surfaces.
About GarageGames
GarageGames is a unique Internet publishing label for independent games and gamemakers. Our mission is to provide the independent developer with tools, knowledge, co-conspirators - whatever is needed to unleash the creative spirit and get great innovative independent games to market.
About the Torque
The Torque Game Engine (TGE) is a full featured AAA title engine with the latest in scripting, geometry, particle effects, animation and texturing, as well as award winning multi-player networking code. For $100 per programmer, you get the source to the engine!
The Marble Blast Team
Alex Swanson
Mark Frohnmayer
Jeff Tunnell
Brian Hahn
Liam Ryan
Tim Gift
Rick Overman
Kevin Ryan
Timothy Clarke
Jay Moore
Pat Wilson
John Quigley
Special Thanks
We'd like to thank Nullsoft, for the SuperPiMP Install System, and Markus F.X.J. Oberhumer, Laszlo Molnar and the rest of the UPX team for the UPX executable packer. Thanks also to Kurtis Seebaldt for his work on integrating Ogg/Vorbis streaming into the Torque engine, and to the Ogg/Vorbis team.
Web Port
This web port of Marble Blast Gold was done by Vanilagy - all the code is free to access on GitHub. Full rights go to GarageGames and other creators of this game. Special thanks to the maintainers of three.js and OimoPhysics for making this project possible!
Custom Marble Texture:
Choose
Reset
Reflective Marble:
Vendor: Creative Labs Inc.
Version: OpenAL 1.0
Renderer: Software
Extensions: EAX 2.0, EAX 3.0, EAX Unified, and EAX-AC3